| 184 | } |
| 185 | |
| 186 | func (packer *MessagePacker) writePublish(writer io.Writer, appName string, streamName string, streamid int) error { |
| 187 | packer.b.ModWritePos(12) |
| 188 | |
| 189 | _ = Amf0.WriteString(packer.b, "publish") |
| 190 | _ = Amf0.WriteNumber(packer.b, float64(tidClientPublish)) |
| 191 | _ = Amf0.WriteNull(packer.b) |
| 192 | _ = Amf0.WriteString(packer.b, streamName) |
| 193 | |
| 194 | // <spec-rtmp_specification_1.0.pdf> |
| 195 | // 7.2.2.6. publish |
| 196 | // |
| 197 | // Type of publishing. |
| 198 | // Set to "live": Live data is published without recording it in a file. |
| 199 | // |
| 200 | _ = Amf0.WriteString(packer.b, "live") |
| 201 | |
| 202 | return packer.ChunkAndWrite(writer, csidOverStream, base.RtmpTypeIdCommandMessageAmf0, streamid) |
| 203 | } |
| 204 | |
| 205 | func (packer *MessagePacker) writeOnStatusPublish(writer io.Writer, streamid int) error { |
| 206 | packer.b.ModWritePos(12) |