question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

addTrack instead of deprecated addStream

See original GitHub issue

Expected 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:closed
  • Created 6 years ago
  • Reactions:19
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
saghulcommented, Jun 21, 2019

@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.

2reactions
ibccommented, Jun 21, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found