Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Inconsistent setting of receiver.track.readyState violates Mediacapture #1575
Three things wrong: First, the sole mention of track
"For every RTCRtpTransceiver transceiver in transceivers, run the following steps:
This means that while the following makes sense:
pc.close(); console.log(pc.getTransceivers().receiver.track.readyState); // ended
...the following makes no sense:
pc.stop(); console.log(pc.getTransceivers().receiver.track.readyState); // live pc.close(); console.log(pc.getTransceivers().receiver.track.readyState); // live
The second wrong thing is
The third wrong thing is not firing the
"When a MediaStreamTrack track ends for any reason other than the stop() method being invoked, the User Agent MUST queue a task that runs the following steps:
The stop() method referred to there is track.stop(), not any other stop().
Should we fire
The steps in
Which links to the steps for changing
So, I think all these issues would be fixed if the
@taylor-b Thanks for finding that!
We could also improve the language here to avoid passive language normative references IMHO.
It seems unusual for a method to normatively call out its callers. I'd say this whole paragraph belongs under set an RTCSessionDescription, not under stop().
I assume you mean the paragraph that says:
I agree. Both the
I'll work on a long-overdue PR here. I think firing
Sure, a workaround would be to always remember to do
pc.getTransceivers().forEach(tc => tc.stop()); pc.close();
...but that seems like an API bug.
The remaining issue in #1575 (comment) required a PR, so I added one.
With this merged, we'll have the following spec behavior (with a running loop as starting point):