mirror of
https://github.com/pion/webrtc.git
synced 2025-10-15 19:50:42 +08:00

committed by
Michiel De Backker

parent
756d74196d
commit
7a527fadb3
@@ -15,7 +15,7 @@ pc.onsignalingstatechange = e => log(pc.signalingState)
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ window.startSession = () => {
|
||||
return alert('Session Description must not be empty')
|
||||
}
|
||||
|
||||
pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: atob(sd)})).catch(log)
|
||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd)))).catch(log)
|
||||
pc.createAnswer().then(d => pc.setLocalDescription(d)).catch(log)
|
||||
}
|
||||
|
Reference in New Issue
Block a user