[Webkit-unassigned] [Bug 174327] Adding, removing, and then adding back same MediaStreamTrack throws InvalidAccessError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 1 09:11:31 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=174327

--- Comment #4 from Ben <ben.browitt at gmail.com> ---
If you add a track with let sender = pc.addTrack(track, stream) and remove it with pc.removeTrack(sender) you can't add a track of the same kind again. The sender has the new track and the transceiver direction is sendrecv but the sdp doesn't have the track (no ssrc lines).

To reproduce:
const stream = await navigator.mediaDevices.getUserMedia({ video: true })
const [track] = stream.getTracks()
let sender = pc.addTrack(track, stream);
// negotiate
pc.removeTrack(sender);
// you can also try sender.replaceTrack(null) and track.stop() but it doesn't help.
// negotiate
const stream2 = await navigator.mediaDevices.getUserMedia({ video: true })
const [track2] = stream2.getTracks()
let sender2 = pc.addTrack(track2, stream2);
let offer = await this.pc.createOffer();
console.log(offer.sdp);
// direction of the video section in the sdp is inactive and there are no ssrc lines.

Youenn, is there a workaround?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190501/ce6b4da0/attachment.html>


More information about the webkit-unassigned mailing list