RTCPeerConnection.addTrack failing if the remote end is not Chrome.
Reported by
wanggen...@gmail.com,
Jan 18 2018
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3323.0 Safari/537.36 Steps to reproduce the problem: 1. in a connected connection with non-chrome (e.g. Firefox) 2. remove all streams and tracks. 2. get a brand new stream (e.g. screen from chrome extension api) 3. for each the track in the stream add it into the pc (while it works if add the stream with addStream into the pc) What is the expected behavior? track should be added successfully. (our code works for Firefox) What went wrong? addTrack of RTCPeerConnection was not supported before v65. so we call addStream. Now it starts supporting in v65, we loves it, but it doesn't work properly and throws: Uncaught DOMException: Failed to execute 'addTrack' on 'RTCPeerConnection': A sender already exists for the track. Did this work before? No Does this work in other browsers? Yes Chrome version: 65.0.3323.0 Channel: n/a OS Version: OS X 10.13.2 Flash Version: It never worked because chrome didn't support addTrack in RTCPeerConnection.
,
Jan 19 2018
hbos@, please take a look
,
Jan 22 2018
Thanks wanggen, questions: 1. Are you using addTrack and removeTrack to add and remove tracks, there's no mix between track-based and stream-based APIs (addStream, removeStream)? 2. The "new stream", is this really a stream that contains new tracks? That exception is only expected if there is a sender which already has the track. - removeTrack() will remove the sender (or when we support unified plan, inactivate the sender and set its track to null) - this should be enough to not get that exception. - addTrack() with a different track should also be enough to to not get this exception. If the track has not been seen before by the PC, there can't possibly be any sender that has that track. Can you please verify the above or try a simplified scenario. Based on the information given I suspect a bug in your application, not in Chrome. But I could be mistaken.
,
Jan 22 2018
For debugging, you can use getSenders() and look at the returned senders track attribute and compare that to the tracks that you are trying to add. |
|||
►
Sign in to add a comment |
|||
Comment 1 by krajshree@chromium.org
, Jan 19 2018