peer connection SetLocalDescription error catch.

This commit is contained in:
Miroslav Šedivý 2020-10-28 20:56:14 +01:00
parent 2f0b159ad6
commit 4093bc5311

View File

@ -142,7 +142,10 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
}) })
}) })
connection.SetLocalDescription(description) if err := connection.SetLocalDescription(description); err != nil {
return "", manager.config.ICELite, manager.config.ICEServers, err
}
connection.OnConnectionStateChange(func(state webrtc.PeerConnectionState) { connection.OnConnectionStateChange(func(state webrtc.PeerConnectionState) {
switch state { switch state {
case webrtc.PeerConnectionStateDisconnected: case webrtc.PeerConnectionStateDisconnected: