mirror of
https://github.com/pion/webrtc.git
synced 2025-10-16 12:10:44 +08:00
Remove addStream from Javascript
Not supported in Safari
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user