-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Description
Several methods of the ORTC objects return a promise, but it is not defined when they are resolved nor what value is it resolved to.
For example:
setTrack
Attempts to replace the track being sent with another track provided.
When the setTrack() method is invoked, the user agent must run the following steps:
1. Let p be a new promise.
2. Let withTrack be the argument to this method.
3. Run the following steps asynchronously:
1. If withTrack.kind differs from RTCRtpSender.track.kind or if withTrack has different peerIdentity constraints, then reject p with IncompatibleMediaStreamTrackError and abort these steps.
2. If withTrack.readyState is "ended" then reject p with IncompatibleMediaStreamTrackError and abort these steps.
3. 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.
It is assumed that the the promise will be resolved on async-3 step with an undefined
(?) value, but this should be explicitly said, as for example:
3. Run the following steps asynchronously:
1. If withTrack.kind differs from RTCRtpSender.track.kind or if withTrack has different peerIdentity constraints, then reject p with IncompatibleMediaStreamTrackError and abort these steps.
2. If withTrack.readyState is "ended" then reject p with IncompatibleMediaStreamTrackError and abort these steps.
3. 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.
4. Resolve p with withTrack value