fix unsupported trickle ice

This commit is contained in:
guochao 2023-08-24 09:34:37 +08:00
parent ece891f829
commit 91e7055bf6
Signed by: guochao
GPG Key ID: 79F7306D2AA32FC3

View File

@ -286,8 +286,11 @@ func (client *SignalClient) OnDiscoverResponse(ctx context.Context, stream proto
}
peerConnection.SetLocalDescription(sdp)
gatherComplete := webrtc.GatheringCompletePromise(peerConnection)
<-gatherComplete
buffer := &bytes.Buffer{}
if err := json.NewEncoder(buffer).Encode(sdp); err != nil {
if err := json.NewEncoder(buffer).Encode(peerConnection.LocalDescription()); err != nil {
client.Program.Send(systemMsg(fmt.Sprint("Failed to encode offer for peer "+sender+": ", err)))
peerConnection.Close()
return