media-source/media-source.html
changeset 77 fd2a58eec443
parent 56 52a85235137b
child 79 4654364e441d
equal deleted inserted replaced
76:c1c9cc8ea659 77:fd2a58eec443
   395       <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
   395       <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
   396     
   396     
   397   </p>
   397   </p>
   398   <h1 class="title" id="title">Media Source Extensions</h1>
   398   <h1 class="title" id="title">Media Source Extensions</h1>
   399   
   399   
   400   <h2 id="w3c-editor-s-draft-04-january-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 04 January 2013</h2>
   400   <h2 id="w3c-editor-s-draft-15-january-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 15 January 2013</h2>
   401   <dl>
   401   <dl>
   402     
   402     
   403       <dt>This version:</dt>
   403       <dt>This version:</dt>
   404       <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>
   404       <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>
   405       <dt>Latest published version:</dt>
   405       <dt>Latest published version:</dt>
   505         </p>
   505         </p>
   506         
   506         
   507       
   507       
   508     
   508     
   509   
   509   
   510 </section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a><ul class="toc"><li class="tocline"><a href="#goals" class="tocxref"><span class="secno">1.1 </span>Goals</a></li><li class="tocline"><a href="#definitions" class="tocxref"><span class="secno">1.2 </span>Definitions</a></li></ul></li><li class="tocline"><a href="#source-buffer-model" class="tocxref"><span class="secno">2. </span>Source Buffer Model</a><ul class="toc"><li class="tocline"><a href="#source-buffer-overlapping-segments" class="tocxref"><span class="secno">2.1 </span>Appending a Media Segment over a buffered region</a><ul class="toc"><li class="tocline"><a href="#source-buffer-overlap-complete" class="tocxref"><span class="secno">2.1.1 </span>Complete Overlap</a></li><li class="tocline"><a href="#source-buffer-overlap-start" class="tocxref"><span class="secno">2.1.2 </span>Start Overlap</a></li><li class="tocline"><a href="#source-buffer-overlap-end" class="tocxref"><span class="secno">2.1.3 </span>End Overlap</a></li><li class="tocline"><a href="#source-buffer-overlap-middle" class="tocxref"><span class="secno">2.1.4 </span>Middle Overlap</a></li></ul></li><li class="tocline"><a href="#track-buffer-to-decoder-buffer" class="tocxref"><span class="secno">2.2 </span>Track Buffer to Decoder Buffer transfer</a></li></ul></li><li class="tocline"><a href="#mediasource" class="tocxref"><span class="secno">3. </span>MediaSource Object</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">3.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">3.2 </span>Methods</a></li><li class="tocline"><a href="#mediasource-events" class="tocxref"><span class="secno">3.3 </span>Event Summary</a></li><li class="tocline"><a href="#mediasource-algorithms" class="tocxref"><span class="secno">3.4 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#mediasource-attach" class="tocxref"><span class="secno">3.4.1 </span>Attaching to a media element</a></li><li class="tocline"><a href="#mediasource-detach" class="tocxref"><span class="secno">3.4.2 </span>Detaching from a media element</a></li><li class="tocline"><a href="#mediasource-seeking" class="tocxref"><span class="secno">3.4.3 </span>Seeking</a></li><li class="tocline"><a href="#buffer-monitoring" class="tocxref"><span class="secno">3.4.4 </span>SourceBuffer Monitoring</a></li><li class="tocline"><a href="#active-source-buffer-changes" class="tocxref"><span class="secno">3.4.5 </span>Changes to selected/enabled track state</a></li><li class="tocline"><a href="#duration-change-algorithm" class="tocxref"><span class="secno">3.4.6 </span>Duration change</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebuffer" class="tocxref"><span class="secno">4. </span>SourceBuffer Object</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">4.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">4.2 </span>Methods</a></li><li class="tocline"><a href="#track-buffers" class="tocxref"><span class="secno">4.3 </span>Track Buffers</a></li><li class="tocline"><a href="#sourcebuffer-events" class="tocxref"><span class="secno">4.4 </span>Event Summary</a></li><li class="tocline"><a href="#sourcebuffer-algorithms" class="tocxref"><span class="secno">4.5 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#sourcebuffer-segment-parser-loop" class="tocxref"><span class="secno">4.5.1 </span>Segment Parser Loop</a></li><li class="tocline"><a href="#sourcebuffer-reset-parser-state" class="tocxref"><span class="secno">4.5.2 </span>Reset Parser State</a></li><li class="tocline"><a href="#sourcebuffer-append-error" class="tocxref"><span class="secno">4.5.3 </span>Append Error</a></li><li class="tocline"><a href="#sourcebuffer-stream-append-loop" class="tocxref"><span class="secno">4.5.4 </span>Stream Append Loop</a></li><li class="tocline"><a href="#sourcebuffer-init-segment-received" class="tocxref"><span class="secno">4.5.5 </span>Initialization Segment Received</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-processing" class="tocxref"><span class="secno">4.5.6 </span>Coded Frame Processing</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebufferlist" class="tocxref"><span class="secno">5. </span>SourceBufferList Object</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">5.2 </span>Methods</a></li><li class="tocline"><a href="#sourcebufferlist-events" class="tocxref"><span class="secno">5.3 </span>Event Summary</a></li></ul></li><li class="tocline"><a href="#url" class="tocxref"><span class="secno">6. </span>URL Object</a><ul class="toc"><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">6.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#htmlmediaelement-attributes" class="tocxref"><span class="secno">7. </span>HTMLMediaElement attributes</a></li><li class="tocline"><a href="#byte-stream-formats" class="tocxref"><span class="secno">8. </span>Byte Stream Formats</a><ul class="toc"><li class="tocline"><a href="#webm" class="tocxref"><span class="secno">8.1 </span>WebM Byte Streams</a><ul class="toc"><li class="tocline"><a href="#webm-init-segments" class="tocxref"><span class="secno">8.1.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#webm-media-segments" class="tocxref"><span class="secno">8.1.2 </span>Media Segments</a></li><li class="tocline"><a href="#webm-random-access-points" class="tocxref"><span class="secno">8.1.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#iso" class="tocxref"><span class="secno">8.2 </span>ISO Base Media File Format Byte Streams</a><ul class="toc"><li class="tocline"><a href="#iso-init-segments" class="tocxref"><span class="secno">8.2.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#iso-media-segments" class="tocxref"><span class="secno">8.2.2 </span>Media Segments</a></li><li class="tocline"><a href="#iso-random-access-points" class="tocxref"><span class="secno">8.2.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#mpeg2ts" class="tocxref"><span class="secno">8.3 </span>MPEG-2 Transport Stream Byte Streams</a><ul class="toc"><li class="tocline"><a href="#mpeg2ts-general" class="tocxref"><span class="secno">8.3.1 </span>General</a></li><li class="tocline"><a href="#mpeg2ts-init-segments" class="tocxref"><span class="secno">8.3.2 </span>Initialization Segments</a></li><li class="tocline"><a href="#mpeg2ts-media-segments" class="tocxref"><span class="secno">8.3.3 </span>Media Segments</a></li><li class="tocline"><a href="#mpeg2ts-random-access-points" class="tocxref"><span class="secno">8.3.4 </span>Random Access Points</a></li><li class="tocline"><a href="#mpeg2ts-discontinuities" class="tocxref"><span class="secno">8.3.5 </span>Timestamp Rollover &amp; Discontinuities</a></li></ul></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">9. </span>Examples</a></li><li class="tocline"><a href="#revision-history" class="tocxref"><span class="secno">10. </span>Revision History</a></li></ul></section>
   510 </section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a><ul class="toc"><li class="tocline"><a href="#goals" class="tocxref"><span class="secno">1.1 </span>Goals</a></li><li class="tocline"><a href="#definitions" class="tocxref"><span class="secno">1.2 </span>Definitions</a></li></ul></li><li class="tocline"><a href="#source-buffer-model" class="tocxref"><span class="secno">2. </span>Source Buffer Model</a><ul class="toc"><li class="tocline"><a href="#source-buffer-overlapping-segments" class="tocxref"><span class="secno">2.1 </span>Appending a Media Segment over a buffered region</a><ul class="toc"><li class="tocline"><a href="#source-buffer-overlap-complete" class="tocxref"><span class="secno">2.1.1 </span>Complete Overlap</a></li><li class="tocline"><a href="#source-buffer-overlap-start" class="tocxref"><span class="secno">2.1.2 </span>Start Overlap</a></li><li class="tocline"><a href="#source-buffer-overlap-end" class="tocxref"><span class="secno">2.1.3 </span>End Overlap</a></li><li class="tocline"><a href="#source-buffer-overlap-middle" class="tocxref"><span class="secno">2.1.4 </span>Middle Overlap</a></li></ul></li><li class="tocline"><a href="#track-buffer-to-decoder-buffer" class="tocxref"><span class="secno">2.2 </span>Track Buffer to Decoder Buffer transfer</a></li></ul></li><li class="tocline"><a href="#mediasource" class="tocxref"><span class="secno">3. </span>MediaSource Object</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">3.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">3.2 </span>Methods</a></li><li class="tocline"><a href="#mediasource-events" class="tocxref"><span class="secno">3.3 </span>Event Summary</a></li><li class="tocline"><a href="#mediasource-algorithms" class="tocxref"><span class="secno">3.4 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#mediasource-attach" class="tocxref"><span class="secno">3.4.1 </span>Attaching to a media element</a></li><li class="tocline"><a href="#mediasource-detach" class="tocxref"><span class="secno">3.4.2 </span>Detaching from a media element</a></li><li class="tocline"><a href="#mediasource-seeking" class="tocxref"><span class="secno">3.4.3 </span>Seeking</a></li><li class="tocline"><a href="#buffer-monitoring" class="tocxref"><span class="secno">3.4.4 </span>SourceBuffer Monitoring</a></li><li class="tocline"><a href="#active-source-buffer-changes" class="tocxref"><span class="secno">3.4.5 </span>Changes to selected/enabled track state</a></li><li class="tocline"><a href="#duration-change-algorithm" class="tocxref"><span class="secno">3.4.6 </span>Duration change</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebuffer" class="tocxref"><span class="secno">4. </span>SourceBuffer Object</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">4.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">4.2 </span>Methods</a></li><li class="tocline"><a href="#track-buffers" class="tocxref"><span class="secno">4.3 </span>Track Buffers</a></li><li class="tocline"><a href="#sourcebuffer-events" class="tocxref"><span class="secno">4.4 </span>Event Summary</a></li><li class="tocline"><a href="#sourcebuffer-algorithms" class="tocxref"><span class="secno">4.5 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#sourcebuffer-segment-parser-loop" class="tocxref"><span class="secno">4.5.1 </span>Segment Parser Loop</a></li><li class="tocline"><a href="#sourcebuffer-reset-parser-state" class="tocxref"><span class="secno">4.5.2 </span>Reset Parser State</a></li><li class="tocline"><a href="#sourcebuffer-append-error" class="tocxref"><span class="secno">4.5.3 </span>Append Error</a></li><li class="tocline"><a href="#sourcebuffer-stream-append-loop" class="tocxref"><span class="secno">4.5.4 </span>Stream Append Loop</a></li><li class="tocline"><a href="#sourcebuffer-init-segment-received" class="tocxref"><span class="secno">4.5.5 </span>Initialization Segment Received</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-processing" class="tocxref"><span class="secno">4.5.6 </span>Coded Frame Processing</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebufferlist" class="tocxref"><span class="secno">5. </span>SourceBufferList Object</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">5.2 </span>Methods</a></li><li class="tocline"><a href="#sourcebufferlist-events" class="tocxref"><span class="secno">5.3 </span>Event Summary</a></li></ul></li><li class="tocline"><a href="#url" class="tocxref"><span class="secno">6. </span>URL Object</a><ul class="toc"><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">6.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#htmlmediaelement-attributes" class="tocxref"><span class="secno">7. </span>HTMLMediaElement attributes</a></li><li class="tocline"><a href="#audio-track-extensions" class="tocxref"><span class="secno">8. </span>AudioTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-3" class="tocxref"><span class="secno">8.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#video-track-extensions" class="tocxref"><span class="secno">9. </span>VideoTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-4" class="tocxref"><span class="secno">9.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#text-track-extensions" class="tocxref"><span class="secno">10. </span>TextTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-5" class="tocxref"><span class="secno">10.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#byte-stream-formats" class="tocxref"><span class="secno">11. </span>Byte Stream Formats</a><ul class="toc"><li class="tocline"><a href="#webm" class="tocxref"><span class="secno">11.1 </span>WebM Byte Streams</a><ul class="toc"><li class="tocline"><a href="#webm-init-segments" class="tocxref"><span class="secno">11.1.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#webm-media-segments" class="tocxref"><span class="secno">11.1.2 </span>Media Segments</a></li><li class="tocline"><a href="#webm-random-access-points" class="tocxref"><span class="secno">11.1.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#iso" class="tocxref"><span class="secno">11.2 </span>ISO Base Media File Format Byte Streams</a><ul class="toc"><li class="tocline"><a href="#iso-init-segments" class="tocxref"><span class="secno">11.2.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#iso-media-segments" class="tocxref"><span class="secno">11.2.2 </span>Media Segments</a></li><li class="tocline"><a href="#iso-random-access-points" class="tocxref"><span class="secno">11.2.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#mpeg2ts" class="tocxref"><span class="secno">11.3 </span>MPEG-2 Transport Stream Byte Streams</a><ul class="toc"><li class="tocline"><a href="#mpeg2ts-general" class="tocxref"><span class="secno">11.3.1 </span>General</a></li><li class="tocline"><a href="#mpeg2ts-init-segments" class="tocxref"><span class="secno">11.3.2 </span>Initialization Segments</a></li><li class="tocline"><a href="#mpeg2ts-media-segments" class="tocxref"><span class="secno">11.3.3 </span>Media Segments</a></li><li class="tocline"><a href="#mpeg2ts-random-access-points" class="tocxref"><span class="secno">11.3.4 </span>Random Access Points</a></li><li class="tocline"><a href="#mpeg2ts-discontinuities" class="tocxref"><span class="secno">11.3.5 </span>Timestamp Rollover &amp; Discontinuities</a></li></ul></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">12. </span>Examples</a></li><li class="tocline"><a href="#revision-history" class="tocxref"><span class="secno">13. </span>Revision History</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.1 </span>Informative references</a></li></ul></li></ul></section>
   511 
   511 
   512 
   512 
   513     <section id="introduction">
   513     <section id="introduction">
   514       <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2>
   514       <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2>
   515       <p>This specification allows JavaScript to dynamically construct media streams for &lt;audio&gt; and &lt;video&gt;. 
   515       <p>This specification allows JavaScript to dynamically construct media streams for &lt;audio&gt; and &lt;video&gt;. 
   673 interface <span class="idlInterfaceID">MediaSource</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
   673 interface <span class="idlInterfaceID">MediaSource</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
   674 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-SourceBufferList" class="idlType"><code>SourceBufferList</code></a></span>    <span class="idlAttrName"><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></span>;</span>
   674 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-SourceBufferList" class="idlType"><code>SourceBufferList</code></a></span>    <span class="idlAttrName"><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></span>;</span>
   675 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-SourceBufferList" class="idlType"><code>SourceBufferList</code></a></span>    <span class="idlAttrName"><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></span>;</span>
   675 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-SourceBufferList" class="idlType"><code>SourceBufferList</code></a></span>    <span class="idlAttrName"><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></span>;</span>
   676 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-ReadyState" class="idlType"><code>ReadyState</code></a></span>          <span class="idlAttrName"><a href="#widl-MediaSource-readyState">readyState</a></span>;</span>
   676 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-ReadyState" class="idlType"><code>ReadyState</code></a></span>          <span class="idlAttrName"><a href="#widl-MediaSource-readyState">readyState</a></span>;</span>
   677 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>unrestricted double</a></span> <span class="idlAttrName"><a href="#widl-MediaSource-duration">duration</a></span>;</span>
   677 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>unrestricted double</a></span> <span class="idlAttrName"><a href="#widl-MediaSource-duration">duration</a></span>;</span>
   678 <span class="idlMethod">    <span class="idlMethType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></span>  <span class="idlMethName"><a href="#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">type</span></span>);</span>
   678 <span class="idlMethod">    <span class="idlMethType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></span> <span class="idlMethName"><a href="#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">type</span></span>);</span>
   679 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span>          <span class="idlMethName"><a href="#widl-MediaSource-removeSourceBuffer-void-SourceBuffer-sourceBuffer">removeSourceBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></span> <span class="idlParamName">sourceBuffer</span></span>);</span>
   679 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span>         <span class="idlMethName"><a href="#widl-MediaSource-removeSourceBuffer-void-SourceBuffer-sourceBuffer">removeSourceBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></span> <span class="idlParamName">sourceBuffer</span></span>);</span>
   680 <span class="idlMethod">    <span class="idlMethType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>?</span> <span class="idlMethName"><a href="#widl-MediaSource-getSourceBuffer-SourceBuffer-VideoTrack-videoTrack">getSourceBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a>VideoTrack</a></span> <span class="idlParamName">videoTrack</span></span>);</span>
   680 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span>         <span class="idlMethName"><a href="#widl-MediaSource-endOfStream-void-EndOfStreamError-error">endOfStream</a></span> (<span class="idlParam">optional <span class="idlParamType"><a href="#idl-def-EndOfStreamError" class="idlType"><code>EndOfStreamError</code></a></span> <span class="idlParamName">error</span></span>);</span>
   681 <span class="idlMethod">    <span class="idlMethType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>?</span> <span class="idlMethName"><a href="#widl-MediaSource-getSourceBuffer-SourceBuffer-AudioTrack-audioTrack">getSourceBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a>AudioTrack</a></span> <span class="idlParamName">audioTrack</span></span>);</span>
   681 <span class="idlMethod">    static <span class="idlMethType"><a>bool</a></span>  <span class="idlMethName"><a href="#widl-MediaSource-isTypeSupported-bool-DOMString-type">isTypeSupported</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">type</span></span>);</span>
   682 <span class="idlMethod">    <span class="idlMethType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>?</span> <span class="idlMethName"><a href="#widl-MediaSource-getSourceBuffer-SourceBuffer-TextTrack-textTrack">getSourceBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a>TextTrack</a></span> <span class="idlParamName">textTrack</span></span>);</span>
       
   683 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span>          <span class="idlMethName"><a href="#widl-MediaSource-endOfStream-void-EndOfStreamError-error">endOfStream</a></span> (<span class="idlParam">optional <span class="idlParamType"><a href="#idl-def-EndOfStreamError" class="idlType"><code>EndOfStreamError</code></a></span> <span class="idlParamName">error</span></span>);</span>
       
   684 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span>          <span class="idlMethName"><a href="#widl-MediaSource-setTrackInfo-void-VideoTrack-track-DOMString-kind-DOMString-language">setTrackInfo</a></span> (<span class="idlParam"><span class="idlParamType"><a>VideoTrack</a></span> <span class="idlParamName">track</span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">kind</span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">language</span></span>);</span>
       
   685 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span>          <span class="idlMethName"><a href="#widl-MediaSource-setTrackInfo-void-AudioTrack-track-DOMString-kind-DOMString-language">setTrackInfo</a></span> (<span class="idlParam"><span class="idlParamType"><a>AudioTrack</a></span> <span class="idlParamName">track</span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">kind</span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">language</span></span>);</span>
       
   686 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span>          <span class="idlMethName"><a href="#widl-MediaSource-setTrackInfo-void-TextTrack-track-DOMString-kind-DOMString-language">setTrackInfo</a></span> (<span class="idlParam"><span class="idlParamType"><a>TextTrack</a></span> <span class="idlParamName">track</span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">kind</span></span>, <span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">language</span></span>);</span>
       
   687 <span class="idlMethod">    static <span class="idlMethType"><a>bool</a></span>   <span class="idlMethName"><a href="#widl-MediaSource-isTypeSupported-bool-DOMString-type">isTypeSupported</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">type</span></span>);</span>
       
   688 };</span></pre><section id="attributes"><h3><span class="secno">3.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-MediaSource-activeSourceBuffers"><code>activeSourceBuffers</code> of type <span class="idlAttrType"><a href="#idl-def-SourceBufferList" class="idlType"><code>SourceBufferList</code></a></span>, readonly</dt><dd>
   682 };</span></pre><section id="attributes"><h3><span class="secno">3.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-MediaSource-activeSourceBuffers"><code>activeSourceBuffers</code> of type <span class="idlAttrType"><a href="#idl-def-SourceBufferList" class="idlType"><code>SourceBufferList</code></a></span>, readonly</dt><dd>
   689           <p>Contains the subset of <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> that are providing the 
   683           <p>Contains the subset of <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> that are providing the 
   690             <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-selected">selected video track</a>,  the 
   684             <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-selected">selected video track</a>,  the 
   691             <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-enabled">enabled audio tracks</a>, and the 
   685             <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-enabled">enabled audio tracks</a>, and the 
   692             <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-showing">"showing"</a> or <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-hidden">"hidden"</a> text tracks.
   686             <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-showing">"showing"</a> or <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-hidden">"hidden"</a> text tracks.
   769 	        </dd>
   763 	        </dd>
   770                 <dt>Otherwise</dt>
   764                 <dt>Otherwise</dt>
   771                 <dd>Throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception.</dd>
   765                 <dd>Throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception.</dd>
   772               </dl>
   766               </dl>
   773             </li>
   767             </li>
   774           </ol></dd><dt id="widl-MediaSource-getSourceBuffer-SourceBuffer-VideoTrack-videoTrack"><code>getSourceBuffer</code></dt><dd>
   768           </ol></dd><dt id="widl-MediaSource-isTypeSupported-bool-DOMString-type"><code>isTypeSupported</code>, static</dt><dd>
   775           <p>Gets the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object that created a specific <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#videotrack">VideoTrack</a></code>.</p>
       
   776 
       
   777           
       
   778         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">videoTrack</td><td class="prmType"><code><a>VideoTrack</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></code>, nullable</div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
       
   779             <li>If <var>videoTrack</var> was not created by any <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> then return null.</li>
       
   780             <li>Return the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> that created <var>videoTrack</var>.
       
   781           </li></ol></dd><dt id="widl-MediaSource-getSourceBuffer-SourceBuffer-AudioTrack-audioTrack"><code>getSourceBuffer</code></dt><dd>
       
   782           <p>Gets the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object that created a specific <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#audiotrack">AudioTrack</a></code>.</p>
       
   783 
       
   784           
       
   785         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">audioTrack</td><td class="prmType"><code><a>AudioTrack</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></code>, nullable</div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
       
   786             <li>If <var>audioTrack</var> was not created by any <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> then return null.</li>
       
   787             <li>Return the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> that created <var>audioTrack</var>.
       
   788           </li></ol></dd><dt id="widl-MediaSource-getSourceBuffer-SourceBuffer-TextTrack-textTrack"><code>getSourceBuffer</code></dt><dd>
       
   789           <p>Gets the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object that created a specific <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#texttrack">TextTrack</a></code>.</p>
       
   790 
       
   791           
       
   792         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">textTrack</td><td class="prmType"><code><a>TextTrack</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></code>, nullable</div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
       
   793             <li>If <var>textTrack</var> was not created by any <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> then return null.</li>
       
   794             <li>Return the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> that created <var>textTrack</var>.
       
   795           </li></ol></dd><dt id="widl-MediaSource-isTypeSupported-bool-DOMString-type"><code>isTypeSupported</code>, static</dt><dd>
       
   796           <p>Check to see whether the <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a> is capable of creating <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects for the the specified MIME type.</p>
   769           <p>Check to see whether the <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a> is capable of creating <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects for the the specified MIME type.</p>
   797 
   770 
   798           
   771           
   799           <div class="note"><div class="note-title"><span>Note</span></div><p class="">
   772           <div class="note"><div class="note-title"><span>Note</span></div><p class="">
   800             If true is returned from this method, it only indicates that the <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a> implementation is capable of creating <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects for the specified MIME type. An <code><a href="#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer()</a></code> call may still fail if sufficient resources are not available to support the addition of a new <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>.
   773             If true is returned from this method, it only indicates that the <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a> implementation is capable of creating <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects for the specified MIME type. An <code><a href="#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer()</a></code> call may still fail if sufficient resources are not available to support the addition of a new <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>.
   814 
   787 
   815           
   788           
   816         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">sourceBuffer</td><td class="prmType"><code><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
   789         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">sourceBuffer</td><td class="prmType"><code><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
   817             <li>If <var>sourceBuffer</var> is null then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these steps.</li>
   790             <li>If <var>sourceBuffer</var> is null then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these steps.</li>
   818             <li>If <var>sourceBuffer</var> specifies an object that is not in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> then throw a <code><a href="http://dom.spec.whatwg.org/#dom-domexception-not_found_err">NOT_FOUND_ERR</a></code> exception and abort these steps.</li>
   791             <li>If <var>sourceBuffer</var> specifies an object that is not in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> then throw a <code><a href="http://dom.spec.whatwg.org/#dom-domexception-not_found_err">NOT_FOUND_ERR</a></code> exception and abort these steps.</li>
   819             <li>Remove track information from <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-audiotracks">audioTracks</a></code>, <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-videotracks">videoTracks</a></code>, and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks">textTracks</a></code> for all tracks associated with <var>sourceBuffer</var> and <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a> at the modified lists.</li>
   792             <li>Set the the sourceBuffer attribute in all tracks in <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-audioTracks">audioTracks</a></code>, <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-videoTracks">videoTracks</a></code>, and <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-textTracks">textTracks</a></code> to null.</li>
       
   793             <li>Remove all the tracks in <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-audioTracks">audioTracks</a></code>, <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-videoTracks">videoTracks</a></code>, and <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-textTracks">textTracks</a></code> from the respective <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-audiotracks">audioTracks</a></code>, <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-videotracks">videoTracks</a></code>, and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks">textTracks</a></code> attributes on the HTMLMediaElement.</li>
       
   794             <li>Remove all the tracks in <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-audioTracks">audioTracks</a></code>, <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-videoTracks">videoTracks</a></code>, and <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-textTracks">textTracks</a></code> and <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the modified lists.</li>
       
   795             <li><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the HTMLMediaElement track lists that were modified.</li>
   820             <li>If <var>sourceBuffer</var> is in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code>, then remove it from <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> and <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-removesourcebuffer">removesourcebuffer</a></code> at <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code>.</li>
   796             <li>If <var>sourceBuffer</var> is in <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code>, then remove it from <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code> and <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-removesourcebuffer">removesourcebuffer</a></code> at <code><a href="#widl-MediaSource-activeSourceBuffers">activeSourceBuffers</a></code>.</li>
   821             <li>Remove <var>sourceBuffer</var> from <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> and <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-removesourcebuffer">removesourcebuffer</a></code> at <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code>.</li>
   797             <li>Remove <var>sourceBuffer</var> from <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> and <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-removesourcebuffer">removesourcebuffer</a></code> at <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code>.</li>
   822             <li>Destroy all resources for <var>sourceBuffer</var>.</li>
   798             <li>Destroy all resources for <var>sourceBuffer</var>.</li>
   823           </ol></dd><dt id="widl-MediaSource-setTrackInfo-void-VideoTrack-track-DOMString-kind-DOMString-language"><code>setTrackInfo</code></dt><dd>
   799           </ol></dd></dl></section>
   824             <p>Set the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-kind">kind</a></code> and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-language">language</a></code> of the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#videotrack">VideoTrack</a></code> <var>track</var>.</p>
       
   825             <div class="note"><div class="note-title"><span>Note</span></div><p class="">This method would be unnecessary if the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-kind">kind</a></code> and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-language">language</a></code> attributes of <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#videotrack">VideoTrack</a></code> were not read-only.</p></div>
       
   826         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">track</td><td class="prmType"><code><a>VideoTrack</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">kind</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">language</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-MediaSource-setTrackInfo-void-AudioTrack-track-DOMString-kind-DOMString-language"><code>setTrackInfo</code></dt><dd>
       
   827             <p>Set the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-kind">kind</a></code> and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-language">language</a></code> of the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#audiotrack">AudioTrack</a></code> <var>track</var>.</p>
       
   828             <div class="note"><div class="note-title"><span>Note</span></div><p class="">This method would be unnecessary if the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-kind">kind</a></code> and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-language">language</a></code> attributes of <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#audiotrack">AudioTrack</a></code> were not read-only.</p></div>
       
   829         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">track</td><td class="prmType"><code><a>AudioTrack</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">kind</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">language</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-MediaSource-setTrackInfo-void-TextTrack-track-DOMString-kind-DOMString-language"><code>setTrackInfo</code></dt><dd>
       
   830             <p>Set the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-kind">kind</a></code> and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-language">language</a></code> of the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#texttrack">TextTrack</a></code> <var>track</var>.</p>
       
   831             <div class="note"><div class="note-title"><span>Note</span></div><p class="">This method would be unnecessary if the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-kind">kind</a></code> and <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-language">language</a></code> attributes of <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#texttrack">TextTrack</a></code> were not read-only.</p></div>
       
   832         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">track</td><td class="prmType"><code><a>TextTrack</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">kind</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr><tr><td class="prmName">language</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></section>
       
   833 
   800 
   834       <section id="mediasource-events">
   801       <section id="mediasource-events">
   835         <h3><span class="secno">3.3 </span>Event Summary</h3>
   802         <h3><span class="secno">3.3 </span>Event Summary</h3>
   836         <table class="old-table">
   803         <table class="old-table">
   837           <thead>
   804           <thead>
  1065       <!--OddPage--><h2><span class="secno">4. </span>SourceBuffer Object</h2>
  1032       <!--OddPage--><h2><span class="secno">4. </span>SourceBuffer Object</h2>
  1066 
  1033 
  1067       <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>
  1034       <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>
  1068 
  1035 
  1069       <pre class="idl"><span class="idlInterface" id="idl-def-SourceBuffer">interface <span class="idlInterfaceID">SourceBuffer</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
  1036       <pre class="idl"><span class="idlInterface" id="idl-def-SourceBuffer">interface <span class="idlInterfaceID">SourceBuffer</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
  1070 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>boolean</a></span>    <span class="idlAttrName"><a href="#widl-SourceBuffer-appending">appending</a></span>;</span>
  1037 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>boolean</a></span>        <span class="idlAttrName"><a href="#widl-SourceBuffer-appending">appending</a></span>;</span>
  1071 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>TimeRanges</a></span> <span class="idlAttrName"><a href="#widl-SourceBuffer-buffered">buffered</a></span>;</span>
  1038 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>TimeRanges</a></span>     <span class="idlAttrName"><a href="#widl-SourceBuffer-buffered">buffered</a></span>;</span>
  1072 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>double</a></span>     <span class="idlAttrName"><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></span>;</span>
  1039 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>double</a></span>         <span class="idlAttrName"><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></span>;</span>
       
  1040 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>AudioTrackList</a></span> <span class="idlAttrName"><a href="#widl-SourceBuffer-audioTracks">audioTracks</a></span>;</span>
       
  1041 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>VideoTrackList</a></span> <span class="idlAttrName"><a href="#widl-SourceBuffer-videoTracks">videoTracks</a></span>;</span>
       
  1042 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>TextTrackList</a></span>  <span class="idlAttrName"><a href="#widl-SourceBuffer-textTracks">textTracks</a></span>;</span>
  1073 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-appendArrayBuffer-void-ArrayBuffer-data">appendArrayBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a>ArrayBuffer</a></span> <span class="idlParamName">data</span></span>);</span>
  1043 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-appendArrayBuffer-void-ArrayBuffer-data">appendArrayBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a>ArrayBuffer</a></span> <span class="idlParamName">data</span></span>);</span>
  1074 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-maxSize">appendStream</a></span> (<span class="idlParam"><span class="idlParamType"><a>Stream</a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
  1044 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-maxSize">appendStream</a></span> (<span class="idlParam"><span class="idlParamType"><a>Stream</a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
  1075 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-abort-void">abort</a></span> ();</span>
  1045 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-abort-void">abort</a></span> ();</span>
  1076 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-remove-void-double-start-double-end">remove</a></span> (<span class="idlParam"><span class="idlParamType"><a>double</a></span> <span class="idlParamName">start</span></span>, <span class="idlParam"><span class="idlParamType"><a>double</a></span> <span class="idlParamName">end</span></span>);</span>
  1046 <span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-SourceBuffer-remove-void-double-start-double-end">remove</a></span> (<span class="idlParam"><span class="idlParamType"><a>double</a></span> <span class="idlParamName">start</span></span>, <span class="idlParam"><span class="idlParamType"><a>double</a></span> <span class="idlParamName">end</span></span>);</span>
  1077 };</span></pre><section id="attributes-1"><h3><span class="secno">4.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-SourceBuffer-appending"><code>appending</code> of type <span class="idlAttrType"><a>boolean</a></span>, readonly</dt><dd>
  1047 };</span></pre><section id="attributes-1"><h3><span class="secno">4.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-SourceBuffer-appending"><code>appending</code> of type <span class="idlAttrType"><a>boolean</a></span>, readonly</dt><dd>
  1078           <p>Indicates whether an <code><a href="#widl-SourceBuffer-appendArrayBuffer-void-ArrayBuffer-data">appendArrayBuffer()</a></code> or <code><a href="#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-maxSize">appendStream()</a></code> operation is still being processed.</p>
  1048           <p>Indicates whether an <code><a href="#widl-SourceBuffer-appendArrayBuffer-void-ArrayBuffer-data">appendArrayBuffer()</a></code> or <code><a href="#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-maxSize">appendStream()</a></code> operation is still being processed.</p>
       
  1049         </dd><dt id="widl-SourceBuffer-audioTracks"><code>audioTracks</code> of type <span class="idlAttrType"><a>AudioTrackList</a></span>, readonly</dt><dd>
       
  1050           The list of <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#audiotrack">AudioTrack</a></code> objects created by this object.
  1079         </dd><dt id="widl-SourceBuffer-buffered"><code>buffered</code> of type <span class="idlAttrType"><a>TimeRanges</a></span>, readonly</dt><dd>
  1051         </dd><dt id="widl-SourceBuffer-buffered"><code>buffered</code> of type <span class="idlAttrType"><a>TimeRanges</a></span>, readonly</dt><dd>
  1080           <p>Indicates what <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#timeranges">TimeRanges</a></code> are buffered in the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>.</p>
  1052           <p>Indicates what <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#timeranges">TimeRanges</a></code> are buffered in the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>.</p>
  1081           <p>When the attribute is read the following steps must occur:</p>
  1053           <p>When the attribute is read the following steps must occur:</p>
  1082           <ol>
  1054           <ol>
  1083             <li>If this object has been removed from the <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> attribute of the <a href="#parent-media-source">parent media source</a> then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
  1055             <li>If this object has been removed from the <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> attribute of the <a href="#parent-media-source">parent media source</a> then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
  1084             <li>Return a new static <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#normalized-timeranges-object">normalized TimeRanges object</a> for the <a href="#media-segment">media segments</a> buffered.</li>
  1056             <li>Return a new static <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#normalized-timeranges-object">normalized TimeRanges object</a> for the <a href="#media-segment">media segments</a> buffered.</li>
  1085           </ol>
  1057           </ol>
       
  1058         </dd><dt id="widl-SourceBuffer-textTracks"><code>textTracks</code> of type <span class="idlAttrType"><a>TextTrackList</a></span>, readonly</dt><dd>
       
  1059           The list of <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#texttrack">TextTrack</a></code> objects created by this object.
  1086         </dd><dt id="widl-SourceBuffer-timestampOffset"><code>timestampOffset</code> of type <span class="idlAttrType"><a>double</a></span></dt><dd>
  1060         </dd><dt id="widl-SourceBuffer-timestampOffset"><code>timestampOffset</code> of type <span class="idlAttrType"><a>double</a></span></dt><dd>
  1087           <p>Controls the offset applied to timestamps inside subsequent <a href="#media-segment">media segments</a> that are appended to this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>. The <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> is initially set to 0 which indicates that no offset is being applied.</p>
  1061           <p>Controls the offset applied to timestamps inside subsequent <a href="#media-segment">media segments</a> that are appended to this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>. The <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> is initially set to 0 which indicates that no offset is being applied.</p>
  1088           <p>On getting, Return the initial value or the last value that was successfully set.</p>
  1062           <p>On getting, Return the initial value or the last value that was successfully set.</p>
  1089           <p>On setting, run the following steps:</p>
  1063           <p>On setting, run the following steps:</p>
  1090           <ol>
  1064           <ol>
  1092             <li>If the <code><a href="#widl-MediaSource-readyState">readyState</a></code> attribute of the <a href="#parent-media-source">parent media source</a> is not in the <code><a href="#idl-def-ReadyState">"open"</a></code> state, then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
  1066             <li>If the <code><a href="#widl-MediaSource-readyState">readyState</a></code> attribute of the <a href="#parent-media-source">parent media source</a> is not in the <code><a href="#idl-def-ReadyState">"open"</a></code> state, then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
  1093             <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>
  1067             <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>
  1094             <li>Update the attribute to the new value.</li>
  1068             <li>Update the attribute to the new value.</li>
  1095           </ol>
  1069           </ol>
  1096           <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>
  1070           <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>
       
  1071         </dd><dt id="widl-SourceBuffer-videoTracks"><code>videoTracks</code> of type <span class="idlAttrType"><a>VideoTrackList</a></span>, readonly</dt><dd>
       
  1072           The list of <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#videotrack">VideoTrack</a></code> objects created by this object.
  1097         </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>
  1073         </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>
  1098           <p>Aborts the current segment and resets the segment parser.</p>
  1074           <p>Aborts the current segment and resets the segment parser.</p>
  1099 
  1075 
  1100           
  1076           
  1101         <div><em>No parameters.</em></div><div><em>Return type: </em><code><a>void</a></code></div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
  1077         <div><em>No parameters.</em></div><div><em>Return type: </em><code><a>void</a></code></div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
  1429                       <ol>
  1405                       <ol>
  1430                         <li>Set the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-enabled">enabled</a></code> property on <var>new audio track</var> to true.</li>
  1406                         <li>Set the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-enabled">enabled</a></code> property on <var>new audio track</var> to true.</li>
  1431                         <li>Set <var>active track flag</var> to true.</li>
  1407                         <li>Set <var>active track flag</var> to true.</li>
  1432                       </ol>
  1408                       </ol>
  1433                     </li>
  1409                     </li>
  1434                     <li>Add <var>new audio track</var> to <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-audiotracks">audioTracks</a></code>.</li>
  1410                     <li>Add <var>new audio track</var> to the <code><a href="#widl-SourceBuffer-audioTracks">audioTracks</a></code> attribute on this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
       
  1411                     <li>Add <var>new audio track</var> to the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-audiotracks">audioTracks</a></code> attribute on the HTMLMediaElement.</li>
  1435                     <li>Create a new <a href="#track-buffer">track buffer</a> to store <a href="#coded-frame">coded frames</a> for this track.</li>
  1412                     <li>Create a new <a href="#track-buffer">track buffer</a> to store <a href="#coded-frame">coded frames</a> for this track.</li>
  1436                     <li>Add the <a href="#track-description">track description</a> for this track to the <a href="#track-buffer">track buffer</a>.</li>
  1413                     <li>Add the <a href="#track-description">track description</a> for this track to the <a href="#track-buffer">track buffer</a>.</li>
  1437                   </ol>
  1414                   </ol>
  1438                 </li>
  1415                 </li>
  1439                 <li>
  1416                 <li>
  1449                       <ol>
  1426                       <ol>
  1450                         <li>Set the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-selected">selected</a></code> property on <var>new video track</var> to true.</li>
  1427                         <li>Set the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-selected">selected</a></code> property on <var>new video track</var> to true.</li>
  1451                         <li>Set <var>active track flag</var> to true.</li>
  1428                         <li>Set <var>active track flag</var> to true.</li>
  1452                       </ol>
  1429                       </ol>
  1453                     </li>
  1430                     </li>
  1454                     <li>Add <var>new video track</var> to <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-videotracks">videoTracks</a></code>.</li>
  1431                     <li>Add <var>new video track</var> to the <code><a href="#widl-SourceBuffer-videoTracks">videoTracks</a></code> attribute on this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
       
  1432                     <li>Add <var>new video track</var> to the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-videotracks">videoTracks</a></code> attribute on the HTMLMediaElement.</li>
  1455                     <li>Create a new <a href="#track-buffer">track buffer</a> to store <a href="#coded-frame">coded frames</a> for this track.</li>
  1433                     <li>Create a new <a href="#track-buffer">track buffer</a> to store <a href="#coded-frame">coded frames</a> for this track.</li>
  1456                     <li>Add the <a href="#track-description">track description</a> for this track to the <a href="#track-buffer">track buffer</a>.</li>
  1434                     <li>Add the <a href="#track-description">track description</a> for this track to the <a href="#track-buffer">track buffer</a>.</li>
  1457                   </ol>
  1435                   </ol>
  1458                 </li>
  1436                 </li>
  1459                 <li>
  1437                 <li>
  1464                       information from the <a href="#init-segment">initialization segment</a>.</li>
  1442                       information from the <a href="#init-segment">initialization segment</a>.</li>
  1465                     <li>
  1443                     <li>
  1466                       If the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-mode">mode</a></code> property on <var>new text track</var> equals <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-showing">"showing"</a></code> or
  1444                       If the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-mode">mode</a></code> property on <var>new text track</var> equals <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-showing">"showing"</a></code> or
  1467                       <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-hidden">"hidden"</a></code>, then set <var>active track flag</var> to true.
  1445                       <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-hidden">"hidden"</a></code>, then set <var>active track flag</var> to true.
  1468                     </li>
  1446                     </li>
  1469                     <li>Add <var>new text track</var> to <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks">textTracks</a></code>.</li>
  1447                     <li>Add <var>new text track</var> to the <code><a href="#widl-SourceBuffer-textTracks">textTracks</a></code> attribute on this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
       
  1448                     <li>Add <var>new text track</var> to the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks">textTracks</a></code> attribute on the HTMLMediaElement.</li>
  1470                     <li>Create a new <a href="#track-buffer">track buffer</a> to store <a href="#coded-frame">coded frames</a> for this track.</li>
  1449                     <li>Create a new <a href="#track-buffer">track buffer</a> to store <a href="#coded-frame">coded frames</a> for this track.</li>
  1471                     <li>Add the <a href="#track-description">track description</a> for this track to the <a href="#track-buffer">track buffer</a>.</li>
  1450                     <li>Add the <a href="#track-description">track description</a> for this track to the <a href="#track-buffer">track buffer</a>.</li>
  1472                   </ol>
  1451                   </ol>
  1473                 </li>
  1452                 </li>
  1474                 <li>If <var>active track flag</var> equals true, then run the following steps:
  1453                 <li>If <var>active track flag</var> equals true, then run the following steps:
  1643         <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>
  1622         <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>
  1644         </li>
  1623         </li>
  1645         <li>Return the <var>intersection range</var>.</li>
  1624         <li>Return the <var>intersection range</var>.</li>
  1646       </ol>
  1625       </ol>
  1647     </section>
  1626     </section>
  1648     
  1627 
       
  1628     <section id="audio-track-extensions">
       
  1629       <!--OddPage--><h2><span class="secno">8. </span>AudioTrack Extensions</h2>
       
  1630       <p>This section specifies extensions to the HTML <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#audiotrack">AudioTrack</a></code> definition.</p>
       
  1631 
       
  1632       <pre class="idl"><span class="idlInterface" id="idl-def-AudioTrack">partial interface <span class="idlInterfaceID">AudioTrack</span> {
       
  1633 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>DOMString</a></span>     <span class="idlAttrName"><a href="#widl-AudioTrack-kind">kind</a></span>;</span>
       
  1634 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>DOMString</a></span>     <span class="idlAttrName"><a href="#widl-AudioTrack-language">language</a></span>;</span>
       
  1635 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>?</span> <span class="idlAttrName"><a href="#widl-AudioTrack-sourceBuffer">sourceBuffer</a></span>;</span>
       
  1636 };</span></pre><section id="attributes-3"><h3><span class="secno">8.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-AudioTrack-kind"><code>kind</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt><dd>
       
  1637           <p>Allows the web application to get and update the track <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-kind">kind</a></code>.</p>
       
  1638           <p>On getting, return the current value of the attribute. This is either the value provided when this object was created or the value provided on
       
  1639             the last successful set operation.</p><p>
       
  1640           </p><p>On setting, run the following steps:</p>
       
  1641           <ol>
       
  1642             <li>If the value being assigned to this attribute does not match one of the <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-TrackList-getKind-categories">kind categories</a>, then abort these steps.</li>
       
  1643             <li>Update this attribute to the new value.</li>
       
  1644             <li>If the <code><a href="#widl-AudioTrack-sourceBuffer">sourceBuffer</a></code> attribute on this track is not null, then
       
  1645               <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at
       
  1646               <code><a href="#widl-AudioTrack-sourceBuffer">sourceBuffer</a></code>.<code><a href="#widl-SourceBuffer-audioTracks">audioTracks</a></code>.
       
  1647             </li>
       
  1648             <li><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-audiotracks">audioTracks</a></code> attribute on the
       
  1649               HTMLMediaElement.
       
  1650             </li>
       
  1651           </ol>
       
  1652         </dd><dt id="widl-AudioTrack-language"><code>language</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt><dd>
       
  1653           <p>Allows the web application to get and update the track <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-audiotrack-language">language</a></code>.</p>
       
  1654           <p>On getting, return the current value of the attribute. This is either the value provided when this object was created or the value provided on
       
  1655             the last successful set operation.</p><p>
       
  1656           </p><p>On setting, run the following steps:</p>
       
  1657           <ol>
       
  1658             <li>If the value being assigned to this attribute is not an empty string or a BCP 47 language tag[<cite><a class="bibref" href="#bib-BCP47">BCP47</a></cite>], then abort these steps.</li>
       
  1659             <li>Update this attribute to the new value.</li>
       
  1660             <li>If the <code><a href="#widl-AudioTrack-sourceBuffer">sourceBuffer</a></code> attribute on this track is not null, then
       
  1661               <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at
       
  1662               <code><a href="#widl-AudioTrack-sourceBuffer">sourceBuffer</a></code>.<code><a href="#widl-SourceBuffer-audioTracks">audioTracks</a></code>.
       
  1663             </li>
       
  1664             <li><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-audiotracks">audioTracks</a></code> attribute on the
       
  1665               HTMLMediaElement.
       
  1666             </li>
       
  1667           </ol>
       
  1668         </dd><dt id="widl-AudioTrack-sourceBuffer"><code>sourceBuffer</code> of type <span class="idlAttrType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></span>, readonly, nullable</dt><dd>
       
  1669           <p>Returns the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> that created this track. Returns null if this track was not created by a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> or the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> has been removed from the <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> attribute of its <a href="#parent-media-source">parent media source</a>.</p>
       
  1670         </dd></dl></section>
       
  1671     </section>
       
  1672 
       
  1673     <section id="video-track-extensions">
       
  1674       <!--OddPage--><h2><span class="secno">9. </span>VideoTrack Extensions</h2>
       
  1675       <p>This section specifies extensions to the HTML <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#videotrack">VideoTrack</a></code> definition.</p>
       
  1676 
       
  1677       <pre class="idl"><span class="idlInterface" id="idl-def-VideoTrack">partial interface <span class="idlInterfaceID">VideoTrack</span> {
       
  1678 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>DOMString</a></span>     <span class="idlAttrName"><a href="#widl-VideoTrack-kind">kind</a></span>;</span>
       
  1679 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>DOMString</a></span>     <span class="idlAttrName"><a href="#widl-VideoTrack-language">language</a></span>;</span>
       
  1680 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>?</span> <span class="idlAttrName"><a href="#widl-VideoTrack-sourceBuffer">sourceBuffer</a></span>;</span>
       
  1681 };</span></pre><section id="attributes-4"><h3><span class="secno">9.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-VideoTrack-kind"><code>kind</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt><dd>
       
  1682           <p>Allows the web application to get and update the track <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-kind">kind</a></code>.</p>
       
  1683           <p>On getting, return the current value of the attribute. This is either the value provided when this object was created or the value provided on
       
  1684             the last successful set operation.</p><p>
       
  1685           </p><p>On setting, run the following steps:</p>
       
  1686           <ol>
       
  1687             <li>If the value being assigned to this attribute does not match one of the <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-TrackList-getKind-categories">kind categories</a>, then abort these steps.</li>
       
  1688             <li>Update this attribute to the new value.</li>
       
  1689             <li>If the <code><a href="#widl-VideoTrack-sourceBuffer">sourceBuffer</a></code> attribute on this track is not null, then
       
  1690               <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at
       
  1691               <code><a href="#widl-VideoTrack-sourceBuffer">sourceBuffer</a></code>.<code><a href="#widl-SourceBuffer-videoTracks">videoTracks</a></code>.
       
  1692             </li>
       
  1693             <li><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-videotracks">videoTracks</a></code> attribute on the
       
  1694               HTMLMediaElement.
       
  1695             </li>
       
  1696           </ol>
       
  1697         </dd><dt id="widl-VideoTrack-language"><code>language</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt><dd>
       
  1698           <p>Allows the web application to get and update the track <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-videotrack-language">language</a></code>.</p>
       
  1699           <p>On getting, return the current value of the attribute. This is either the value provided when this object was created or the value provided on
       
  1700             the last successful set operation.</p><p>
       
  1701           </p><p>On setting, run the following steps:</p>
       
  1702           <ol>
       
  1703             <li>If the value being assigned to this attribute is not an empty string or a BCP 47 language tag[<cite><a class="bibref" href="#bib-BCP47">BCP47</a></cite>], then abort these steps.</li>
       
  1704             <li>Update this attribute to the new value.</li>
       
  1705             <li>If the <code><a href="#widl-VideoTrack-sourceBuffer">sourceBuffer</a></code> attribute on this track is not null, then
       
  1706               <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at
       
  1707               <code><a href="#widl-VideoTrack-sourceBuffer">sourceBuffer</a></code>.<code><a href="#widl-SourceBuffer-videoTracks">videoTracks</a></code>.
       
  1708             </li>
       
  1709             <li><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-videotracks">videoTracks</a></code> attribute on the
       
  1710               HTMLMediaElement.
       
  1711             </li>
       
  1712           </ol>
       
  1713         </dd><dt id="widl-VideoTrack-sourceBuffer"><code>sourceBuffer</code> of type <span class="idlAttrType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></span>, readonly, nullable</dt><dd>
       
  1714           <p>Returns the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> that created this track. Returns null if this track was not created by a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> or the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> has been removed from the <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> attribute of its <a href="#parent-media-source">parent media source</a>.</p>
       
  1715         </dd></dl></section></section>
       
  1716 
       
  1717     <section id="text-track-extensions">
       
  1718       <!--OddPage--><h2><span class="secno">10. </span>TextTrack Extensions</h2>
       
  1719       <p>This section specifies extensions to the HTML <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#texttrack">TextTrack</a></code> definition.</p>
       
  1720 
       
  1721       <pre class="idl"><span class="idlInterface" id="idl-def-TextTrack">partial interface <span class="idlInterfaceID">TextTrack</span> {
       
  1722 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>DOMString</a></span>     <span class="idlAttrName"><a href="#widl-TextTrack-kind">kind</a></span>;</span>
       
  1723 <span class="idlAttribute">             attribute <span class="idlAttrType"><a>DOMString</a></span>     <span class="idlAttrName"><a href="#widl-TextTrack-language">language</a></span>;</span>
       
  1724 <span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>?</span> <span class="idlAttrName"><a href="#widl-TextTrack-sourceBuffer">sourceBuffer</a></span>;</span>
       
  1725 };</span></pre><section id="attributes-5"><h3><span class="secno">10.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-TextTrack-kind"><code>kind</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt><dd>
       
  1726           <p>Allows the web application to get and update the track <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-kind">kind</a></code>.</p>
       
  1727           <p>On getting, return the current value of the attribute. This is either the value provided when this object was created or the value provided on
       
  1728             the last successful set operation.</p><p>
       
  1729           </p><p>On setting, run the following steps:</p>
       
  1730           <ol>
       
  1731             <li>If the value being assigned to this attribute does not match one of the <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#text-track-kind">text track kinds</a>, then abort these steps.</li>
       
  1732             <li>Update this attribute to the new value.</li>
       
  1733             <li>If the <code><a href="#widl-TextTrack-sourceBuffer">sourceBuffer</a></code> attribute on this track is not null, then
       
  1734               <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at
       
  1735               <code><a href="#widl-TextTrack-sourceBuffer">sourceBuffer</a></code>.<code><a href="#widl-SourceBuffer-textTracks">textTracks</a></code>.
       
  1736             </li>
       
  1737             <li><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks">textTracks</a></code> attribute on the
       
  1738               HTMLMediaElement.
       
  1739             </li>
       
  1740           </ol>
       
  1741         </dd><dt id="widl-TextTrack-language"><code>language</code> of type <span class="idlAttrType"><a>DOMString</a></span></dt><dd>
       
  1742           <p>Allows the web application to get and update the track <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-texttrack-language">language</a></code>.</p>
       
  1743           <p>On getting, return the current value of the attribute. This is either the value provided when this object was created or the value provided on
       
  1744             the last successful set operation.</p><p>
       
  1745           </p><p>On setting, run the following steps:</p>
       
  1746           <ol>
       
  1747             <li>If the value being assigned to this attribute is not an valid <a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#text-track-language">text track language</a>, 
       
  1748               then abort these steps.</li>
       
  1749             <li>Update this attribute to the new value.</li>
       
  1750             <li>If the <code><a href="#widl-TextTrack-sourceBuffer">sourceBuffer</a></code> attribute on this track is not null, then
       
  1751               <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at
       
  1752               <code><a href="#widl-TextTrack-sourceBuffer">sourceBuffer</a></code>.<code><a href="#widl-SourceBuffer-textTracks">textTracks</a></code>.
       
  1753             </li>
       
  1754             <li><a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#handler-tracklist-onchange">change</a></code> at the <code><a href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks">textTracks</a></code> attribute on the
       
  1755               HTMLMediaElement.
       
  1756             </li>
       
  1757           </ol>
       
  1758         </dd><dt id="widl-TextTrack-sourceBuffer"><code>sourceBuffer</code> of type <span class="idlAttrType"><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></span>, readonly, nullable</dt><dd>
       
  1759           <p>Returns the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> that created this track. Returns null if this track was not created by a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> or the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> has been removed from the <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> attribute of its <a href="#parent-media-source">parent media source</a>.</p>
       
  1760         </dd></dl></section></section>
       
  1761 
  1649     <section id="byte-stream-formats">
  1762     <section id="byte-stream-formats">
  1650       <!--OddPage--><h2><span class="secno">8. </span>Byte Stream Formats</h2>
  1763       <!--OddPage--><h2><span class="secno">11. </span>Byte Stream Formats</h2>
  1651       <p>The bytes provided through <code><a href="#widl-SourceBuffer-appendArrayBuffer-void-ArrayBuffer-data">appendArrayBuffer()</a></code> and <code><a href="#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-maxSize">appendStream()</a></code> for a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> form a logical byte stream. The format of this byte stream depends on the media container format in use and is defined in a byte stream format specification. Byte stream format specifications based on WebM , the ISO Base Media File Format, and MPEG-2 Transport Streams are provided below. These format specifications are intended to be the authoritative source for how data from these containers is formatted and passed to a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>. If a <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a> implementation claims to support any of these container formats, then it must implement the corresponding byte stream format specification described below.</p>
  1764       <p>The bytes provided through <code><a href="#widl-SourceBuffer-appendArrayBuffer-void-ArrayBuffer-data">appendArrayBuffer()</a></code> and <code><a href="#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-maxSize">appendStream()</a></code> for a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> form a logical byte stream. The format of this byte stream depends on the media container format in use and is defined in a byte stream format specification. Byte stream format specifications based on WebM , the ISO Base Media File Format, and MPEG-2 Transport Streams are provided below. These format specifications are intended to be the authoritative source for how data from these containers is formatted and passed to a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>. If a <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a> implementation claims to support any of these container formats, then it must implement the corresponding byte stream format specification described below.</p>
  1652       <p>This section provides general requirements for all byte stream formats:</p>
  1765       <p>This section provides general requirements for all byte stream formats:</p>
  1653       <ul>
  1766       <ul>
  1654         <li>A byte stream format specification must define <a href="#init-segment">initialization segments</a> and <a href="#media-segment">media segments</a>.</li>
  1767         <li>A byte stream format specification must define <a href="#init-segment">initialization segments</a> and <a href="#media-segment">media segments</a>.</li>
  1655         <li>It must be possible to identify segment boundaries and segment type (initialization or media) by examining the byte stream alone.</li>
  1768         <li>It must be possible to identify segment boundaries and segment type (initialization or media) by examining the byte stream alone.</li>
  1704         </li>
  1817         </li>
  1705       </ul>
  1818       </ul>
  1706       <p>Byte stream specifications must at a minimum define constraints which ensure that the above requirements hold. Additional constraints may be defined, for example to simplify implementation.</p>
  1819       <p>Byte stream specifications must at a minimum define constraints which ensure that the above requirements hold. Additional constraints may be defined, for example to simplify implementation.</p>
  1707 
  1820 
  1708       <section id="webm" class="nonnormative">
  1821       <section id="webm" class="nonnormative">
  1709         <h3><span class="secno">8.1 </span>WebM Byte Streams</h3>
  1822         <h3><span class="secno">11.1 </span>WebM Byte Streams</h3>
  1710         <p>This section defines segment formats for implementations that choose to support WebM.</p>
  1823         <p>This section defines segment formats for implementations that choose to support WebM.</p>
  1711 
  1824 
  1712         <section id="webm-init-segments">
  1825         <section id="webm-init-segments">
  1713           <h4><span class="secno">8.1.1 </span>Initialization Segments</h4>
  1826           <h4><span class="secno">11.1.1 </span>Initialization Segments</h4>
  1714           <p>A WebM <a href="#init-segment">initialization segment</a> must contain a subset of the elements at the start of a typical WebM file.</p>
  1827           <p>A WebM <a href="#init-segment">initialization segment</a> must contain a subset of the elements at the start of a typical WebM file.</p>
  1715           <p>The following rules apply to WebM initialization segments:</p>
  1828           <p>The following rules apply to WebM initialization segments:</p>
  1716           <ol>
  1829           <ol>
  1717 	    <li>The <a href="#init-segment">initialization segment</a> must start with an <a href="http://www.webmproject.org/code/specs/container/#ebml-basics">EBML Header</a> element, followed by a <a href="http://www.webmproject.org/code/specs/container/#segment">Segment</a> header.</li>
  1830 	    <li>The <a href="#init-segment">initialization segment</a> must start with an <a href="http://www.webmproject.org/code/specs/container/#ebml-basics">EBML Header</a> element, followed by a <a href="http://www.webmproject.org/code/specs/container/#segment">Segment</a> header.</li>
  1718 	    <li>The size value in the <a href="http://www.webmproject.org/code/specs/container/#segment">Segment</a> header must signal an "unknown size" or contain a value large enough to include the <a href="http://www.webmproject.org/code/specs/container/#segment-information">Segment Information</a> and <a href="http://www.webmproject.org/code/specs/container/#track">Tracks</a> elements that follow.</li>
  1831 	    <li>The size value in the <a href="http://www.webmproject.org/code/specs/container/#segment">Segment</a> header must signal an "unknown size" or contain a value large enough to include the <a href="http://www.webmproject.org/code/specs/container/#segment-information">Segment Information</a> and <a href="http://www.webmproject.org/code/specs/container/#track">Tracks</a> elements that follow.</li>
  1720 	    <li>Any elements other than an <a href="http://www.webmproject.org/code/specs/container/#ebml-basics">EBML Header</a> or a <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> that occur before, in between, or after the <a href="http://www.webmproject.org/code/specs/container/#segment-information">Segment Information</a> and <a href="http://www.webmproject.org/code/specs/container/#track">Tracks</a> elements are ignored.</li>
  1833 	    <li>Any elements other than an <a href="http://www.webmproject.org/code/specs/container/#ebml-basics">EBML Header</a> or a <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> that occur before, in between, or after the <a href="http://www.webmproject.org/code/specs/container/#segment-information">Segment Information</a> and <a href="http://www.webmproject.org/code/specs/container/#track">Tracks</a> elements are ignored.</li>
  1721           </ol>
  1834           </ol>
  1722         </section>
  1835         </section>
  1723 
  1836 
  1724         <section id="webm-media-segments">
  1837         <section id="webm-media-segments">
  1725           <h4><span class="secno">8.1.2 </span>Media Segments</h4>
  1838           <h4><span class="secno">11.1.2 </span>Media Segments</h4>
  1726           <p>A WebM <a href="#media-segment">media segment</a> is a single <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> element.</p>
  1839           <p>A WebM <a href="#media-segment">media segment</a> is a single <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> element.</p>
  1727           <p>The following rules apply to WebM media segments:</p>
  1840           <p>The following rules apply to WebM media segments:</p>
  1728           <ol>
  1841           <ol>
  1729 	    <li>The Timecode element in the <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> contains a presentation timestamp in TimecodeScale units.</li>
  1842 	    <li>The Timecode element in the <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> contains a presentation timestamp in TimecodeScale units.</li>
  1730 	    <li>The TimecodeScale in the <a href="#webm-init-segments">WebM initialization segment</a> most recently appended applies to all timestamps in the <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a>
  1843 	    <li>The TimecodeScale in the <a href="#webm-init-segments">WebM initialization segment</a> most recently appended applies to all timestamps in the <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a>
  1736               <a href="http://www.webmproject.org/code/specs/container/#cueing-data">Cues</a> or <a href="http://www.webmproject.org/code/specs/container/#chapters">Chapters</a> elements may follow a <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> element. These elements must be accepted and ignored by the user agent.</li>
  1849               <a href="http://www.webmproject.org/code/specs/container/#cueing-data">Cues</a> or <a href="http://www.webmproject.org/code/specs/container/#chapters">Chapters</a> elements may follow a <a href="http://www.webmproject.org/code/specs/container/#cluster">Cluster</a> element. These elements must be accepted and ignored by the user agent.</li>
  1737           </ol>
  1850           </ol>
  1738         </section>
  1851         </section>
  1739 
  1852 
  1740         <section id="webm-random-access-points">
  1853         <section id="webm-random-access-points">
  1741           <h4><span class="secno">8.1.3 </span>Random Access Points</h4>
  1854           <h4><span class="secno">11.1.3 </span>Random Access Points</h4>
  1742           <p>A SimpleBlock element with its Keyframe flag set signals the location of a <a href="#random-access-point">random access point</a> for that track. Media segments containing multiple tracks are only considered a random access point if the first SimpleBlock for each track has its Keyframe flag set. The order of the multiplexed blocks must conform to the <a href="http://www.webmproject.org/code/specs/container/#muxer-guidelines">WebM Muxer Guidelines</a>.</p>
  1855           <p>A SimpleBlock element with its Keyframe flag set signals the location of a <a href="#random-access-point">random access point</a> for that track. Media segments containing multiple tracks are only considered a random access point if the first SimpleBlock for each track has its Keyframe flag set. The order of the multiplexed blocks must conform to the <a href="http://www.webmproject.org/code/specs/container/#muxer-guidelines">WebM Muxer Guidelines</a>.</p>
  1743         </section>
  1856         </section>
  1744       </section>
  1857       </section>
  1745       
  1858       
  1746       <section id="iso" class="nonnormative">
  1859       <section id="iso" class="nonnormative">
  1747         <h3><span class="secno">8.2 </span>ISO Base Media File Format Byte Streams</h3>
  1860         <h3><span class="secno">11.2 </span>ISO Base Media File Format Byte Streams</h3>
  1748         <p>This section defines segment formats for implementations that choose to support the ISO Base Media File Format
  1861         <p>This section defines segment formats for implementations that choose to support the ISO Base Media File Format
  1749 	  <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c061988_ISO_IEC_14496-12_2012.zip">ISO/IEC 14496-12</a> (ISO BMFF).</p> 
  1862 	  <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c061988_ISO_IEC_14496-12_2012.zip">ISO/IEC 14496-12</a> (ISO BMFF).</p> 
  1750           <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>
  1863           <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>
  1751 
  1864 
  1752 	<section id="iso-init-segments">
  1865 	<section id="iso-init-segments">
  1753           <h4><span class="secno">8.2.1 </span>Initialization Segments</h4>
  1866           <h4><span class="secno">11.2.1 </span>Initialization Segments</h4>
  1754           <p>An ISO BMFF <a href="#init-segment">initialization segment</a> must contain a single Movie Header Box (<span class="iso-box">moov</span>). The tracks in the Movie Header Box must not contain any samples (i.e. the <span class="iso-var">entry_count</span> in the <span class="iso-box">stts</span>, <span class="iso-box">stsc</span> and <span class="iso-box">stco</span> boxes must be set to zero). A Movie Extends (<span class="iso-box">mvex</span>) box must be contained in the
  1867           <p>An ISO BMFF <a href="#init-segment">initialization segment</a> must contain a single Movie Header Box (<span class="iso-box">moov</span>). The tracks in the Movie Header Box must not contain any samples (i.e. the <span class="iso-var">entry_count</span> in the <span class="iso-box">stts</span>, <span class="iso-box">stsc</span> and <span class="iso-box">stco</span> boxes must be set to zero). A Movie Extends (<span class="iso-box">mvex</span>) box must be contained in the
  1755 	    Movie Header Box to indicate that Movie Fragments are to be expected.</p>
  1868 	    Movie Header Box to indicate that Movie Fragments are to be expected.</p>
  1756           <p>The <a href="#init-segment">initialization segment</a> may contain Edit Boxes (<span class="iso-box">edts</span>) which provide a mapping of composition times for each track to the global presentation time.</p>
  1869           <p>The <a href="#init-segment">initialization segment</a> may contain Edit Boxes (<span class="iso-box">edts</span>) which provide a mapping of composition times for each track to the global presentation time.</p>
  1757 	</section>
  1870 	</section>
  1758         
  1871         
  1759 	<section id="iso-media-segments">
  1872 	<section id="iso-media-segments">
  1760           <h4><span class="secno">8.2.2 </span>Media Segments</h4>
  1873           <h4><span class="secno">11.2.2 </span>Media Segments</h4>
  1761           <p>An ISO BMFF <a href="#media-segment">media segment</a> must contain a single Movie Fragment Box (<span class="iso-box">moof</span>) followed by one or more Media Data Boxes (<span class="iso-box">mdat</span>).</p>
  1874           <p>An ISO BMFF <a href="#media-segment">media segment</a> must contain a single Movie Fragment Box (<span class="iso-box">moof</span>) followed by one or more Media Data Boxes (<span class="iso-box">mdat</span>).</p>
  1762           <p>The following rules apply to ISO BMFF media segments:</p>
  1875           <p>The following rules apply to ISO BMFF media segments:</p>
  1763           <ol>
  1876           <ol>
  1764 	    <li>The Movie Fragment Box must contain at least one Track Fragment Box (<span class="iso-box">traf</span>).</li>
  1877 	    <li>The Movie Fragment Box must contain at least one Track Fragment Box (<span class="iso-box">traf</span>).</li>
  1765 	    <li>The Movie Fragment Box must use movie-fragment relative addressing and the flag <span class="iso-var">default-base-is-moof</span> must be set; absolute byte-offsets must not be used.</li>
  1878 	    <li>The Movie Fragment Box must use movie-fragment relative addressing and the flag <span class="iso-var">default-base-is-moof</span> must be set; absolute byte-offsets must not be used.</li>
  1770 	    <li>The Media Data Boxes must contain all the samples referenced by the Track Fragment Run Boxes (<span class="iso-box">trun</span>) of the Movie Fragment Box.</li>
  1883 	    <li>The Media Data Boxes must contain all the samples referenced by the Track Fragment Run Boxes (<span class="iso-box">trun</span>) of the Movie Fragment Box.</li>
  1771           </ol>
  1884           </ol>
  1772 	</section>
  1885 	</section>
  1773 
  1886 
  1774 	<section id="iso-random-access-points">
  1887 	<section id="iso-random-access-points">
  1775           <h4><span class="secno">8.2.3 </span>Random Access Points</h4>
  1888           <h4><span class="secno">11.2.3 </span>Random Access Points</h4>
  1776           <p>A <a href="#random-access-point">random access point</a> as defined in this specification corresponds to a Stream Access Point of type 1 or 2 as defined in Annex I of <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c061988_ISO_IEC_14496-12_2012.zip">ISO/IEC 14496-12</a>.</p>
  1889           <p>A <a href="#random-access-point">random access point</a> as defined in this specification corresponds to a Stream Access Point of type 1 or 2 as defined in Annex I of <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c061988_ISO_IEC_14496-12_2012.zip">ISO/IEC 14496-12</a>.</p>
  1777 	</section>
  1890 	</section>
  1778       </section>
  1891       </section>
  1779 
  1892 
  1780       <section id="mpeg2ts" class="nonnormative">
  1893       <section id="mpeg2ts" class="nonnormative">
  1781         <h3><span class="secno">8.3 </span>MPEG-2 Transport Stream Byte Streams</h3>
  1894         <h3><span class="secno">11.3 </span>MPEG-2 Transport Stream Byte Streams</h3>
  1782         <p>This section defines segment formats for implementations that choose to support MPEG-2 Transport Streams
  1895         <p>This section defines segment formats for implementations that choose to support MPEG-2 Transport Streams
  1783           (MPEG-2 TS) specified in <a href="http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=44169">ISO/IEC 13818-1</a>.</p>
  1896           (MPEG-2 TS) specified in <a href="http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=44169">ISO/IEC 13818-1</a>.</p>
  1784         
  1897         
  1785         <section id="mpeg2ts-general">
  1898         <section id="mpeg2ts-general">
  1786           <h4><span class="secno">8.3.1 </span>General</h4>
  1899           <h4><span class="secno">11.3.1 </span>General</h4>
  1787           <p>MPEG-2 TS media and initialization segments must conform to the MPEG-2 TS Adaptive Profile (ISO/IEC 13818-1:2012 Amd. 2).</p>
  1900           <p>MPEG-2 TS media and initialization segments must conform to the MPEG-2 TS Adaptive Profile (ISO/IEC 13818-1:2012 Amd. 2).</p>
  1788           <p>The following rules must apply to all MPEG-2 TS segments:</p>
  1901           <p>The following rules must apply to all MPEG-2 TS segments:</p>
  1789           <ol>
  1902           <ol>
  1790             <li>Segments must contain complete MPEG-2 TS packets.</li>
  1903             <li>Segments must contain complete MPEG-2 TS packets.</li>
  1791             <li>Segments must contain only complete PES packets and sections.</li>
  1904             <li>Segments must contain only complete PES packets and sections.</li>
  1792             <li>Segments must contain exactly one program.</li>
  1905             <li>Segments must contain exactly one program.</li>
  1793             <li>All MPEG-2 TS packets must have the transport_error_indicator set to 0</li>
  1906             <li>All MPEG-2 TS packets must have the transport_error_indicator set to 0</li>
  1794           </ol>
  1907           </ol>
  1795         </section>
  1908         </section>
  1796         <section id="mpeg2ts-init-segments">
  1909         <section id="mpeg2ts-init-segments">
  1797           <h4><span class="secno">8.3.2 </span>Initialization Segments</h4>
  1910           <h4><span class="secno">11.3.2 </span>Initialization Segments</h4>
  1798           <p>An MPEG-2 TS initialization segment must contain a single PAT and a single PMT. Other SI, such as CAT, that are invariant for all subsequent
  1911           <p>An MPEG-2 TS initialization segment must contain a single PAT and a single PMT. Other SI, such as CAT, that are invariant for all subsequent
  1799             media segments, may be present.</p>
  1912             media segments, may be present.</p>
  1800         </section>
  1913         </section>
  1801   
  1914   
  1802         <section id="mpeg2ts-media-segments">
  1915         <section id="mpeg2ts-media-segments">
  1803           <h4><span class="secno">8.3.3 </span>Media Segments</h4>
  1916           <h4><span class="secno">11.3.3 </span>Media Segments</h4>
  1804           <p>The following rules apply to all MPEG-2 TS media segments:</p>
  1917           <p>The following rules apply to all MPEG-2 TS media segments:</p>
  1805           <ol>
  1918           <ol>
  1806             <li>PSI that is identical to the information in the initialization segment may appear repeatedly throughout the segment.</li>
  1919             <li>PSI that is identical to the information in the initialization segment may appear repeatedly throughout the segment.</li>
  1807             <li>The media segment will not rely on initialization information in another media segment.</li>
  1920             <li>The media segment will not rely on initialization information in another media segment.</li>
  1808             <li>Media Segments must contain only complete PES packets and sections.</li>
  1921             <li>Media Segments must contain only complete PES packets and sections.</li>
  1812             <li>The presentation duration of each media component within the Media Segment should be as close to equal as practical.</li>
  1925             <li>The presentation duration of each media component within the Media Segment should be as close to equal as practical.</li>
  1813           </ol>
  1926           </ol>
  1814         </section>
  1927         </section>
  1815 
  1928 
  1816         <section id="mpeg2ts-random-access-points">
  1929         <section id="mpeg2ts-random-access-points">
  1817           <h4><span class="secno">8.3.4 </span>Random Access Points</h4>
  1930           <h4><span class="secno">11.3.4 </span>Random Access Points</h4>
  1818           <p>A random access point as defined in this specification corresponds to Elementary Stream Random Access Point as defined in 
  1931           <p>A random access point as defined in this specification corresponds to Elementary Stream Random Access Point as defined in 
  1819             <a href="http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=44169">ISO/IEC 13818-1</a>.</p>
  1932             <a href="http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=44169">ISO/IEC 13818-1</a>.</p>
  1820         </section>
  1933         </section>
  1821         <section id="mpeg2ts-discontinuities">
  1934         <section id="mpeg2ts-discontinuities">
  1822           <h4><span class="secno">8.3.5 </span>Timestamp Rollover &amp; Discontinuities</h4>
  1935           <h4><span class="secno">11.3.5 </span>Timestamp Rollover &amp; Discontinuities</h4>
  1823           <p>Timestamp rollovers and discontinuities must be handled by the UA. The UA's MPEG-2 TS implementation must maintain an internal offset
  1936           <p>Timestamp rollovers and discontinuities must be handled by the UA. The UA's MPEG-2 TS implementation must maintain an internal offset
  1824           variable, <dfn id="mpeg2ts-timestampOffset">MPEG2TS_timestampOffset</dfn>, to keep track of the offset that needs to be applied to timestamps
  1937           variable, <dfn id="mpeg2ts-timestampOffset">MPEG2TS_timestampOffset</dfn>, to keep track of the offset that needs to be applied to timestamps
  1825           that have rolled over or are part of a discontinuity. <var>MPEG2TS_timestampOffset</var> is initially set to 0 when the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> is 
  1938           that have rolled over or are part of a discontinuity. <var>MPEG2TS_timestampOffset</var> is initially set to 0 when the <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> is 
  1826           created.  This offset must be applied to the timestamps as part of the conversion process from MPEG-2 TS packets
  1939           created.  This offset must be applied to the timestamps as part of the conversion process from MPEG-2 TS packets
  1827           into <a href="#coded-frame">coded frames</a> for the <a href="#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a>. This results in the coded frame timestamps 
  1940           into <a href="#coded-frame">coded frames</a> for the <a href="#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a>. This results in the coded frame timestamps 
  1842     </section>
  1955     </section>
  1843 
  1956 
  1844 
  1957 
  1845 
  1958 
  1846     <section id="examples">
  1959     <section id="examples">
  1847       <!--OddPage--><h2><span class="secno">9. </span>Examples</h2>
  1960       <!--OddPage--><h2><span class="secno">12. </span>Examples</h2>
  1848       <p>Example use of the Media Source Extensions</p>
  1961       <p>Example use of the Media Source Extensions</p>
  1849       <div class="block">
  1962       <div class="block">
  1850         <div class="blockContent">
  1963         <div class="blockContent">
  1851           <pre class="code">&lt;script&gt;
  1964           <pre class="code">&lt;script&gt;
  1852   function onSourceOpen(videoTag, e) {
  1965   function onSourceOpen(videoTag, e) {
  1932         </div>
  2045         </div>
  1933       </div>
  2046       </div>
  1934     </section>
  2047     </section>
  1935 
  2048 
  1936     <section id="revision-history">
  2049     <section id="revision-history">
  1937       <!--OddPage--><h2><span class="secno">10. </span>Revision History</h2>
  2050       <!--OddPage--><h2><span class="secno">13. </span>Revision History</h2>
  1938       <table class="old-table">
  2051       <table class="old-table">
  1939         <thead>
  2052         <thead>
  1940           <tr>
  2053           <tr>
  1941             <th>Version</th>
  2054             <th>Version</th>
  1942             <th>Comment</th>
  2055             <th>Comment</th>
  1943           </tr>
  2056           </tr>
  1944         </thead>
  2057         </thead>
  1945         <tbody>
  2058         <tbody>
  1946           <tr>
  2059           <tr>
  1947 	    <td>04 January 2013</td>
  2060 	    <td>15 January 2013</td>
       
  2061             <td>Replace setTrackInfo() and getSourceBuffer() with AudioTrack, VideoTrack, and TextTrack extensions.</td>
       
  2062           </tr>
       
  2063           <tr>
       
  2064 	    <td><a href="http://dvcs.w3.org/hg/html-media/raw-file/52a85235137b/media-source/media-source.html">04 January 2013</a></td>
  1948             <td>
  2065             <td>
  1949               <ul>
  2066               <ul>
  1950                 <li>Renamed append() to appendArrayBuffer() and made appending asynchronous.</li>
  2067                 <li>Renamed append() to appendArrayBuffer() and made appending asynchronous.</li>
  1951                 <li>Added SourceBuffer.appendStream().</li>
  2068                 <li>Added SourceBuffer.appendStream().</li>
  1952                 <li>Added SourceBuffer.setTrackInfo() methods.</li>
  2069                 <li>Added SourceBuffer.setTrackInfo() methods.</li>
  2102         </tbody>
  2219         </tbody>
  2103       </table>
  2220       </table>
  2104     </section>
  2221     </section>
  2105   
  2222   
  2106 
  2223 
  2107 </body></html>
  2224 <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> 
       
  2225 </dd></dl></section></section></body></html>