Re: [webrtc-pc] replaceTrack(null): Allowed?

Some preliminary thoughts: 

"Attempts to replace the track being sent with another track provided 
(or with a null track), without renegotiation.

To avoid track identifiers changing on the remote receiving end when a
 track is replaced, the sender must retain the original track 
identifier and stream associations and use these in subsequent 
negotiations.

When the replaceTrack method is invoked, the user agent must run the 
following steps:

Let sender be the RTCRtpSender object on which replaceTrack is 
invoked.
Let tranceiver be the RTCRtpTransceiver object associated with sender.
Let connection be the RTCPeerConnection object that created sender.

If transceiver.stopped is true, return a promise rejected with an 
InvalidStateError.

Let withTrack be the argument to this method.

If withTrack is non-null and withTrack.kind differs from the 
transceiver kind of transceiver, return a promise rejected with a 
TypeError.

If transceiver is not yet associated with a media description [JSEP] 
(section 3.4.1.), then set sender's track attribute to withTrack, and 
return a promise resolved with undefined.

Let p be a new promise.

Run the following steps in parallel:

Determine if negotiation is needed to replace the sender's existing 
track with withTrack. Negotiation is not needed if withTrack is null 
or if the sender's existing track is ended (which appears as though 
the track was muted). Ignore which MediaStream the track resides in 
and the id attribute of the track in this determination. If 
negotiation is needed, then reject p with InvalidModificationError and
 abort these steps.

If withTrack is null, have the sender stop sending, without 
negotiating.  Otherwise, have the sender switch seamlessly to 
transmitting withTrack instead of the sender's existing track, without
 negotiating.

Queue a task that sets sender's track attribute to withTrack, and 
resolves p with undefined.

Return p."

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

Received on Friday, 25 November 2016 21:09:42 UTC