Remove addStream from Javascript

Not supported in Safari
This commit is contained in:
Sean DuBois
2020-11-19 21:23:57 -08:00
parent 74e790aa11
commit d0b119af2a
2 changed files with 3 additions and 2 deletions

View File

@@ -21,7 +21,8 @@ window.createSession = isPublisher => {
if (isPublisher) {
navigator.mediaDevices.getUserMedia({ video: true, audio: false })
.then(stream => {
pc.addStream(document.getElementById('video1').srcObject = stream)
stream.getTracks().forEach(track => pc.addTrack(track, stream));
document.getElementById('video1').srcObject = stream
pc.createOffer()
.then(d => pc.setLocalDescription(d))
.catch(log)