<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21618</bug_id>
          
          <creation_ts>2013-04-08 12:19:37 +0000</creation_ts>
          <short_desc>MediaStreams with no tracks need to not be Ended</short_desc>
          <delta_ts>2013-10-17 11:32:03 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>Media Capture and Streams</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>22215</blocked>
    
    <blocked>22264</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Harald Alvestrand">harald</reporter>
          <assigned_to name="public-media-capture@w3.org">public-media-capture</assigned_to>
          <cc>adam.bergkvist</cc>
    
    <cc>martin.thomson</cc>
    
    <cc>public-media-capture</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85705</commentid>
    <comment_count>0</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2013-04-08 12:19:37 +0000</bug_when>
    <thetext>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&apos;t add tracks to a MediaStream that&apos;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 &quot;un-end&quot; a MediaStream by removing all its tracks.

A decision is sought.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92407</commentid>
    <comment_count>1</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2013-08-21 11:12:17 +0000</bug_when>
    <thetext>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&apos;t add an attribute for it), and that a media element enters the ended state when the MediaStream is inactive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92427</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Thomson">martin.thomson</who>
    <bug_when>2013-08-21 15:59:11 +0000</bug_when>
    <thetext>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, &apos;ended&apos;, {
  get: function() {
    return this.tracks.reduce(function(a, track) {
      return a &amp;&amp; track.ended;
    }, true);
  }, 
  enumerable: true,
  configurable: true
});

A consequence of this algorithm is that a MediaStream with no tracks is always ended.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92451</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2013-08-22 05:57:01 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; A consequence of this algorithm is that a MediaStream with no tracks is
&gt; always ended.

That&apos;s why I like the &quot;inactive&quot; wording better. If you create a MediaStream with no tracks, &quot;inactive&quot; just says that nothing is going on at the moment. &quot;ended&quot;, on the other hand, gives me the feeling that there has been some activity in the stream prior to this state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92460</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Thomson">martin.thomson</who>
    <bug_when>2013-08-22 15:08:27 +0000</bug_when>
    <thetext>(In reply to comment #3)

&gt; That&apos;s why I like the &quot;inactive&quot; wording better. 

&quot;inactive&quot; is good.  Might cause some heartburn due to asymmetry, but you are right, it&apos;s has all the right implications.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93946</commentid>
    <comment_count>5</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2013-09-27 12:19:20 +0000</bug_when>
    <thetext>This was on the agenda for our Aug 27, 2013 telechat.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94223</commentid>
    <comment_count>6</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2013-10-03 09:54:03 +0000</bug_when>
    <thetext>The new concept of an inactive MediaStream will be included in the next editor&apos;s draft.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94888</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2013-10-17 11:32:03 +0000</bug_when>
    <thetext>Fixed in Editor&apos;s draft v20131017</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>