Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Success & Failure Callbacks in RTCRtpSender.setTrack #148
Mozilla proposal for RTCRtpSender.replaceTrack method:
Difference from RTCRtpSender.setTrack is use of a success and failure callback.
Reply from Martin Thomson:
pushed a commit
Oct 14, 2014
Here is the proposed replacement text in Section 6.3.2:
When the setTrack() method is invoked, the user agent must run the following steps:
Let p be a new promise.
Let withTrack be the argument to this method.
Run the following steps asynchronously:
If withTrack.kind differs from RTCRtpSender.track.kind or if withTrack has different peerIdentity constraints, then reject p with IncompatibleMediaStreamTrackError and abort these steps.
Set the RTCRtpSender.track attribute to withTrack, and have the sender seamlessly switch to transmitting withTrack in place of what it is sending. On the remote receiving end, the track maintains its existing grouping and id until the connection ends.