[Bug 21618] MediaStreams with no tracks need to not be Ended

https://www.w3.org/Bugs/Public/show_bug.cgi?id=21618

Martin Thomson <martin.thomson@skype.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.thomson@skype.net

--- Comment #2 from Martin Thomson <martin.thomson@skype.net> ---
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Received on Wednesday, 21 August 2013 15:59:12 UTC