Skip to content

Commit 021c06c

Browse files
oasangqiSean-Der
authored andcommitted
Fix gstreamer-send
Block until ICE Gathering is complete. Otherwise the returned SDP will not have any ICE candidates.
1 parent d5f669a commit 021c06c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu
7373
* [Pascal Benoit](https://github.com/pascal-ace)
7474
* [Jin Gong](https://github.com/cgojin)
7575
* [harkirat singh](https://github.com/hkirat)
76+
* [oasangqi](https://github.com/oasangqi)
7677

7778
### License
7879
MIT License - see [LICENSE](LICENSE) for full text

gstreamer-send/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,17 @@ func main() {
8484
panic(err)
8585
}
8686

87+
// Create channel that is blocked until ICE Gathering is complete
88+
gatherComplete := webrtc.GatheringCompletePromise(peerConnection)
89+
8790
// Sets the LocalDescription, and starts our UDP listeners
8891
err = peerConnection.SetLocalDescription(answer)
8992
if err != nil {
9093
panic(err)
9194
}
9295

96+
<-gatherComplete
97+
9398
// Output the answer in base64 so we can paste it in browser
9499
fmt.Println(signal.Encode(*peerConnection.LocalDescription()))
95100

0 commit comments

Comments
 (0)