mirror of
https://github.com/pion/webrtc.git
synced 2025-10-17 04:31:00 +08:00
Remove addStream from Javascript
Not supported in Safari
This commit is contained in:
@@ -11,7 +11,7 @@ go get github.com/pion/webrtc/v3/examples/broadcast
|
||||
```
|
||||
|
||||
### Open broadcast example page
|
||||
[jsfiddle.net](https://jsfiddle.net/d2mt13y6/) You should see two buttons 'Publish a Broadcast' and 'Join a Broadcast'
|
||||
[jsfiddle.net](https://jsfiddle.net/1jc4go7v/) You should see two buttons 'Publish a Broadcast' and 'Join a Broadcast'
|
||||
|
||||
### Run Broadcast
|
||||
#### Linux/macOS
|
||||
|
@@ -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