MediaStream ended vs inactive

We had a discussion on this a while back, but never reached a conclusion.  Currently a MediaStream moves to the 'ended' state when all its Tracks end and/or are removed.  However an ended MediaStream can move back to the active state if new Tracks are added to it.  'Ended' as a word has a rather final ring to it, so it would be better to change the name to 'inactive'.  Thus a MediaStream starts off in the inactive state (if it is created without any Tracks), moves to active when Tracks are added, back to inactive when the Tracks end or are removed, and then back to active if more are added, etc.  The MediaStream could fire events (perhaps 'active' and 'inactive') to signal these transitions.

Concretely, we would get rid of the 'ended' attribute and the 'onended' event handler, add a state attribute (with values active and inactive) and two event handlers onactive and oninactive.  (Alternatively, instead of a state attribute, we could have a Boolean 'active' attribute, as long as we're confident that we'll never want a third state...)

Any comments?


-          Jim

Received on Tuesday, 11 June 2013 17:04:23 UTC