addTrack instead of deprecated addStream
See original GitHub issueExpected behavior
As a webRTC user, I would like to use addTrack
(as addStream
is deprecated, see here: https://developer.mozilla.org/de/docs/Web/API/RTCPeerConnection/addStream
Observerd behavior
addStream
does not exist on peerConnection
.
Steps to reproduce the problem
// current working version
peerConnection.addStream(stream);
// expected
const audioTracks = stream.getAudioTracks();
peerConnection.addTrack(audioTracks[0], stream);
Issue Analytics
- State:
- Created 6 years ago
- Reactions:19
- Comments:11 (3 by maintainers)
Top Results From Across the Web
RTCPeerConnection.addStream() - Web APIs - MDN Web Docs
Instead of using this obsolete method, you should instead use addTrack() once for each track you wish to send to the remote peer....
Read more >The addStream and onaddstream methods in webRTC are ...
Specifically the methods addStream and onaddstream have been deprecated in favor of addTrack and ontrack respectively. Let me show you how to refactor...
Read more >Replacing .addStream() for video WebRTC - Stack Overflow
Mozilla decided to deprecate addStream without Chrome implementing the new alternative addTrack yet. addStream is still supported and I ...
Read more >addTrack()/removeTrack/getSenders() and friends shipping in ...
removeTrack(): Senders are not reusable as per-spec, instead they are removed from getSenders(), blocked on transceiver work. getLocalStreams(): This is legacy ...
Read more >RTCPeerConnection.addStream() - Web APIs
Instead of using this obsolete method, you should instead use addTrack() ... The exception is in Chrome, where addStream() does make the peer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ibc I’m sick and tired of your snide remarks regarding this. This is your last working or I’ll have to block you from this project.
Yes. Each side may need to use a different API to work. In the Safari side you can use modern WebRTC 1.0 API. In the react-native-webrtc side, go to 2013.