{"modulePath":"github.com/Monibuca/plugin-rtmp","version":"v1.2.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package rtmp\n\n## Constants\n\n```go\nconst (\n\tAMF0_NUMBER         = 0x00 // 浮点数\n\tAMF0_BOOLEAN        = 0x01 // 布尔型\n\tAMF0_STRING         = 0x02 // 字符串\n\tAMF0_OBJECT         = 0x03 // 对象,开始\n\tAMF0_MOVIECLIP      = 0x04\n\tAMF0_NULL           = 0x05 // null\n\tAMF0_UNDEFINED      = 0x06\n\tAMF0_REFERENCE      = 0x07\n\tAMF0_ECMA_ARRAY     = 0x08\n\tAMF0_END_OBJECT     = 0x09 // 对象,结束\n\tAMF0_STRICT_ARRAY   = 0x0A\n\tAMF0_DATE           = 0x0B // 日期\n\tAMF0_LONG_STRING    = 0x0C // 字符串\n\tAMF0_UNSUPPORTED    = 0x0D\n\tAMF0_RECORDSET      = 0x0E\n\tAMF0_XML_DOCUMENT   = 0x0F\n\tAMF0_TYPED_OBJECT   = 0x10\n\tAMF0_AVMPLUS_OBJECT = 0x11\n\n\tAMF3_UNDEFINED     = 0x00\n\tAMF3_NULL          = 0x01\n\tAMF3_FALSE         = 0x02\n\tAMF3_TRUE          = 0x03\n\tAMF3_INTEGER       = 0x04\n\tAMF3_DOUBLE        = 0x05\n\tAMF3_STRING        = 0x06\n\tAMF3_XML_DOC       = 0x07\n\tAMF3_DATE          = 0x08\n\tAMF3_ARRAY         = 0x09\n\tAMF3_OBJECT        = 0x0A\n\tAMF3_XML           = 0x0B\n\tAMF3_BYTE_ARRAY    = 0x0C\n\tAMF3_VECTOR_INT    = 0x0D\n\tAMF3_VECTOR_UINT   = 0x0E\n\tAMF3_VECTOR_DOUBLE = 0x0F\n\tAMF3_VECTOR_OBJECT = 0x10\n\tAMF3_DICTIONARY    = 0x11\n)\n```\n\n```go\nconst (\n\tRTMP_CHUNK_HEAD_12 = 0 \u003c\u003c 6 // Chunk Basic Header = (Chunk Type \u003c\u003c 6) | Chunk Stream ID.\n\tRTMP_CHUNK_HEAD_8  = 1 \u003c\u003c 6\n\tRTMP_CHUNK_HEAD_4  = 2 \u003c\u003c 6\n\tRTMP_CHUNK_HEAD_1  = 3 \u003c\u003c 6\n)\n```\n\n```go\nconst (\n\tResponse_OnStatus = \"onStatus\"\n\tResponse_Result   = \"_result\"\n\tResponse_Error    = \"_error\"\n\n\t/* Level */\n\tLevel_Status  = \"status\"\n\tLevel_Error   = \"error\"\n\tLevel_Warning = \"warning\"\n\n\t/* Code */\n\t/* NetStream */\n\tNetStream_Play_Reset          = \"NetStream.Play.Reset\"          // \"status\" 由播放列表重置导致\n\tNetStream_Play_Start          = \"NetStream.Play.Start\"          // \"status\" 播放已开始\n\tNetStream_Play_StreamNotFound = \"NetStream.Play.StreamNotFound\" // \"error\"  无法找到传递给 play()方法的 FLV\n\tNetStream_Play_Stop           = \"NetStream.Play.Stop\"           // \"status\" 播放已结束\n\tNetStream_Play_Failed         = \"NetStream.Play.Failed\"         // \"error\"  出于此表中列出的原因之外的某一原因(例如订阅者没有读取权限),播放发生了错误\n\n\tNetStream_Play_Switch   = \"NetStream.Play.Switch\"\n\tNetStream_Play_Complete = \"NetStream.Play.Switch\"\n\n\tNetStream_Data_Start = \"NetStream.Data.Start\"\n\n\tNetStream_Publish_Start     = \"NetStream.Publish.Start\"     // \"status\"\t已经成功发布.\n\tNetStream_Publish_BadName   = \"NetStream.Publish.BadName\"   // \"error\"\t试图发布已经被他人发布的流.\n\tNetStream_Publish_Idle      = \"NetStream.Publish.Idle\"      // \"status\"\t流发布者空闲而没有在传输数据.\n\tNetStream_Unpublish_Success = \"NetStream.Unpublish.Success\" // \"status\"\t已成功执行取消发布操作.\n\n\tNetStream_Buffer_Empty   = \"NetStream.Buffer.Empty\"   // \"status\" 数据的接收速度不足以填充缓冲区.数据流将在缓冲区重新填充前中断,此时将发送 NetStream.Buffer.Full 消息,并且该流将重新开始播放\n\tNetStream_Buffer_Full    = \"NetStream.Buffer.Full\"    // \"status\" 缓冲区已满并且流将开始播放\n\tNetStream_Buffe_Flush    = \"NetStream.Buffer.Flush\"   // \"status\" 数据已完成流式处理,剩余的缓冲区将被清空\n\tNetStream_Pause_Notify   = \"NetStream.Pause.Notify\"   // \"status\" 流已暂停\n\tNetStream_Unpause_Notify = \"NetStream.Unpause.Notify\" // \"status\" 流已恢复\n\n\tNetStream_Record_Start    = \"NetStream.Record.Start\"    // \"status\"\t录制已开始.\n\tNetStream_Record_NoAccess = \"NetStream.Record.NoAccess\" // \"error\"\t试图录制仍处于播放状态的流或客户端没有访问权限的流.\n\tNetStream_Record_Stop     = \"NetStream.Record.Stop\"     // \"status\"\t录制已停止.\n\tNetStream_Record_Failed   = \"NetStream.Record.Failed\"   // \"error\"\t尝试录制流失败.\n\n\tNetStream_Seek_Failed      = \"NetStream.Seek.Failed\"      // \"error\"\t搜索失败,如果流处于不可搜索状态,则会发生搜索失败.\n\tNetStream_Seek_InvalidTime = \"NetStream.Seek.InvalidTime\" // \"error\"\t对于使用渐进式下载方式下载的视频,用户已尝试跳过到目前为止已下载的视频数据的结尾或在整个文件已下载后跳过视频的结尾进行搜寻或播放. message.details 属性包含一个时间代码,该代码指出用户可以搜寻的最后一个有效位置.\n\tNetStream_Seek_Notify      = \"NetStream.Seek.Notify\"      // \"status\"\t搜寻操作完成.\n\n\t/* NetConnect */\n\tNetConnection_Call_BadVersion     = \"NetConnection.Call.BadVersion\"     // \"error\"\t以不能识别的格式编码的数据包.\n\tNetConnection_Call_Failed         = \"NetConnection.Call.Failed\"         // \"error\"\tNetConnection.call 方法无法调用服务器端的方法或命令.\n\tNetConnection_Call_Prohibited     = \"NetConnection.Call.Prohibited\"     // \"error\"\tAction Message Format (AMF) 操作因安全原因而被阻止. 或者是 AMF URL 与 SWF 不在同一个域,或者是 AMF 服务器没有信任 SWF 文件的域的策略文件.\n\tNetConnection_Connect_AppShutdown = \"NetConnection.Connect.AppShutdown\" // \"error\"\t正在关闭指定的应用程序.\n\tNetConnection_Connect_InvalidApp  = \"NetConnection.Connect.InvalidApp\"  // \"error\"\t连接时指定的应用程序名无效.\n\tNetConnection_Connect_Success     = \"NetConnection.Connect.Success\"     // \"status\"\t连接尝试成功.\n\tNetConnection_Connect_Closed      = \"NetConnection.Connect.Closed\"      // \"status\"\t成功关闭连接.\n\tNetConnection_Connect_Failed      = \"NetConnection.Connect.Failed\"      // \"error\"\t连接尝试失败.\n\tNetConnection_Connect_Rejected    = \"NetConnection.Connect.Rejected\"    // \"error\"  连接尝试没有访问应用程序的权限.\n\n\t/* SharedObject */\n\tSharedObject_Flush_Success  = \"SharedObject.Flush.Success\"  //\"status\"\t\"待定\"状态已解析并且 SharedObject.flush() 调用成功.\n\tSharedObject_Flush_Failed   = \"SharedObject.Flush.Failed\"   //\"error\"\t\"待定\"状态已解析,但 SharedObject.flush() 失败.\n\tSharedObject_BadPersistence = \"SharedObject.BadPersistence\" //\"error\"\t使用永久性标志对共享对象进行了请求,但请求无法被批准,因为已经使用其它标记创建了该对象.\n\tSharedObject_UriMismatch    = \"SharedObject.UriMismatch\"    //\"error\"\t试图连接到拥有与共享对象不同的 URI (URL) 的 NetConnection 对象.\n)\n```\n\n```go\nconst (\n\tC1S1_SIZE = 1536\n\n\tC1S1_TIME_SIZE    = 4\n\tC1S1_VERSION_SIZE = 4\n\n\tC1S1_DIGEST_SIZE        = 764\n\tC1S1_DIGEST_OFFSET_SIZE = 4\n\tC1S1_DIGEST_OFFSET_MAX  = 764 - 32 - 4\n\tC1S1_DIGEST_DATA_SIZE   = 32\n\n\tC1S1_KEY_SIZE        = 764\n\tC1S1_KEY_OFFSET_SIZE = 4\n\tC1S1_KEY_OFFSET_MAX  = 764 - 128 - 4\n\tC1S1_KEY_DATA_SIZE   = 128\n\n\tRTMP_HANDSHAKE_VERSION = 0x03\n)\n```\n\n```go\nconst (\n\n\t// Chunk\n\tRTMP_MSG_CHUNK_SIZE = 1\n\tRTMP_MSG_ABORT      = 2\n\n\t// RTMP\n\tRTMP_MSG_ACK           = 3\n\tRTMP_MSG_USER_CONTROL  = 4\n\tRTMP_MSG_ACK_SIZE      = 5\n\tRTMP_MSG_BANDWIDTH     = 6\n\tRTMP_MSG_EDGE          = 7\n\tRTMP_MSG_AUDIO         = 8\n\tRTMP_MSG_VIDEO         = 9\n\tRTMP_MSG_AMF3_METADATA = 15\n\tRTMP_MSG_AMF3_SHARED   = 16\n\tRTMP_MSG_AMF3_COMMAND  = 17\n\n\tRTMP_MSG_AMF0_METADATA = 18\n\tRTMP_MSG_AMF0_SHARED   = 19\n\tRTMP_MSG_AMF0_COMMAND  = 20\n\n\tRTMP_MSG_AGGREGATE = 22\n\n\tRTMP_DEFAULT_CHUNK_SIZE = 128\n\tRTMP_MAX_CHUNK_SIZE     = 65536\n\tRTMP_MAX_CHUNK_HEADER   = 18\n\n\t// User Control Event\n\tRTMP_USER_STREAM_BEGIN       = 0\n\tRTMP_USER_STREAM_EOF         = 1\n\tRTMP_USER_STREAM_DRY         = 2\n\tRTMP_USER_SET_BUFFLEN        = 3\n\tRTMP_USER_STREAM_IS_RECORDED = 4\n\tRTMP_USER_PING_REQUEST       = 6\n\tRTMP_USER_PING_RESPONSE      = 7\n\tRTMP_USER_EMPTY              = 31\n\n\t// StreamID == (ChannelID-4)/5+1\n\t// ChannelID == Chunk Stream ID\n\t// StreamID == Message Stream ID\n\t// Chunk Stream ID == 0, 第二个byte + 64\n\t// Chunk Stream ID == 1, (第三个byte) * 256 + 第二个byte + 64\n\t// Chunk Stream ID == 2.\n\t// 2 \u003c Chunk Stream ID \u003c 64(2的6次方)\n\tRTMP_CSID_CONTROL = 0x02\n\tRTMP_CSID_COMMAND = 0x03\n\tRTMP_CSID_AUDIO   = 0x06\n\tRTMP_CSID_DATA    = 0x05\n\tRTMP_CSID_VIDEO   = 0x05\n)\n```\n\n```go\nconst (\n\tSEND_CHUNK_SIZE_MESSAGE         = \"Send Chunk Size Message\"\n\tSEND_ACK_MESSAGE                = \"Send Acknowledgement Message\"\n\tSEND_ACK_WINDOW_SIZE_MESSAGE    = \"Send Window Acknowledgement Size Message\"\n\tSEND_SET_PEER_BANDWIDTH_MESSAGE = \"Send Set Peer Bandwidth Message\"\n\n\tSEND_STREAM_BEGIN_MESSAGE       = \"Send Stream Begin Message\"\n\tSEND_SET_BUFFER_LENGTH_MESSAGE  = \"Send Set Buffer Lengh Message\"\n\tSEND_STREAM_IS_RECORDED_MESSAGE = \"Send Stream Is Recorded Message\"\n\n\tSEND_PING_REQUEST_MESSAGE  = \"Send Ping Request Message\"\n\tSEND_PING_RESPONSE_MESSAGE = \"Send Ping Response Message\"\n\n\tSEND_CONNECT_MESSAGE          = \"Send Connect Message\"\n\tSEND_CONNECT_RESPONSE_MESSAGE = \"Send Connect Response Message\"\n\n\tSEND_CREATE_STREAM_MESSAGE          = \"Send Create Stream Message\"\n\tSEND_CREATE_STREAM_RESPONSE_MESSAGE = \"Send Create Stream Response Message\"\n\n\tSEND_PLAY_MESSAGE          = \"Send Play Message\"\n\tSEND_PLAY_RESPONSE_MESSAGE = \"Send Play Response Message\"\n\n\tSEND_PUBLISH_RESPONSE_MESSAGE = \"Send Publish Response Message\"\n\tSEND_PUBLISH_START_MESSAGE    = \"Send Publish Start Message\"\n\n\tSEND_UNPUBLISH_RESPONSE_MESSAGE = \"Send Unpublish Response Message\"\n\n\tSEND_AUDIO_MESSAGE      = \"Send Audio Message\"\n\tSEND_FULL_AUDIO_MESSAGE = \"Send Full Audio Message\"\n\tSEND_VIDEO_MESSAGE      = \"Send Video Message\"\n\tSEND_FULL_VDIEO_MESSAGE = \"Send Full Video Message\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tFMS_KEY = []byte{\n\t\t0x47, 0x65, 0x6e, 0x75, 0x69, 0x6e, 0x65, 0x20,\n\t\t0x41, 0x64, 0x6f, 0x62, 0x65, 0x20, 0x46, 0x6c,\n\t\t0x61, 0x73, 0x68, 0x20, 0x4d, 0x65, 0x64, 0x69,\n\t\t0x61, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,\n\t\t0x20, 0x30, 0x30, 0x31,\n\t\t0xf0, 0xee, 0xc2, 0x4a, 0x80, 0x68, 0xbe, 0xe8,\n\t\t0x2e, 0x00, 0xd0, 0xd1, 0x02, 0x9e, 0x7e, 0x57,\n\t\t0x6e, 0xec, 0x5d, 0x2d, 0x29, 0x80, 0x6f, 0xab,\n\t\t0x93, 0xb8, 0xe6, 0x36, 0xcf, 0xeb, 0x31, 0xae,\n\t} // 68\n\tFP_KEY = []byte{\n\t\t0x47, 0x65, 0x6E, 0x75, 0x69, 0x6E, 0x65, 0x20,\n\t\t0x41, 0x64, 0x6F, 0x62, 0x65, 0x20, 0x46, 0x6C,\n\t\t0x61, 0x73, 0x68, 0x20, 0x50, 0x6C, 0x61, 0x79,\n\t\t0x65, 0x72, 0x20, 0x30, 0x30, 0x31,\n\t\t0xF0, 0xEE, 0xC2, 0x4A, 0x80, 0x68, 0xBE, 0xE8,\n\t\t0x2E, 0x00, 0xD0, 0xD1, 0x02, 0x9E, 0x7E, 0x57,\n\t\t0x6E, 0xEC, 0x5D, 0x2D, 0x29, 0x80, 0x6F, 0xAB,\n\t\t0x93, 0xB8, 0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE,\n\t} // 62\n)\n```\n\n```go\nvar END_OBJ = []byte{0, 0, AMF0_END_OBJECT}\n```\n\n## Functions\n\n```go\nfunc DecodeAMFObject(obj interface{}, key string) interface{}\n```\n\n```go\nfunc GetRtmpMessage(chunk *Chunk)\n```\n\n```go\nfunc HMAC_SHA256(message []byte, key []byte) ([]byte, error)\n```\nHMAC运算利用哈希算法,以一个密钥和一个消息为输入,生成一个消息摘要作为输出 哈希算法sha256.New, 密钥 key, 消息 message.\n\n```go\nfunc Handshake(brw *bufio.ReadWriter) error\n```\n\n```go\nfunc ListenRtmp(addr string) error\n```\n\n```go\nfunc ReadBuf(r io.Reader, length int) (buf []byte)\n```\n\n## Types\n\n```go\ntype AMF struct {\n\t*bytes.Buffer\n}\n```\n\n```go\ntype AMFObject interface{}\n```\n\n```go\ntype AMFObjects map[string]AMFObject\n```\n\n```go\ntype CURDStreamMessage struct {\n\tCommandMessage\n\tStreamId uint32\n}\n```\nDelete Stream Message NetStream sends the deleteStream command when the NetStream object is getting destroyed\n\n```go\nfunc (msg *CURDStreamMessage) Encode0()\n```\n\n```go\ntype CallMessage struct {\n\tCommandMessage\n\tObject   interface{} `json:\",omitempty\"`\n\tOptional interface{} `json:\",omitempty\"`\n}\n```\nCall Message. The call method of the NetConnection object runs remote procedure calls (RPC) at the receiving end. The called RPC name is passed as a parameter to the call command.\n\n```go\nfunc (msg *CallMessage) Encode() []byte\n```\n\n```go\nfunc (msg *CallMessage) Encode3() []byte\n```\n\n```go\ntype Chunk struct {\n\t*ChunkHeader\n\tBody    []byte\n\tMsgData interface{}\n}\n```\n\n```go\nfunc (c *Chunk) Encode(msg RtmpMessage)\n```\n\n```go\nfunc (c *Chunk) Recycle()\n```\n\n```go\ntype ChunkBasicHeader struct {\n\tChunkStreamID uint32 `json:\"\"` // 6 bit. 3 ~ 65559, 0,1,2 reserved\n\tChunkType     byte   `json:\"\"` // 2 bit.\n}\n```\nBasic Header (1 to 3 bytes) : This field encodes the chunk stream ID and the chunk type. Chunk type determines the format of the encoded message header. The length(Basic Header) depends entirely on the chunk stream ID, which is a variable-length field.\n\n```go\ntype ChunkExtendedTimestamp struct {\n\tExtendTimestamp uint32 `json:\",omitempty\"` // 标识该字段的数据可忽略\n}\n```\nExtended Timestamp (0 or 4 bytes): This field is present in certain circumstances depending on the encoded timestamp or timestamp delta field in the Chunk Message header. See Section 5.3.1.3 for more information\n\n```go\ntype ChunkHeader struct {\n\tChunkBasicHeader\n\tChunkMessageHeader\n\tChunkExtendedTimestamp\n}\n```\n\n```go\nfunc (h *ChunkHeader) Clone() *ChunkHeader\n```\n\n```go\ntype ChunkMessageHeader struct {\n\tTimestamp       uint32 `json:\"\"` // 3 byte\n\tMessageLength   uint32 `json:\"\"` // 3 byte\n\tMessageTypeID   byte   `json:\"\"` // 1 byte\n\tMessageStreamID uint32 `json:\"\"` // 4 byte\n}\n```\nMessage Header (0, 3, 7, or 11 bytes): This field encodes information about the message being sent (whether in whole or in part). The length can be determined using the chunk type specified in the chunk header.\n\n```go\ntype CommandMessage struct {\n\tCommandName   string // 命令名. 字符串. 命令名.设置为\"connect\"\n\tTransactionId uint64 // 传输ID. 数字. 总是设为1\n}\n```\nCommand Message\n\n```go\nfunc (msg *CommandMessage) Encode() (b []byte)\n```\n\n```go\nfunc (cmd *CommandMessage) GetCommand() *CommandMessage\n```\n\n```go\ntype Commander interface {\n\tGetCommand() *CommandMessage\n}\n```\n\n```go\ntype CreateStreamMessage struct {\n\tCommandMessage\n\tObject interface{}\n}\n```\n\n```go\nfunc (msg *CreateStreamMessage) Encode() []byte\n```\n\n```go\ntype HaveStreamID interface {\n\tGetStreamID() uint32\n}\n```\n\n```go\ntype MetadataMessage struct {\n\tProterties map[string]interface{} `json:\",omitempty\"`\n}\n```\nMessage 15, 18. Data Message. The client or the server sends this message to send Metadata or any user data to the peer. Metadata includes details about the data(audio, video etc.) like creation time, duration, theme and so on. These messages have been assigned message type value of 18 for AMF0 and message type value of 15 for AMF3\n\n```go\ntype NetConnection struct {\n\t*bufio.ReadWriter\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (conn *NetConnection) OnConnect() (err error)\n```\n\n```go\nfunc (conn *NetConnection) RecvMessage() (msg *Chunk, err error)\n```\n\n```go\nfunc (conn *NetConnection) SendMessage(message string, args interface{}) error\n```\n\n```go\ntype NetStatusEvent struct {\n\tCode  string\n\tLevel string\n}\n```\n\n```go\ntype PauseMessage struct {\n\tCommandMessage\n\tPause        bool\n\tMilliseconds uint64\n}\n```\nPause Message The client sends the pause command to tell the server to pause or start playing.\n\n```go\nfunc (msg *PauseMessage) Encode0()\n```\n\n```go\ntype PingRequestMessage struct {\n\tUserControlMessage\n\tTimestamp uint32\n}\n```\nPingRequest (=6) The server sends this event to test whether the client is reachable. Event data is a 4-byte timestamp, representing the local server time when the server dispatched the command. The client responds with PingResponse on receiving MsgPingRequest.\n\n```go\nfunc (msg *PingRequestMessage) Encode() (b []byte)\n```\n\n```go\ntype Play2Message struct {\n\tCommandMessage\n\tStartTime     uint64\n\tOldStreamName string\n\tStreamName    string\n\tDuration      uint64\n\tTransition    string\n}\n```\nPlay2 Message Unlike the play command, play2 can switch to a different bit rate stream without changing the timeline of the content played. The server maintains multiple files for all supported bitrates that the client can request in play2.\n\n```go\nfunc (msg *Play2Message) Encode0()\n```\n\n```go\ntype PlayMessage struct {\n\tCommandMessage\n\tStreamName string\n\tStart      uint64\n\tDuration   uint64\n\tRest       bool\n}\n```\nPlay Message The client sends this command to the server to play a stream. A playlist can also be created using this command multiple times\n\n```go\nfunc (msg *PlayMessage) Encode() []byte\n```\n\n```go\ntype PublishMessage struct {\n\tCommandMessage\n\tPublishingName string\n\tPublishingType string\n}\n```\nPublish Message The client sends the publish command to publish a named stream to the server. Using this name, any client can play this stream and receive the published audio, video, and data messages\n\n```go\nfunc (msg *PublishMessage) Encode0()\n```\n\n```go\ntype RTMP struct {\n\tPublisher\n}\n```\n\n```go\ntype ReceiveAVMessage struct {\n\tCommandMessage\n\tBoolFlag bool\n}\n```\nReceive Audio Message NetStream sends the receiveAudio message to inform the server whether to send or not to send the audio to the client\n\n```go\nfunc (msg *ReceiveAVMessage) Encode0()\n```\n\n```go\ntype ReleaseStreamMessage struct {\n\tCommandMessage\n\tStreamName string\n}\n```\n\n```go\nfunc (msg *ReleaseStreamMessage) Encode0()\n```\n\n```go\ntype ResponseCallMessage struct {\n\tCommandMessage\n\tObject   interface{}\n\tResponse interface{}\n}\n```\nResponse Call Message\n\n```go\nfunc (msg *ResponseCallMessage) Encode0() []byte\n```\n\n```go\ntype ResponseConnectMessage struct {\n\tCommandMessage\n\tProperties interface{} `json:\",omitempty\"`\n\tInfomation interface{} `json:\",omitempty\"`\n}\n```\nResponse Connect Message\n\n```go\nfunc (msg *ResponseConnectMessage) Encode() []byte\n```\n\n```go\ntype ResponseCreateStreamMessage struct {\n\tCommandMessage\n\tObject   interface{} `json:\",omitempty\"`\n\tStreamId uint32\n}\n```\nResponse Create Stream Message\n\n```go\nfunc (msg *ResponseCreateStreamMessage) Decode0(chunk *Chunk)\n```\n\n```go\nfunc (msg *ResponseCreateStreamMessage) Decode3(chunk *Chunk)\n```\n\n```go\nfunc (msg *ResponseCreateStreamMessage) Encode() []byte\n```\n\n```go\ntype ResponseMessage struct {\n\tCommandMessage\n\tProperties  interface{} `json:\",omitempty\"`\n\tInfomation  interface{} `json:\",omitempty\"`\n\tDescription string\n}\n```\nResponse Message\n\n```go\nfunc (msg *ResponseMessage) Decode0(chunk *Chunk)\n```\n\n```go\nfunc (msg *ResponseMessage) Encode0()\n```\n\n```go\ntype ResponsePauseMessage struct {\n\tCommandMessage\n\tDescription string\n}\n```\nResponse Pause Message\n\n```go\nfunc (msg *ResponsePauseMessage) Encode0()\n```\n\n```go\ntype ResponsePlayMessage struct {\n\tCommandMessage\n\tObject      interface{} `json:\",omitempty\"`\n\tDescription string\n\tStreamID    uint32\n}\n```\nResponse Play Message\n\n```go\nfunc (msg *ResponsePlayMessage) Decode0(chunk *Chunk)\n```\n\n```go\nfunc (msg *ResponsePlayMessage) Decode3(chunk *Chunk)\n```\n\n```go\nfunc (msg *ResponsePlayMessage) Encode() []byte\n```\n\n```go\nfunc (msg *ResponsePlayMessage) GetStreamID() uint32\n```\n\n```go\ntype ResponsePublishMessage struct {\n\tCommandMessage\n\tProperties interface{} `json:\",omitempty\"`\n\tInfomation interface{} `json:\",omitempty\"`\n\tStreamID   uint32\n}\n```\nResponse Publish Message\n\n```go\nfunc (msg *ResponsePublishMessage) Encode() []byte\n```\n\n```go\nfunc (msg *ResponsePublishMessage) GetStreamID() uint32\n```\n\n```go\ntype ResponseSeekMessage struct {\n\tCommandMessage\n\tDescription string\n}\n```\nResponse Seek Message\n\n```go\nfunc (msg *ResponseSeekMessage) Encode0()\n```\n\n```go\ntype RtmpMessage interface {\n\tEncode() []byte\n}\n```\n\n```go\ntype SeekMessage struct {\n\tCommandMessage\n\tMilliseconds uint64\n}\n```\nSeek Message The client sends the seek command to seek the offset (in milliseconds) within a media file or playlist.\n\n```go\nfunc (msg *SeekMessage) Encode0()\n```\n\n```go\ntype SetBufferMessage struct {\n\tStreamIDMessage\n\tMillisecond uint32\n}\n```\nSetBuffer Length (=3) The client sends this event to inform the server of the buffer size (in milliseconds) that is used to buffer any data coming over a stream. This event is sent before the server starts | processing the stream. The first 4 bytes of the event data represent the stream ID and the next | 4 bytes represent the buffer length, in  milliseconds.\n\n```go\nfunc (msg *SetBufferMessage) Encode() []byte\n```\n\n```go\ntype SetPeerBandwidthMessage struct {\n\tAcknowledgementWindowsize uint32 // 4 bytes\n\tLimitType                 byte\n}\n```\nAcknowledgementWindowsize (4 bytes) LimitType : The Limit Type is one of the following values: 0 - Hard, 1 - Soft, 2- Dynamic.\n\n```go\nfunc (msg *SetPeerBandwidthMessage) Encode() (b []byte)\n```\n\n```go\ntype StreamIDMessage struct {\n\tUserControlMessage\n\tStreamID uint32\n}\n```\nStream Begin (=0) The server sends this event to notify the client that a stream has become functional and can be used for communication. By default, this event is sent on ID 0 after the application connect command is successfully received from the client. The event data is 4-byte and represents the stream ID of the stream that became functional.\n\n```go\nfunc (msg *StreamIDMessage) Encode() (b []byte)\n```\n\n```go\ntype Uint32Message uint32\n```\nchunk size (31 bits): This field holds the new maximum chunk size,in bytes, which will be used for all of the sender’s subsequent chunks until further notice\n\n```go\nfunc (msg Uint32Message) Encode() (b []byte)\n```\n\n```go\ntype UserControlMessage struct {\n\tEventType uint16\n\tEventData []byte\n}\n```\nEvent Type (16 bits) : The first 2 bytes of the message data are used to identify the Event type. Event type is followed by Event data. Event Data\n\n```go\nfunc (msg *UserControlMessage) Encode() []byte\n```\n\n","path":"github.com/Monibuca/plugin-rtmp","name":"rtmp","synopsis":"","isRedistributable":true}
