Examples: exchange entire RTCSessionDescription

Resolves #39
This commit is contained in:
backkem
2018-12-08 08:30:32 +01:00
committed by Michiel De Backker
parent 756d74196d
commit 7a527fadb3
21 changed files with 65 additions and 87 deletions

View File

@@ -52,13 +52,9 @@ func main() {
})
// Wait for the offer to be pasted
sd := util.Decode(util.MustReadStdin())
offer := util.Decode(util.MustReadStdin())
// Set the remote SessionDescription
offer := webrtc.RTCSessionDescription{
Type: webrtc.RTCSdpTypeOffer,
Sdp: string(sd),
}
err = peerConnection.SetRemoteDescription(offer)
util.Check(err)
@@ -67,7 +63,7 @@ func main() {
util.Check(err)
// Output the answer in base64 so we can paste it in browser
fmt.Println(util.Encode(answer.Sdp))
fmt.Println(util.Encode(answer))
// Block forever
select {}