[mediacapture-fromelement] When and how does a MediaStreamTrack end?

foolip has just created a new issue for 
https://github.com/w3c/mediacapture-fromelement:

== When and how does a MediaStreamTrack end? ==
The spec for 
[`captureStream()`](http://w3c.github.io/mediacapture-fromelement/#widl-HTMLMediaElement-captureStream-MediaStream)
 says "A captured `MediaStreamTrack` ends when playback ends (and the 
`ended` event fires) or when the track that it captures is no longer 
selected or enabled for playback. A track is no longer selected or 
enabled if the source is changed by setting the `src` or `srcObject` 
attributes of the media element."

This doesn't say what "ends" means, but presumably `readyState` is set
 to "ended"?

More importantly, the timing isn't clear. There are three different 
things that happens in the HTML spec:
 * The [ended playback](https://html.spec.whatwg.org/#ended-playback) 
definitions flips from false to true.

As part of "When the current playback position reaches the end of the 
media resource when the direction of playback is forwards":
 * The `ended` IDL attribute starts returning true once the event loop
 returns to step 1.
 * The `ended` event is fired, as part of a task that is queued in 
this algorithm.

Note especially that the event isn't fired if the direction of 
playback is backwards, and the timing of the steps are different.

The intended behavior needs to be specified in enough detail to write 
tests based only on what the spec says.

Please view or discuss this issue at 
https://github.com/w3c/mediacapture-fromelement/issues/23 using your 
GitHub account

Received on Monday, 18 January 2016 10:45:46 UTC