From 099fb8e203461f6198632dc11996cfa4ee36ff68 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 14 Oct 2020 18:37:51 +0200 Subject: [PATCH] Disable Trickle ICE --- stream/webrtc/webrtc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stream/webrtc/webrtc.go b/stream/webrtc/webrtc.go index a181a08..87833d3 100644 --- a/stream/webrtc/webrtc.go +++ b/stream/webrtc/webrtc.go @@ -154,12 +154,16 @@ func newPeerHandler(localSdpChan chan webrtc.SessionDescription, remoteSdp struc return } - // Sets the LocalDescription, and starts our UDP listeners + // Sets the LocalDescription + // Using GatheringCompletePromise disable trickle ICE + // FIXME: https://github.com/pion/webrtc/wiki/Release-WebRTC@v3.0.0 + gatherComplete := webrtc.GatheringCompletePromise(peerConnection) if err = peerConnection.SetLocalDescription(answer); err != nil { log.Println("Failed to set local description", err) localSdpChan <- webrtc.SessionDescription{} return } + <-gatherComplete // Send answer to client localSdpChan <- answer