sdp交换存在问题
This commit is contained in:
@@ -77,13 +77,6 @@ func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDe
|
||||
|
||||
rtc.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
|
||||
logrus.Debug("connection state has changed: ", connectionState.String())
|
||||
|
||||
switch connectionState {
|
||||
case webrtc.ICEConnectionStateFailed:
|
||||
fallthrough
|
||||
case webrtc.ICEConnectionStateClosed:
|
||||
rtc.Close()
|
||||
}
|
||||
})
|
||||
|
||||
for _, track := range c.stream.GetTracks() {
|
||||
@@ -110,14 +103,12 @@ func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDe
|
||||
return nil, err
|
||||
}
|
||||
|
||||
gatherComplete := webrtc.GatheringCompletePromise(rtc)
|
||||
|
||||
if err := rtc.SetLocalDescription(answer); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
logrus.Debug("answer set")
|
||||
|
||||
<-gatherComplete
|
||||
<-webrtc.GatheringCompletePromise(rtc)
|
||||
|
||||
defer logrus.Debug("regist complete")
|
||||
return rtc.LocalDescription(), nil
|
||||
|
Reference in New Issue
Block a user