This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
According to the current specs: a) it is possible to create a MediaStream that has no tracks. b) if all the tracks in a MediaStream are ended, the state of the MediaStream is ended c) You can't add tracks to a MediaStream that's ended. b) is ambiguous for the case where there are no tracks: Is it ended or not? If it is ended, creating a MediaStream with no tracks becomes useless, and removing all tracks from a MediaStream will end it - rendering it useless. If it is not ended, the MediaStream is useful - but it also becomes possible to "un-end" a MediaStream by removing all its tracks. A decision is sought.
Suggestion from Jim Barnett: I think that if a MediaStream can become active again, that it shouldn’t have any (immediate) affect on a media element. As far as I can figure out the HTML5 spec, once a media element goes to ended, the only way it can leave ended is for someone to call play() (or rewind or something). So when a MediaStream goes to inactive, the media element should also go to ended and stay there even if the MediaStream becomes active again. If someone calls play(), the media element will pick up the new tracks in the MediaStream, but not before. Based on this, suggestion from Harald: Suggested spec change: Remove the ended state on MediaStream. Define that a MediaStream is inactive when it contains only MediaStreamTracks that are ended (but don't add an attribute for it), and that a media element enters the ended state when the MediaStream is inactive.
Seems like a reasonable suggestion. The alternative is to define the ended property as a direct synthesis of the current states of all MediaStreamTrack instances. e.g., Object.defineProperty(MediaStream.prototype, 'ended', { get: function() { return this.tracks.reduce(function(a, track) { return a && track.ended; }, true); }, enumerable: true, configurable: true }); A consequence of this algorithm is that a MediaStream with no tracks is always ended.
(In reply to comment #2) > A consequence of this algorithm is that a MediaStream with no tracks is > always ended. That's why I like the "inactive" wording better. If you create a MediaStream with no tracks, "inactive" just says that nothing is going on at the moment. "ended", on the other hand, gives me the feeling that there has been some activity in the stream prior to this state.
(In reply to comment #3) > That's why I like the "inactive" wording better. "inactive" is good. Might cause some heartburn due to asymmetry, but you are right, it's has all the right implications.
This was on the agenda for our Aug 27, 2013 telechat.
The new concept of an inactive MediaStream will be included in the next editor's draft.
Fixed in Editor's draft v20131017