mirror of
https://github.com/Monibuca/plugin-webrtc.git
synced 2025-10-05 23:06:55 +08:00
fix: 解析sdp时缺少了type
This commit is contained in:
4
main.go
4
main.go
@@ -95,7 +95,7 @@ func (conf *WebRTCConfig) Play_(w http.ResponseWriter, r *http.Request) {
|
|||||||
suber.Info(ice.ToJSON().Candidate)
|
suber.Info(ice.ToJSON().Candidate)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if err = suber.SetRemoteDescription(SessionDescription{SDP: suber.SDP}); err != nil {
|
if err = suber.SetRemoteDescription(SessionDescription{Type: SDPTypeOffer, SDP: suber.SDP}); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ func (conf *WebRTCConfig) Push_(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := puber.SetRemoteDescription(SessionDescription{SDP: puber.SDP}); err != nil {
|
if err := puber.SetRemoteDescription(SessionDescription{Type: SDPTypeOffer, SDP: puber.SDP}); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user