mirror of
https://github.com/Monibuca/plugin-webtransport.git
synced 2025-12-24 11:51:00 +08:00
跟随引擎4.3.0版本
This commit is contained in:
2
main.go
2
main.go
@@ -40,7 +40,7 @@ func (c *WebTransportConfig) OnEvent(event any) {
|
||||
sub := &WebTransportSubscriber{}
|
||||
sub.SetIO(s)
|
||||
sub.ID = strconv.FormatInt(int64(s.StreamID()), 10)
|
||||
plugin.SubscribeBlock(streamPath, sub)
|
||||
plugin.SubscribeBlock(streamPath, sub, SUBTYPE_FLV)
|
||||
})
|
||||
mux.HandleFunc("/push/", func(w http.ResponseWriter, r *http.Request) {
|
||||
streamPath := r.URL.Path[len("/push/"):]
|
||||
|
||||
@@ -13,9 +13,8 @@ func (wt *WebTransportSubscriber) OnEvent(event any) {
|
||||
switch v := event.(type) {
|
||||
case ISubscriber:
|
||||
wt.Write(codec.FLVHeader)
|
||||
case HaveFLV:
|
||||
flvTag := v.GetFLV()
|
||||
if _, err := flvTag.WriteTo(wt); err != nil {
|
||||
case FLVFrame:
|
||||
if _, err := v.WriteTo(wt); err != nil {
|
||||
wt.Stop()
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user