<?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>18591</bug_id>
          
          <creation_ts>2012-08-16 14:02:03 +0000</creation_ts>
          <short_desc>addsourcebuffer and removesourcebuffer events appear unhelpful</short_desc>
          <delta_ts>2012-08-23 08:37:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Media Source Extensions</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>VERIFIED</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Jägenstedt">philipj</reporter>
          <assigned_to name="Aaron Colwell (c)">acolwell</assigned_to>
          <cc>acolwell</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-media</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72281</commentid>
    <comment_count>0</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-08-16 14:02:03 +0000</bug_when>
    <thetext>http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebufferlist-events

The addsourcebuffer and removesourcebuffer events are fired when:

* addSourceBuffer: &quot;Add the new object to sourceBuffers and fire a addsourcebuffer on that object.&quot; (Ambiguous which the target object is, but presumably sourceBuffers.)

* removeSourceBuffer: &quot;If sourceBuffer is in activeSourceBuffers, then remove it from that list and fire a removesourcebuffer event on that object.&quot; and &quot;Remove sourceBuffer from sourceBuffers and fire a removesourcebuffer event on that object.&quot;

* Detaching from a media element: &quot;Remove all the SourceBuffer objects from sourceBuffers and fire a removesourcebuffer event for each one.&quot;

What is the use case for these events? Since the application is the only source of added or removed buffers, telling the application about it appears very strange.

It looks like this API may have taken inspiration from HTML&apos;s TextTrackList, but the reason there are addtrack and removetrack events in that context is that the application needs to be notified about in-band tracks, i.e. an external source of events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72377</commentid>
    <comment_count>1</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2012-08-17 21:12:55 +0000</bug_when>
    <thetext>You are right, these events were inspired by TextTrackList. The primary reason I added them was for monitoring activeSourceBuffers. This list gets modified by the UA when tracks enabled/selected state changes. A web application might want to monitor changes to this list so it can stop fetching media for inactive SourceBuffers.

I agree the targets need to be fixed and I&apos;ll fix that in response the the broader event targets bug you filed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72421</commentid>
    <comment_count>2</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-08-20 08:49:52 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; You are right, these events were inspired by TextTrackList. The primary reason
&gt; I added them was for monitoring activeSourceBuffers. This list gets modified by
&gt; the UA when tracks enabled/selected state changes. A web application might want
&gt; to monitor changes to this list so it can stop fetching media for inactive
&gt; SourceBuffers.

Oh right, I overlooked that.

&gt; I agree the targets need to be fixed and I&apos;ll fix that in response the the
&gt; broader event targets bug you filed.

Great!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72565</commentid>
    <comment_count>3</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2012-08-22 23:40:46 +0000</bug_when>
    <thetext>I decided to updated these specific event targets before tackling all the rest.
http://dvcs.w3.org/hg/html-media/rev/340786fcae83</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>