W3C home > Mailing lists > Public > public-webrtc@w3.org > December 2017

[webrtc-pc] replaceTrack and removeTrack

From: henbos via GitHub <sysbot+gh@w3.org>
Date: Fri, 01 Dec 2017 15:20:58 +0000
To: public-webrtc@w3.org
Message-ID: <issues.opened-278498756-1512141656-sysbot+gh@w3.org>
henbos has just created a new issue for https://github.com/w3c/webrtc-pc:

== replaceTrack and removeTrack ==
Paraphrasing the spec ignoring some details... replaceTrack is asynchronous:
- In parallel, check that track has not ended and queue a task to set the track if the pc is not closed and resolve the promise.

The track could be muted before the queued task is executed, this could be a problem, but ignoring that for now.
removeTrack is synchronous:
- Set the sender's track to null, etc.

What is the expected behavior of this?
```
sender = pc.addTrack(t1);
sender.replaceTrack(t2);
pc.removeTrack(sender);
```
I imagine this will result in the following steps:
```
sender = sender with track = t1;  // pc.addTrack
sender.track = null;  // pc.removeTrack
sender.track = t2;  // replaceTrack
```
The removeTrack still changes the direction of the transceiver, so I suspect the renegotiation will cause the remote track to be removed regardless of the order of things, but there might be races with what sender.track is when renegotiating?

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1677 using your GitHub account
Received on Friday, 1 December 2017 15:21:00 UTC

This archive was generated by hypermail 2.3.1 : Friday, 1 December 2017 15:21:00 UTC