mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +08:00

committed by
Michiel De Backker

parent
756d74196d
commit
7a527fadb3
@@ -18,7 +18,7 @@ navigator.mediaDevices.getUserMedia({video: true, audio: true})
|
||||
pc.oniceconnectionstatechange = e => log(pc.iceConnectionState)
|
||||
pc.onicecandidate = event => {
|
||||
if (event.candidate === null) {
|
||||
document.getElementById('localSessionDescription').value = btoa(pc.localDescription.sdp)
|
||||
document.getElementById('localSessionDescription').value = btoa(JSON.stringify(pc.localDescription))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ window.startSession = () => {
|
||||
}
|
||||
|
||||
try {
|
||||
pc.setRemoteDescription(new RTCSessionDescription({type: 'answer', sdp: atob(sd)}))
|
||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
||||
} catch (e) {
|
||||
alert(e)
|
||||
}
|
||||
|
Reference in New Issue
Block a user