mirror of
https://github.com/Monibuca/plugin-rtmp.git
synced 2026-04-22 22:57:04 +08:00
fix: wite MessageStreamID in littleEndian
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package rtmp
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
||||
"m7s.live/engine/v4/util"
|
||||
)
|
||||
|
||||
@@ -70,7 +72,7 @@ func (h *ChunkHeader) WriteTo(t byte, b *util.Buffer) {
|
||||
b.WriteUint24(h.MessageLength)
|
||||
b.WriteByte(h.MessageTypeID)
|
||||
if t < RTMP_CHUNK_HEAD_8 {
|
||||
b.WriteUint32(h.MessageStreamID)
|
||||
binary.LittleEndian.PutUint32(b.Malloc(4), h.MessageStreamID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package rtmp
|
||||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"strings"
|
||||
@@ -92,6 +93,8 @@ func NewRTMPClient(addr string) (client *NetConnection, err error) {
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
default:
|
||||
fmt.Println(cmd.CommandName)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +200,7 @@ func (puller *RTMPPuller) Pull() (err error) {
|
||||
puller.StreamID = response.StreamId
|
||||
m := &PlayMessage{}
|
||||
m.StreamId = response.StreamId
|
||||
m.TransactionId = 1
|
||||
m.TransactionId = 4
|
||||
m.CommandMessage.CommandName = "play"
|
||||
URL, _ := url.Parse(puller.RemoteURL)
|
||||
ps := strings.Split(URL.Path, "/")
|
||||
|
||||
Reference in New Issue
Block a user