Re: [webrtc-pc] Differences between pc.removeTrack(sender) and sender.replaceTrack(null)

replaceTrack is not supposed to cause negotiationNeeded. Changing the direction would require negotiationNeeded.
removeTrack is allowed to cause negotiationNeeded, so it can modify the direction.

I think the steps in removeTrack (http://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-removetrack) are supposed to be exactly equivalent to replaceTrack(null) + set direction and update the negotiation-needeed flag.

The "enuqueued steps" (step 6) in replaceTrack (http://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-replacetrack) reduce to "set sender's track attribute to null" when withTrack is null - but do have the "stop sending" be explicit. Perhaps this should be a common algorithm called by both removeTrack and replaceTrack?

(Another difference is that removeTrack is synchronous, while replaceTrack has two levels of "queue a task". Do we care?)

-- 
GitHub Notification of comment by alvestrand
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2024#issuecomment-440192226 using your GitHub account

Received on Tuesday, 20 November 2018 08:58:28 UTC