Address multiple bugs:
authorAaron Colwell <acolwell@chromium.org>
Tue, 29 Jan 2013 15:44:22 -0800
changeset 82aae26333e7d1
parent 81 960dda06d899
child 83 b35722b0cd8f
Address multiple bugs:

Bug 20758 - Remove early abort step on 0-byte appends so the same events fire as a normal append with bytes.
Bug 18592 - Added definition for 'enough data to ensure uninterrupted playback'
Bug 18615 - Updated buffered ranges algorithm to properly compute the ranges for Philip's example.
media-source/media-source-respec.html
media-source/media-source.html
media-source/media-source.js
     1.1 --- a/media-source/media-source-respec.html	Tue Jan 22 08:25:33 2013 -0800
     1.2 +++ b/media-source/media-source-respec.html	Tue Jan 29 15:44:22 2013 -0800
     1.3 @@ -14,7 +14,7 @@
     1.4        shortName: "media-source",
     1.5  
     1.6        // if there a publicly available Editor's Draft, this is the link
     1.7 -      edDraftURI:           "http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html",
     1.8 +      edDraftURI:           "http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html",
     1.9  
    1.10        // if this is a LCWD, uncomment and set the end of its review period
    1.11        // lcEnd: "2009-08-05",
    1.12 @@ -497,9 +497,22 @@
    1.13  
    1.14          <section id="buffer-monitoring">
    1.15            <h4>SourceBuffer Monitoring</h4>
    1.16 -          <p>The following steps are periodically run during playback to make sure that all of the <a>SourceBuffer</a> objects in <a def-id="activeSourceBuffers"></a> have enough data to ensure uninterrupted playback. Appending new segments and changes to <a def-id="activeSourceBuffers"></a> also cause these steps to run because they affect the conditions that trigger state transitions.</p>
    1.17 -          <p class="note">The web application can monitor changes in <a def-id="ready-state"></a> to drive <a def-id="media-segment"></a> appending.</p>
    1.18 -          <p class="issue"><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18592">Bug 18592</a> - How much is "enough data to ensure uninterrupted playback"</p>
    1.19 +          <p>The following steps are periodically run during playback to make sure that all of the <a>SourceBuffer</a> objects in <a def-id="activeSourceBuffers"></a> have <a def-id="enough-data"></a>. Appending new segments and changes to <a def-id="activeSourceBuffers"></a> also cause these steps to run because they affect the conditions that trigger state transitions.</p>
    1.20 +
    1.21 +          <p>Having <dfn id="enough-data">enough data to ensure uninterrupted playback</dfn> is an implementation specific condition where the user agent
    1.22 +          determines that it currently has enough data to play the presentation without stalling for a meaningful period of time. This condition is
    1.23 +          constantly evaluated to determine when to transition the media element into and out of the <a def-id="have-enough-data"></a> ready state.
    1.24 +          These transitions indicate when the user agent believes it has enough data buffered or it needs more data respectively.</p>
    1.25 +
    1.26 +          <p class="note">An implementation may choose to use bytes buffered, time buffered, the append rate, or any other metric it sees fit to
    1.27 +            determine when it has enough data. The metrics used may change during playback so web applications should only rely on the value of
    1.28 +            <a def-id="ready-state"></a> to determine whether more data is needed or not.</p>
    1.29 +
    1.30 +          <p class="note">When the media element needs more data, it should transition from <a def-id="have-enough-data"></a> to
    1.31 +            <a def-id="have-future-data"></a> early enough for a web application to be able to respond without causing an interruption in playback.
    1.32 +            For example, transitioning when the current playback position is 500ms before the end of the buffered data gives the application roughly
    1.33 +            500ms to append more data before playback stalls.</p>
    1.34 +
    1.35            <dl class="switch">
    1.36              <dt>If <a def-id="buffered"></a> for all objects in <a def-id="activeSourceBuffers"></a> do not contain <a def-id="timeranges"></a> for the current playback position:</dt>
    1.37              <dd>
    1.38 @@ -509,7 +522,7 @@
    1.39  	        <li>Abort these steps.</li>
    1.40  	      </ol>
    1.41              </dd>
    1.42 -            <dt>If <a def-id="buffered"></a> for all objects in <a def-id="activeSourceBuffers"></a> contain <a def-id="timeranges"></a> that include the current playback position and enough data to ensure uninterrupted playback:</dt>
    1.43 +            <dt>If <a def-id="buffered"></a> for all objects in <a def-id="activeSourceBuffers"></a> contain <a def-id="timeranges"></a> that include the current playback position and <a def-id="enough-data"></a>:</dt>
    1.44              <dd>
    1.45  	      <ol>
    1.46  	        <li>Set the <a def-id="ready-state"></a> attribute to <a def-id="have-enough-data"></a>.</li>
    1.47 @@ -519,7 +532,7 @@
    1.48  	        <li>Abort these steps.</li>
    1.49  	      </ol>
    1.50              </dd>
    1.51 -            <dt>If <a def-id="buffered"></a> for at least one object in <a def-id="activeSourceBuffers"></a> contains a <a def-id="timerange"></a> that includes the current playback position but not enough data to ensure uninterrupted playback:</dt>
    1.52 +            <dt>If <a def-id="buffered"></a> for at least one object in <a def-id="activeSourceBuffers"></a> contains a <a def-id="timerange"></a> that includes the current playback position but not <a def-id="enough-data"></a>:</dt>
    1.53              <dd>
    1.54  	      <ol>
    1.55  	        <li>Set the <a def-id="ready-state"></a> attribute to <a def-id="have-future-data"></a>.</li>
    1.56 @@ -695,7 +708,6 @@
    1.57                    <a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="sourceopen"></a> at the <a def-id="parent-media-source"></a> .</li>
    1.58                </ol>
    1.59              </li>
    1.60 -            <li>If <var>data</var>.byteLength is 0, then abort these steps.</li>
    1.61              <li>
    1.62                <p>If the <a def-id="buffer-full-flag"></a> equals true, then throw a <a def-id="quota-exceeded-err"></a> exception and abort these step.</p>
    1.63                <p class="note">The web application must use <a def-id="remove"></a> to free up space in the <a>SourceBuffer</a>.</p>
    1.64 @@ -727,7 +739,6 @@
    1.65  	        <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="sourceopen"></a> at the <a def-id="parent-media-source"></a> .</li>
    1.66                </ol>
    1.67              </li>
    1.68 -            <li>If <var>maxSize</var> equals 0, then abort these steps.</li>
    1.69              <li>
    1.70                <p>If the <a def-id="buffer-full-flag"></a> equals true, then throw a <a def-id="quota-exceeded-err"></a> exception and abort these step.</p>
    1.71                <p class="note">The web application must use <a def-id="remove"></a> to free up space in the <a>SourceBuffer</a>.</p>
    1.72 @@ -1135,7 +1146,7 @@
    1.73  	      </ol>
    1.74              </li>
    1.75              <li>
    1.76 -	      <p>If the <a def-id="ready-state"></a> attribute is <a def-id="have-future-data"></a> and the new <a def-id="coded-frames"></a> cause all objects in <a def-id="activeSourceBuffers"></a> to have enough data to start playback, then run the following steps:</p>
    1.77 +	      <p>If the <a def-id="ready-state"></a> attribute is <a def-id="have-future-data"></a> and the new <a def-id="coded-frames"></a> cause all objects in <a def-id="activeSourceBuffers"></a> to have <a def-id="enough-data"></a>, then run the following steps:</p>
    1.78  	      <ol>
    1.79  	        <li>Set the <a def-id="ready-state"></a> attribute to <a def-id="have-enough-data"></a>.</li>
    1.80  	        <li>
    1.81 @@ -1230,20 +1241,23 @@
    1.82  
    1.83        <p id="dom-htmlmediaelement.buffered">The <a def-id="hme-buffered"></a> attribute returns a new static <a def-id="normalized-timeranges-object"></a> created based on the following steps:</p>
    1.84        <ol>
    1.85 +        <li>If <a def-id="activeSourceBuffers"></a>.length equals 0 then return an empty <a def-id="timeranges"></a> object and abort these steps.</li>
    1.86          <li>Let <var>active ranges</var> be the ranges returned by <a def-id="buffered"></a> for each <a>SourceBuffer</a> object in <a def-id="activeSourceBuffers"></a>.</li>
    1.87 -        <li>Let <var>intersection range</var> be the intersection of the <var>active ranges</var>.</li>
    1.88 -        <li>
    1.89 -          <p>If <a def-id="readyState"></a> is <a def-id="ended"></a>, then run the following steps:</p>
    1.90 +        <li>Let <var>highest end time</var> be the largest range end time in the <var>active ranges</var>.</li>
    1.91 +        <li>Let <var>intersection ranges</var> equal a <a def-id="timerange"></a> object containing a single range from 0 to <var>highest end time</var>.</li>
    1.92 +        <li>For each <a>SourceBuffer</a> object in <a def-id="activeSourceBuffers"></a> run the following steps:
    1.93            <ol>
    1.94 -	    <li>Let <var>highest end time</var> be the largest end time in the <var>active ranges</var>.</li>
    1.95 -	    <li>Let <var>highest intersection end time</var> be the highest end time in the <var>intersection range</var>.</li>
    1.96 -	    <li>If the <var>highest intersection end time</var> is less than the <var>highest end time</var>, then update the <var>intersection range</var> so that the <var>highest intersection end time</var> equals the <var>highest end time</var>.</li>
    1.97 -	  </ol>
    1.98 -        <p class="issue"><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18615">Bug 18615</a> - Define how SourceBuffer.buffered maps to HTMLMediaElement.buffered</p>
    1.99 -        <p class="issue"><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18400">Bug 18400</a> - Define and document timestamp heuristics</p>
   1.100 +            <li>Let <var>source ranges</var> equal the ranges returned by the <a def-id="buffered"></a> attribute on the current <a>SourceBuffer</a>.</li>
   1.101 +            <li>If <a def-id="readyState"></a> is <a def-id="ended"></a>, then set the end time on the last range in <var>source ranges</var> to 
   1.102 +              <var>highest end time</var>.</li>
   1.103 +            <li>Let <var>new intersection ranges</var> equal the the intersection between the <var>intersection ranges</var> and the <var>source ranges</var>.</li>
   1.104 +            <li>Replace the ranges in <var>intersection ranges</var> with the <var>new intersection ranges</var>.</li>
   1.105 +          </ol>
   1.106          </li>
   1.107 -        <li>Return the <var>intersection range</var>.</li>
   1.108 +        <li>Return the <var>intersection ranges</var>.</li>
   1.109        </ol>
   1.110 +      <p class="issue"><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18615">Bug 18615</a> - Define how SourceBuffer.buffered maps to HTMLMediaElement.buffered</p>
   1.111 +      <p class="issue"><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18400">Bug 18400</a> - Define and document timestamp heuristics</p>
   1.112      </section>
   1.113  
   1.114      <section id="audio-track-extensions">
   1.115 @@ -1695,7 +1709,17 @@
   1.116          </thead>
   1.117          <tbody>
   1.118            <tr>
   1.119 -	    <td>15 January 2013</td>
   1.120 +	    <td>30 January 2013</td>
   1.121 +            <td>
   1.122 +              <ul>
   1.123 +                <li>Remove early abort step on 0-byte appends so the same events fire as a normal append with bytes.</li>
   1.124 +                <li>Added definition for 'enough data to ensure uninterrupted playback'.</li>
   1.125 +                <li>Updated buffered ranges algorithm to properly compute the ranges for Philip's example.</li>
   1.126 +              </ul>
   1.127 +            </td>
   1.128 +          </tr>
   1.129 +          <tr>
   1.130 +	    <td><a href="http://dvcs.w3.org/hg/html-media/raw-file/fd2a58eec443/media-source/media-source.html">15 January 2013</a></td>
   1.131              <td>Replace setTrackInfo() and getSourceBuffer() with AudioTrack, VideoTrack, and TextTrack extensions.</td>
   1.132            </tr>
   1.133            <tr>
     2.1 --- a/media-source/media-source.html	Tue Jan 22 08:25:33 2013 -0800
     2.2 +++ b/media-source/media-source.html	Tue Jan 29 15:44:22 2013 -0800
     2.3 @@ -1,4 +1,4 @@
     2.4 -<!DOCTYPE html>
     2.5 +<!DOCTYPE html>
     2.6  <html lang="en" dir="ltr">
     2.7  <head>
     2.8      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     2.9 @@ -388,26 +388,26 @@
    2.10      border-collapse:    collapse;
    2.11      width:  100%;
    2.12  }
    2.13 -</style><link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='http://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
    2.14 +</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='http://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
    2.15    <body><div class="head">
    2.16    <p>
    2.17      
    2.18 -      <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
    2.19 +      <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a>
    2.20      
    2.21    </p>
    2.22    <h1 class="title" id="title">Media Source Extensions</h1>
    2.23    
    2.24 -  <h2 id="w3c-editor-s-draft-18-january-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 18 January 2013</h2>
    2.25 +  <h2 id="w3c-editor-s-draft-30-january-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 30 January 2013</h2>
    2.26    <dl>
    2.27      
    2.28        <dt>This version:</dt>
    2.29 -      <dd><a href="http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html">http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html</a></dd>
    2.30 +      <dd><a href="http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html">http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html</a></dd>
    2.31        <dt>Latest published version:</dt>
    2.32        <dd><a href="http://www.w3.org/TR/media-source/">http://www.w3.org/TR/media-source/</a></dd>
    2.33      
    2.34      
    2.35        <dt>Latest editor's draft:</dt>
    2.36 -      <dd><a href="http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html">http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html</a></dd>
    2.37 +      <dd><a href="http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html">http://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html</a></dd>
    2.38      
    2.39      
    2.40      
    2.41 @@ -898,9 +898,22 @@
    2.42  
    2.43          <section id="buffer-monitoring">
    2.44            <h4><span class="secno">3.4.4 </span>SourceBuffer Monitoring</h4>
    2.45 -          <p>The following steps are periodically run during playback to make sure that all of the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> have enough data to ensure uninterrupted playback. Appending new segments and changes to <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> also cause these steps to run because they affect the conditions that trigger state transitions.</p>
    2.46 -          <div class="note"><div class="note-title"><span>Note</span></div><p class="">The web application can monitor changes in <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> to drive <a href="#media-segment">media segment</a> appending.</p></div>
    2.47 -          <div class="issue"><div class="issue-title"><span>Issue 3</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18592">Bug 18592</a> - How much is "enough data to ensure uninterrupted playback"</p></div>
    2.48 +          <p>The following steps are periodically run during playback to make sure that all of the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> have <a href="#enough-data">enough data to ensure uninterrupted playback</a>. Appending new segments and changes to <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> also cause these steps to run because they affect the conditions that trigger state transitions.</p>
    2.49 +
    2.50 +          <p>Having <dfn id="enough-data">enough data to ensure uninterrupted playback</dfn> is an implementation specific condition where the user agent
    2.51 +          determines that it currently has enough data to play the presentation without stalling for a meaningful period of time. This condition is
    2.52 +          constantly evaluated to determine when to transition the media element into and out of the <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code> ready state.
    2.53 +          These transitions indicate when the user agent believes it has enough data buffered or it needs more data respectively.</p>
    2.54 +
    2.55 +          <div class="note"><div class="note-title"><span>Note</span></div><p class="">An implementation may choose to use bytes buffered, time buffered, the append rate, or any other metric it sees fit to
    2.56 +            determine when it has enough data. The metrics used may change during playback so web applications should only rely on the value of
    2.57 +            <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> to determine whether more data is needed or not.</p></div>
    2.58 +
    2.59 +          <div class="note"><div class="note-title"><span>Note</span></div><p class="">When the media element needs more data, it should transition from <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code> to
    2.60 +            <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> early enough for a web application to be able to respond without causing an interruption in playback.
    2.61 +            For example, transitioning when the current playback position is 500ms before the end of the buffered data gives the application roughly
    2.62 +            500ms to append more data before playback stalls.</p></div>
    2.63 +
    2.64            <dl class="switch">
    2.65              <dt>If <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> for all objects in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> do not contain <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#timeranges">TimeRanges</a></code> for the current playback position:</dt>
    2.66              <dd>
    2.67 @@ -910,7 +923,7 @@
    2.68  	        <li>Abort these steps.</li>
    2.69  	      </ol>
    2.70              </dd>
    2.71 -            <dt>If <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> for all objects in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> contain <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#timeranges">TimeRanges</a></code> that include the current playback position and enough data to ensure uninterrupted playback:</dt>
    2.72 +            <dt>If <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> for all objects in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> contain <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#timeranges">TimeRanges</a></code> that include the current playback position and <a href="#enough-data">enough data to ensure uninterrupted playback</a>:</dt>
    2.73              <dd>
    2.74  	      <ol>
    2.75  	        <li>Set the <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute to <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code>.</li>
    2.76 @@ -920,7 +933,7 @@
    2.77  	        <li>Abort these steps.</li>
    2.78  	      </ol>
    2.79              </dd>
    2.80 -            <dt>If <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> for at least one object in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> contains a <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#timeranges">TimeRange</a></code> that includes the current playback position but not enough data to ensure uninterrupted playback:</dt>
    2.81 +            <dt>If <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> for at least one object in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> contains a <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#timeranges">TimeRange</a></code> that includes the current playback position but not <a href="#enough-data">enough data to ensure uninterrupted playback</a>:</dt>
    2.82              <dd>
    2.83  	      <ol>
    2.84  	        <li>Set the <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute to <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>.</li>
    2.85 @@ -1031,7 +1044,7 @@
    2.86      <section id="sourcebuffer">
    2.87        <!--OddPage--><h2><span class="secno">4. </span>SourceBuffer Object</h2>
    2.88  
    2.89 -      <div class="issue"><div class="issue-title"><span>Issue 4</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=20327">Bug 20327</a> - Continuous splice flag</p></div>
    2.90 +      <div class="issue"><div class="issue-title"><span>Issue 3</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=20327">Bug 20327</a> - Continuous splice flag</p></div>
    2.91  
    2.92        <pre class="idl"><span class="idlInterface" id="idl-def-SourceBuffer">interface <span class="idlInterfaceID">SourceBuffer</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
    2.93  <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>boolean</a></span>        <span class="idlAttrName"><a href="#widl-SourceBuffer-appending">appending</a></span>;</span>
    2.94 @@ -1067,7 +1080,7 @@
    2.95              <li>If this object is waiting for the end of a <a href="#media-segment">media segment</a> to be appended, then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> and abort these steps.</li>
    2.96              <li>Update the attribute to the new value.</li>
    2.97            </ol>
    2.98 -          <div class="issue"><div class="issue-title"><span>Issue 5</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=19676">Bug 19676</a> - timestampOffset accuracy</p></div>
    2.99 +          <div class="issue"><div class="issue-title"><span>Issue 4</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=19676">Bug 19676</a> - timestampOffset accuracy</p></div>
   2.100          </dd><dt id="widl-SourceBuffer-videoTracks"><code>videoTracks</code> of type <span class="idlAttrType"><a>VideoTrackList</a></span>, readonly</dt><dd>
   2.101            The list of <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#videotrack">VideoTrack</a></code> objects created by this object.
   2.102          </dd></dl></section><section id="methods-1"><h3><span class="secno">4.2 </span>Methods</h3><dl class="methods"><dt id="widl-SourceBuffer-abort-void"><code>abort</code></dt><dd>
   2.103 @@ -1103,7 +1116,6 @@
   2.104                    <a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-sourceopen">sourceopen</a></code> at the <a href="#parent-media-source">parent media source</a> .</li>
   2.105                </ol>
   2.106              </li>
   2.107 -            <li>If <var>data</var>.byteLength is 0, then abort these steps.</li>
   2.108              <li>
   2.109                <p>If the <var><a href="#sourcebuffer-buffer-full-flag">buffer full flag</a></var> equals true, then throw a <code><a href="http://dom.spec.whatwg.org/#dom-domexception-quota_exceeded_err">QUOTA_EXCEEDED_ERR</a></code> exception and abort these step.</p>
   2.110                <div class="note"><div class="note-title"><span>Note</span></div><p class="">The web application must use <code><a href="#widl-SourceBuffer-remove-void-double-start-double-end">remove()</a></code> to free up space in the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>.</p></div>
   2.111 @@ -1132,7 +1144,6 @@
   2.112  	        <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-sourceopen">sourceopen</a></code> at the <a href="#parent-media-source">parent media source</a> .</li>
   2.113                </ol>
   2.114              </li>
   2.115 -            <li>If <var>maxSize</var> equals 0, then abort these steps.</li>
   2.116              <li>
   2.117                <p>If the <var><a href="#sourcebuffer-buffer-full-flag">buffer full flag</a></var> equals true, then throw a <code><a href="http://dom.spec.whatwg.org/#dom-domexception-quota_exceeded_err">QUOTA_EXCEEDED_ERR</a></code> exception and abort these step.</p>
   2.118                <div class="note"><div class="note-title"><span>Note</span></div><p class="">The web application must use <code><a href="#widl-SourceBuffer-remove-void-double-start-double-end">remove()</a></code> to free up space in the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>.</p></div>
   2.119 @@ -1318,7 +1329,7 @@
   2.120              <li>Set the <code><a href="#widl-SourceBuffer-appending">appending</a></code> attribute to false.</li>
   2.121              <li>
   2.122                <a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-error">error</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.
   2.123 -              <div class="issue"><div class="issue-title"><span>Issue 6</span></div><p class="">Need a way to convey error information.</p></div>
   2.124 +              <div class="issue"><div class="issue-title"><span>Issue 5</span></div><p class="">Need a way to convey error information.</p></div>
   2.125              </li>
   2.126              <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-appendend">appendend</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
   2.127            </ol>
   2.128 @@ -1517,7 +1528,7 @@
   2.129  	      </ol>
   2.130              </li>
   2.131              <li>
   2.132 -	      <p>If the <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute is <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> and the new <a href="#coded-frame">coded frames</a> cause all objects in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> to have enough data to start playback, then run the following steps:</p>
   2.133 +	      <p>If the <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute is <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> and the new <a href="#coded-frame">coded frames</a> cause all objects in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> to have <a href="#enough-data">enough data to ensure uninterrupted playback</a>, then run the following steps:</p>
   2.134  	      <ol>
   2.135  	        <li>Set the <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute to <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code>.</li>
   2.136  	        <li>
   2.137 @@ -1609,20 +1620,23 @@
   2.138  
   2.139        <p id="dom-htmlmediaelement.buffered">The <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered">HTMLMediaElement.buffered</a></code> attribute returns a new static <a href="http://www.w3.org/TR/html5/embedded-content-0.html#normalized-timeranges-object">normalized TimeRanges object</a> created based on the following steps:</p>
   2.140        <ol>
   2.141 +        <li>If <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code>.length equals 0 then return an empty <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#timeranges">TimeRanges</a></code> object and abort these steps.</li>
   2.142          <li>Let <var>active ranges</var> be the ranges returned by <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> for each <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code>.</li>
   2.143 -        <li>Let <var>intersection range</var> be the intersection of the <var>active ranges</var>.</li>
   2.144 -        <li>
   2.145 -          <p>If <code><a href="#widl-MediaSource-readyState">readyState</a></code> is <code><a href="#idl-def-ReadyState">"ended"</a></code>, then run the following steps:</p>
   2.146 +        <li>Let <var>highest end time</var> be the largest range end time in the <var>active ranges</var>.</li>
   2.147 +        <li>Let <var>intersection ranges</var> equal a <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#timeranges">TimeRange</a></code> object containing a single range from 0 to <var>highest end time</var>.</li>
   2.148 +        <li>For each <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> run the following steps:
   2.149            <ol>
   2.150 -	    <li>Let <var>highest end time</var> be the largest end time in the <var>active ranges</var>.</li>
   2.151 -	    <li>Let <var>highest intersection end time</var> be the highest end time in the <var>intersection range</var>.</li>
   2.152 -	    <li>If the <var>highest intersection end time</var> is less than the <var>highest end time</var>, then update the <var>intersection range</var> so that the <var>highest intersection end time</var> equals the <var>highest end time</var>.</li>
   2.153 -	  </ol>
   2.154 -        <div class="issue"><div class="issue-title"><span>Issue 7</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18615">Bug 18615</a> - Define how SourceBuffer.buffered maps to HTMLMediaElement.buffered</p></div>
   2.155 -        <div class="issue"><div class="issue-title"><span>Issue 8</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18400">Bug 18400</a> - Define and document timestamp heuristics</p></div>
   2.156 +            <li>Let <var>source ranges</var> equal the ranges returned by the <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> attribute on the current <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>.</li>
   2.157 +            <li>If <code><a href="#widl-MediaSource-readyState">readyState</a></code> is <code><a href="#idl-def-ReadyState">"ended"</a></code>, then set the end time on the last range in <var>source ranges</var> to 
   2.158 +              <var>highest end time</var>.</li>
   2.159 +            <li>Let <var>new intersection ranges</var> equal the the intersection between the <var>intersection ranges</var> and the <var>source ranges</var>.</li>
   2.160 +            <li>Replace the ranges in <var>intersection ranges</var> with the <var>new intersection ranges</var>.</li>
   2.161 +          </ol>
   2.162          </li>
   2.163 -        <li>Return the <var>intersection range</var>.</li>
   2.164 +        <li>Return the <var>intersection ranges</var>.</li>
   2.165        </ol>
   2.166 +      <div class="issue"><div class="issue-title"><span>Issue 6</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18615">Bug 18615</a> - Define how SourceBuffer.buffered maps to HTMLMediaElement.buffered</p></div>
   2.167 +      <div class="issue"><div class="issue-title"><span>Issue 7</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18400">Bug 18400</a> - Define and document timestamp heuristics</p></div>
   2.168      </section>
   2.169  
   2.170      <section id="audio-track-extensions">
   2.171 @@ -1860,7 +1874,7 @@
   2.172          <h3><span class="secno">11.2 </span>ISO Base Media File Format Byte Streams</h3>
   2.173          <p>This section defines segment formats for implementations that choose to support the ISO Base Media File Format
   2.174  	  <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c061988_ISO_IEC_14496-12_2012.zip">ISO/IEC 14496-12</a> (ISO BMFF).</p> 
   2.175 -          <div class="issue"><div class="issue-title"><span>Issue 9</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18933">Bug 18933</a> - Segment byte boundaries are not defined</p></div>
   2.176 +          <div class="issue"><div class="issue-title"><span>Issue 8</span></div><p class=""><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=18933">Bug 18933</a> - Segment byte boundaries are not defined</p></div>
   2.177  
   2.178  	<section id="iso-init-segments">
   2.179            <h4><span class="secno">11.2.1 </span>Initialization Segments</h4>
   2.180 @@ -2057,7 +2071,17 @@
   2.181          </thead>
   2.182          <tbody>
   2.183            <tr>
   2.184 -	    <td>15 January 2013</td>
   2.185 +	    <td>30 January 2013</td>
   2.186 +            <td>
   2.187 +              <ul>
   2.188 +                <li>Remove early abort step on 0-byte appends so the same events fire as a normal append with bytes.</li>
   2.189 +                <li>Added definition for 'enough data to ensure uninterrupted playback'.</li>
   2.190 +                <li>Updated buffered ranges algorithm to properly compute the ranges for Philip's example.</li>
   2.191 +              </ul>
   2.192 +            </td>
   2.193 +          </tr>
   2.194 +          <tr>
   2.195 +	    <td><a href="http://dvcs.w3.org/hg/html-media/raw-file/fd2a58eec443/media-source/media-source.html">15 January 2013</a></td>
   2.196              <td>Replace setTrackInfo() and getSourceBuffer() with AudioTrack, VideoTrack, and TextTrack extensions.</td>
   2.197            </tr>
   2.198            <tr>
   2.199 @@ -2222,4 +2246,4 @@
   2.200    
   2.201  
   2.202  <section id="references" class="appendix"><!--OddPage--><h2><span class="secno">A. </span>References</h2><section id="informative-references"><h3><span class="secno">A.1 </span>Informative references</h3><dl class="bibliography"><dt id="bib-BCP47">[BCP47]</dt><dd>A. Phillips; M. Davis. <a href="http://tools.ietf.org/html/bcp47"><cite>Tags for Identifying Languages</cite></a> September 2009. IETF Best Current Practice. URL: <a href="http://tools.ietf.org/html/bcp47">http://tools.ietf.org/html/bcp47</a> 
   2.203 -</dd></dl></section></section></body></html>
   2.204 \ No newline at end of file
   2.205 +</dd></dl></section></section></body></html>
     3.1 --- a/media-source/media-source.js	Tue Jan 22 08:25:33 2013 -0800
     3.2 +++ b/media-source/media-source.js	Tue Jan 29 15:44:22 2013 -0800
     3.3 @@ -119,6 +119,7 @@
     3.4      'coded-frames': { func: term_helper, fragment: 'coded-frame', link_text: 'coded frames', },
     3.5      'parent-media-source': { func: term_helper, fragment: 'parent-media-source', link_text: 'parent media source', },
     3.6      'append-sequence': { func: term_helper, fragment: 'append-sequence', link_text: 'append sequence', },
     3.7 +    'enough-data': { func: term_helper, fragment: 'enough-data', link_text: 'enough data to ensure uninterrupted playback', },
     3.8  
     3.9      'duration-change-algorithm': { func: link_helper, fragment: '#duration-change-algorithm', link_text: 'duration change algorithm', },
    3.10      'segment-parser-loop': { func: link_helper, fragment: '#sourcebuffer-segment-parser-loop', link_text: 'segment parser loop', },