mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +08:00
Rewrite examples to avoid onnegotiationneeded
onnegotiationneeded is broken in libwebrtc M73, so just rewrite all examples to only set the offer once Resolves #545
This commit is contained in:
@@ -12,8 +12,10 @@ var log = msg => {
|
||||
}
|
||||
|
||||
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
|
||||
.then(stream => pc.addStream(document.getElementById('video1').srcObject = stream))
|
||||
.catch(log)
|
||||
.then(stream => {
|
||||
pc.addStream(document.getElementById('video1').srcObject = stream)
|
||||
pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log)
|
||||
}).catch(log)
|
||||
|
||||
pc.oniceconnectionstatechange = e => log(pc.iceConnectionState)
|
||||
pc.onicecandidate = event => {
|
||||
@@ -22,9 +24,6 @@ pc.onicecandidate = event => {
|
||||
}
|
||||
}
|
||||
|
||||
pc.onnegotiationneeded = e =>
|
||||
pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log)
|
||||
|
||||
window.startSession = () => {
|
||||
let sd = document.getElementById('remoteSessionDescription').value
|
||||
if (sd === '') {
|
||||
|
Reference in New Issue
Block a user