Permalink
Browse files

[giow] (0) Rework MediaController so that it exposes more events so t…

…hat you can keep track of the overall state.

git-svn-id: http://svn.whatwg.org/webapps@6018 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent 8518770 commit ef33adaf6f75e65b62dce7e5e44bf5a6d19e46b6 @Hixie Hixie committed Apr 20, 2011
Showing with 1,380 additions and 845 deletions.
  1. +427 −263 complete.html
  2. +427 −263 index
  3. +526 −319 source
View
690 complete.html
@@ -239,7 +239,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
- <h2 class="no-num no-toc">Living Standard &mdash; Last Updated 15 April 2011</h2>
+ <h2 class="no-num no-toc">Living Standard &mdash; Last Updated 20 April 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -26471,7 +26471,11 @@ <h5 id=loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the
<code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, then
run these substeps:</p>
- <ol><li><p>If a fetching process is in progress for the <a href=#media-element>media
+ <ol><li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-media-emptied><a href=#event-media-emptied>emptied</a></code> at the <a href=#media-element>media
+ element</a>.</li>
+
+ <li><p>If a fetching process is in progress for the <a href=#media-element>media
element</a>, the user agent should stop it.</li>
<li><p>Set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
@@ -26484,7 +26488,9 @@ <h5 id=loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the
<li><p>If <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is
not set to <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, then set it
- to that state.</li>
+ to that state.
+ <!-- this can do the "report the controller state" thing -->
+ </li>
<li><p>If the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>
attribute is false, then set it to true.</li>
@@ -26520,10 +26526,6 @@ <h5 id=loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the
</li>
- <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-emptied><a href=#event-media-emptied>emptied</a></code> at the <a href=#media-element>media
- element</a>.</li>
-
</ol></li>
<li><p>Set the <code title=dom-media-playbackRate><a href=#dom-media-playbackrate>playbackRate</a></code> attribute to the
@@ -26968,21 +26970,20 @@ <h5 id=loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the
</li>
- <li><p>Set the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to
- <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>.</li>
-
<li><p>For <code><a href=#video>video</a></code> elements, set the <code title=dom-video-videoWidth><a href=#dom-video-videowidth>videoWidth</a></code> and <code title=dom-video-videoHeight><a href=#dom-video-videoheight>videoHeight</a></code>
attributes.</li>
- <li id=fire-loadedmetadata>
+ <li>
- <p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> at the
- element.</p>
+ <p>Set the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to
+ <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>.</p>
+
+ <p class=note>A <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> DOM
+ event <a href=#fire-loadedmetadata>will be fired</a> as part
+ of setting the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to a
+ new value.</p>
- <p class=note>Before this task is run, as part of the event
- loop mechanism, the rendering will have been updated to resize
- the <code><a href=#video>video</a></code> element if appropriate.</p>
+ <!-- this can also do the "report the controller state" thing -->
</li>
@@ -27003,34 +27004,17 @@ <h5 id=loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the
</li>
<!--CONTROLLER-->
- <li>
-
- <p>If either the <a href=#media-resource>media resource</a> or the address of
- the <var title="">current media resource</var> indicate a
- particular set of audio or video tracks to enable, then the
- selected audio tracks must be enabled in the element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> object, and
- the first selected video track must be selected in the
- element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> object.</p>
-
- </li>
-
- <li>
-
- <p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current
- media controller</a>, then: if the <a href=#initial-playback-position>initial playback
- position</a>, relative to the <a href=#current-media-controller>current media
- controller</a>'s timeline, is greater than the
- <a href=#current-media-controller>current media controller</a>'s <a href=#media-controller-position>media controller
- position</a>, then <a href=#seek-the-media-controller>seek the media controller</a>
- to the <a href=#media-element>media element</a>'s <a href=#initial-playback-position>initial playback
- position</a>, relative to the <a href=#current-media-controller>current media
- controller</a>'s timeline; otherwise, <a href=#dom-media-seek title=dom-media-seek>seek</a> the <a href=#media-element>media
- element</a> to the <a href=#media-controller-position>media controller position</a>,
- relative to the <a href=#media-element>media element</a>'s timeline,
- discarding any resulting exceptions.</p> <!-- i.e. "bring the
- media element up to speed with its new media controller" -->
-
- </li>
+ <li><p>If either the <a href=#media-resource>media resource</a> or the address
+ of the <var title="">current media resource</var> indicate a
+ particular set of audio or video tracks to enable, then the
+ selected audio tracks must be enabled in the element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> object, and
+ the first selected video track must be selected in the
+ element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code>
+ object.</li>
+
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current
+ media controller</a>, then <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up
+ to speed with its new media controller</a>.</p>
<!--CONTROLLER-->
<li>
@@ -27693,99 +27677,128 @@ <h5 id=the-ready-states><span class=secno>4.8.10.7 </span>The ready states</h5>
<p>When the ready state of a <a href=#media-element>media element</a> whose <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> is not <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code> changes, the
user agent must follow the steps given below:</p>
- <dl class=switch><!-- going up to metadata --><dt>If the previous ready state was <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, and the new
- ready state is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code></dt>
+ <ol><li>
- <dd>
+ <p>Apply the first applicable set of substeps from the following
+ list:</p>
- <p class=note>A <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> DOM event <a href=#fire-loadedmetadata>will be fired</a> as part of the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm.</p>
- </dd>
+ <dl class=switch><!-- going up to metadata --><dt>If the previous ready state was <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, and the new
+ ready state is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code></dt>
- <!-- going up to current for the first time -->
+ <dd id=fire-loadedmetadata>
- <dt id=handling-first-frame-available>If the previous ready state
- was <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> and
- the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- greater</dt>
+ <p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> at the
+ element.</p>
- <dd>
+ <p class=note>Before this task is run, as part of the event
+ loop mechanism, the rendering will have been updated to resize
+ the <code><a href=#video>video</a></code> element if appropriate.</p>
- <p id=fire-loadeddata>If this is the first time this occurs for
- this <a href=#media-element>media element</a> since the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm was last invoked,
- the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-media-loadeddata><a href=#event-media-loadeddata>loadeddata</a></code> at the element.</p>
+ </dd>
- <p>If the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or
- <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code>,
- then the relevant steps below must then be run also.</p>
+ <!-- going up to current for the first time -->
- </dd>
+ <dt id=handling-first-frame-available>If the previous ready state
+ was <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> and
+ the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ greater</dt>
- <!-- going down -->
- <dt>If the previous ready state was <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or more,
- and the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- less</dt>
+ <dd>
- <dd>
+ <p id=fire-loadeddata>If this is the first time this occurs for
+ this <a href=#media-element>media element</a> since the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm was last invoked,
+ the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-loadeddata><a href=#event-media-loadeddata>loadeddata</a></code> at the element.</p>
- <p class=note>A <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> DOM
- event <a href=#fire-waiting-when-waiting>can be fired</a>,
- depending on the current state of playback.</p>
+ <p>If the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or
+ <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code>,
+ then the relevant steps below must then be run also.</p>
- </dd>
+ </dd>
- <!-- going up to future -->
- <dt>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- less, and the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code></dt>
+ <!-- going down -->
+ <dt>If the previous ready state was <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or more,
+ and the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ less</dt>
- <dd>
+ <dd>
- <p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>.</p>
+ <p id=fire-waiting-when-waiting>If the <a href=#media-element>media
+ element</a> was <a href=#potentially-playing>potentially playing</a> before its
+ <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
+ changed to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, and
+ the element has not <a href=#ended-playback>ended playback</a>, and playback
+ has not <a href=#stopped-due-to-errors>stopped due to errors</a>, and playback has not
+ <a href=#paused-for-user-interaction>paused for user interaction</a>, the user agent must
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at
+ the element, and <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> at the element.</p>
- <p>If the element's <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>
- attribute is false, the user agent must <a href=#queue-a-task>queue a task</a>
- to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+ </dd>
- </dd>
+ <!-- going up to future -->
+ <dt>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ less, and the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code></dt>
- <!-- going up to enough -->
- <dt>If the new ready state is <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code></dt>
+ <dd>
- <dd>
+ <p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>.</p>
+
+ <p>If the element's <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>
+ attribute is false, the user agent must <a href=#queue-a-task>queue a task</a>
+ to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+
+ </dd>
- <p>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- less, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
- a simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>, and, if the element's
- <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is false,
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
- named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+ <!-- going up to enough -->
+ <dt>If the new ready state is <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code></dt>
- <p>If the <a href=#autoplaying-flag>autoplaying flag</a> is true, and the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is true, and the
- <a href=#media-element>media element</a> has an <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute specified,
- and the <a href=#media-element>media element</a>'s <code><a href=#document>Document</a></code>'s
- <a href=#browsing-context>browsing context</a> did not have the <a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed
- automatic features browsing context flag</a> set when the
- <code><a href=#document>Document</a></code> was created, then the user agent may also
- set the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute to
- false, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-play><a href=#event-media-play>play</a></code>, and
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
- named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+ <dd>
- <p class=note>User agents do not need to support autoplay,
- and it is suggested that user agents honor user preferences on the
- matter. Authors are urged to use the <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute rather than
- using script to force the video to play, so as to allow the user
- to override the behavior if so desired.</p>
+ <p>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ less, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
+ a simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>, and, if the element's
+ <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is false,
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+
+ <p>If the <a href=#autoplaying-flag>autoplaying flag</a> is true, and the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is true, and the
+ <a href=#media-element>media element</a> has an <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute specified,
+ and the <a href=#media-element>media element</a>'s <code><a href=#document>Document</a></code>'s
+ <a href=#browsing-context>browsing context</a> did not have the <a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed
+ automatic features browsing context flag</a> set when the
+ <code><a href=#document>Document</a></code> was created, then the user agent may also
+ set the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute to
+ false, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-media-play><a href=#event-media-play>play</a></code>, and
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
- <p>In any case, the user agent must finally <a href=#queue-a-task>queue a
- task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-canplaythrough><a href=#event-media-canplaythrough>canplaythrough</a></code>.</p>
+ <p class=note>User agents do not need to support autoplay,
+ and it is suggested that user agents honor user preferences on the
+ matter. Authors are urged to use the <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute rather than
+ using script to force the video to play, so as to allow the user
+ to override the behavior if so desired.</p>
- </dd>
+ <p>In any case, the user agent must finally <a href=#queue-a-task>queue a
+ task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-canplaythrough><a href=#event-media-canplaythrough>canplaythrough</a></code>.</p>
- </dl></div>
+ </dd>
+
+ </dl></li>
+
+<!--CONTROLLER-->
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a>, then <a href=#report-the-controller-state>report the controller state</a>
+ for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current media
+ controller</a>.</li>
+<!--CONTROLLER-->
+
+ </ol></div>
<p class=note>It is possible for the ready state of a media
element to jump between these states discontinuously. For example,
@@ -27994,7 +28007,19 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the
<code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code> and
the user agent has reached a point in the <a href=#media-resource>media
resource</a> where the user has to make a selection for the
- resource to continue.</p>
+ resource to continue.
+<!--CONTROLLER-->
+ If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a> when this happens, then the user agent must
+ <a href=#report-the-controller-state>report the controller state</a> for the <a href=#media-element>media
+ element</a>'s <a href=#current-media-controller>current media controller</a>. If If the
+ <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a> when the user makes a selection, allowing playback
+ to resume, the user agent must similarly <a href=#report-the-controller-state>report the controller
+ state</a> for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current
+ media controller</a>.
+<!--CONTROLLER-->
+ </p>
<p>It is possible for a <a href=#media-element>media element</a> to have both
<a href=#ended-playback>ended playback</a> and <a href=#paused-for-user-interaction>paused for user
@@ -28005,18 +28030,11 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the
interaction</a>, the user agent must <a href=#queue-a-task>queue a task</a> to
<a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the element.</p>
- <p id=fire-waiting-when-waiting>When a <a href=#media-element>media element</a>
- that is <a href=#potentially-playing>potentially playing</a> stops playing because its
- <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
- changes to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, without
- the element having <a href=#ended-playback>ended playback</a>, or playback having
- <a href=#stopped-due-to-errors>stopped due to errors</a>, or playback having <a href=#paused-for-user-interaction>paused
- for user interaction</a>, or the <a href=#dom-media-seek title=dom-media-seek>seeking algorithm</a> being invoked, the
- user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code>
- at the element, and <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> at
- the element.</p>
+ <p class=note>A <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code>
+ DOM event <a href=#fire-waiting-when-waiting>can be fired</a> as a
+ result of an element that is <a href=#potentially-playing>potentially playing</a>
+ stopping playback due to its <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute changing to
+ a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>.</p>
<p>When the <a href=#current-playback-position>current playback position</a> reaches the end
of the <a href=#media-resource>media resource</a> when the <a href=#direction-of-playback>direction of
@@ -28165,6 +28183,13 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the
<li><p>Set the <a href=#media-element>media element</a>'s <a href=#autoplaying-flag>autoplaying
flag</a> to false.</li>
+<!--CONTROLLER-->
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a>, then <a href=#report-the-controller-state>report the controller state</a>
+ for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current media
+ controller</a>.</li>
+<!--CONTROLLER-->
+
</ol><hr><p>When the <dfn id=dom-media-pause title=dom-media-pause><code>pause()</code></dfn>
method is invoked, and when the user agent is required to pause the
<a href=#media-element>media element</a>, the user agent must run the following
@@ -28193,6 +28218,13 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the
</ol></li>
+<!--CONTROLLER-->
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a>, then <a href=#report-the-controller-state>report the controller state</a>
+ for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current media
+ controller</a>.</li>
+<!--CONTROLLER-->
+
</ol><hr><p>The
<!--CONTROLLER-->
<dfn id=effective-playback-rate>effective playback rate</dfn> is not necessarily the element's
@@ -28493,29 +28525,32 @@ <h5 id=seeking><span class=secno>4.8.10.9 </span>Seeking</h5>
<code title=dom-media-seeking><a href=#dom-media-seeking>seeking</a></code> IDL attribute to
false and abort these steps.</li>
- <li><p>Set the <a href=#current-playback-position>current playback position</a> to the given
- <var title="">new playback position</var>.</li>
-
<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-media-seeking><a href=#event-media-seeking>seeking</a></code>
at the element.</li>
- <li id=seekUpdate><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
- element.</li>
+ <li>
- <li><p>If the <a href=#media-element>media element</a> was <a href=#potentially-playing>potentially
- playing</a> immediately before it started seeking, but seeking
- caused its <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code>
- attribute to change to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, then
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> at the
- element.</li>
+ <p>Set the <a href=#current-playback-position>current playback position</a> to the given
+ <var title="">new playback position</var>.</p>
+
+ <p class=note>If the <a href=#media-element>media element</a> was
+ <a href=#potentially-playing>potentially playing</a> immediately before it started
+ seeking, but seeking caused its <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to change
+ to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, then a
+ <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> <a href=#fire-waiting-when-waiting>will be fired</a> at the
+ element.</p> <!-- also, timeupdate -->
+ <!-- also, it will do the "report the controller state" thing -->
+
+ </li>
<li><p>Wait until the user agent has established whether or not the
<a href=#media-data>media data</a> for the <var title="">new playback
position</var> is available, and, if it is, until it has decoded
- enough data to play back that position.</li>
+ enough data to play back that position.</p>
+ <!-- at which point, it will do the "port the controller state"
+ thing again -->
+ </li>
<li><p><a href=#await-a-stable-state>Await a stable state</a>. The <a href=#synchronous-section>synchronous
section</a> consists of all the remaining steps of this
@@ -28525,6 +28560,10 @@ <h5 id=seeking><span class=secno>4.8.10.9 </span>Seeking</h5>
<li><p>&#8987; Set the <code title=dom-media-seeking><a href=#dom-media-seeking>seeking</a></code> IDL attribute to
false.</li>
+ <li id=seekUpdate><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
+ element.</li>
+
<li><p>&#8987; <a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-media-seeked><a href=#event-media-seeked>seeked</a></code>
at the element.</li>
@@ -28907,6 +28946,14 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
attribute double <a href=#dom-mediacontroller-volume title=dom-MediaController-volume>volume</a>;
attribute boolean <a href=#dom-mediacontroller-muted title=dom-MediaController-muted>muted</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onemptied title=handler-MediaController-onemptied>onemptied</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onloadedmetadata title=handler-MediaController-onloadedmetadata>onloadedmetadata</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onloadeddata title=handler-MediaController-onloadeddata>onloadeddata</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-oncanplay title=handler-MediaController-oncanplay>oncanplay</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-oncanplaythrough title=handler-MediaController-oncanplaythrough>oncanplaythrough</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onplaying title=handler-MediaController-onplaying>onplaying</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onwaiting title=handler-MediaController-onwaiting>onwaiting</a>;
+
attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-ondurationchange title=handler-MediaController-ondurationchange>ondurationchange</a>;
attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-ontimeupdate title=handler-MediaController-ontimeupdate>ontimeupdate</a>;
attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onplay title=handler-MediaController-onplay>onplay</a>;
@@ -29078,7 +29125,146 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
must use the same clock for their definition of their <a href=#media-timeline>media
timeline</a>'s unit time.</p>
- <p>The <a href=#media-resource title="media resource">media resources</a> of all
+ <hr><p>The <dfn id=dom-media-controller title=dom-media-controller><code>controller</code></dfn> attribute
+ on a <a href=#media-element>media element</a>, on getting, must return the
+ element's <a href=#current-media-controller>current media controller</a>, if any, or null
+ otherwise. On setting, it must first remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute, if any,
+ and then set the <a href=#current-media-controller>current media controller</a> to the given
+ value. If the given value is null, the element no longer has a
+ <a href=#current-media-controller>current media controller</a>; if it is not null, then the
+ user agent must <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up to speed with its
+ new media controller</a>.</p>
+
+ <hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
+ constructor, when invoked, must return a newly created
+ <code><a href=#mediacontroller>MediaController</a></code> object.</p>
+
+ <hr><p>The <dfn id=dom-mediacontroller-seekable title=dom-MediaController-seekable><code>seekable</code></dfn>
+ attribute must return a new static <a href=#normalized-timeranges-object>normalized
+ <code>TimeRanges</code> object</a> that represents the
+ intersection of the ranges of the <a href=#media-resource title="media resource">media
+ resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
+ user agent is able to seek to, at the time the attribute is
+ evaluated.</p>
+
+ <p>The <dfn id=dom-mediacontroller-buffered title=dom-MediaController-buffered><code>buffered</code></dfn>
+ attribute must return a new static <a href=#normalized-timeranges-object>normalized
+ <code>TimeRanges</code> object</a> that represents the
+ intersection of the ranges of the <a href=#media-resource title="media resource">media
+ resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
+ user agent has buffered, at the time the attribute is evaluated.
+ Users agents must accurately determine the ranges available, even
+ for media streams where this can only be determined by tedious
+ inspection.</p>
+
+ <p>The <dfn id=dom-mediacontroller-duration title=dom-MediaController-duration><code>duration</code></dfn>
+ attribute must return the <a href=#media-controller-duration>media controller
+ duration</a>.</p>
+
+ <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-duration>media controller duration</a> changes, whichever happens
+ least often, the user agent must <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code>
+ at the <code><a href=#mediacontroller>MediaController</a></code>. If the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-duration>media controller
+ duration</a> decreases such that the <a href=#media-controller-position>media controller
+ position</a> is greater than the <a href=#media-controller-duration>media controller
+ duration</a>, the user agent must immediately <a href=#seek-the-media-controller>seek the
+ media controller</a> to <a href=#media-controller-duration>media controller
+ duration</a>.</p>
+
+ <p>The <dfn id=dom-mediacontroller-currenttime title=dom-MediaController-currentTime><code>currentTime</code></dfn>
+ attribute must return the <a href=#media-controller-position>media controller position</a> on
+ getting, and on setting must <a href=#seek-the-media-controller>seek the media controller</a>
+ to the new value.</p>
+
+ <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-position>media controller position</a> changes, whichever happens
+ least often, the user agent must <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-timeupdate><a href=#event-mediacontroller-timeupdate>timeupdate</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>When a <code><a href=#mediacontroller>MediaController</a></code> is created it is a
+ <dfn id=playing-media-controller>playing media controller</dfn>. It can be changed into a
+ <dfn id=paused-media-controller>paused media controller</dfn> and back either via the user
+ agent's user interface (when the element is <a href=#expose-a-user-interface-to-the-user title="expose a
+ user interface to the user">exposing a user interface to the
+ user</a>) or by script using the APIs defined in this section
+ (see below).</p>
+
+ <p>The <dfn id=dom-mediacontroller-paused title=dom-MediaController-paused><code>paused</code></dfn>
+ attribute must return true if the <code><a href=#mediacontroller>MediaController</a></code>
+ object is a <a href=#paused-media-controller>paused media controller</a>, and false
+ otherwise.</p>
+
+ <p>When the <dfn id=dom-mediacontroller-pause title=dom-MediaController-pause><code>pause()</code></dfn> method
+ is invoked, if the <code><a href=#mediacontroller>MediaController</a></code> is a <a href=#playing-media-controller>playing
+ media controller</a> then the user agent must change the
+ <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#paused-media-controller>paused media
+ controller</a>, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-MediaController-pause><a href=#event-mediacontroller-pause>pause</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>, and then <a href=#report-the-controller-state>report the controller
+ state</a> of the <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <p>When the <dfn id=dom-mediacontroller-play title=dom-MediaController-play><code>play()</code></dfn> method is
+ invoked, if the <code><a href=#mediacontroller>MediaController</a></code> is a <a href=#paused-media-controller>paused media
+ controller</a>, the user agent must change the
+ <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#playing-media-controller>playing media
+ controller</a>, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-MediaController-play><a href=#event-mediacontroller-play>play</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>, and then <a href=#report-the-controller-state>report the controller
+ state</a> of the <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=media-controller-default-playback-rate>media controller
+ default playback rate</dfn> and a <dfn id=media-controller-playback-rate>media controller playback
+ rate</dfn>, which must both be set to 1.0 when the
+ <code><a href=#mediacontroller>MediaController</a></code> object is created.</p>
+
+ <p>The <dfn id=dom-mediacontroller-defaultplaybackrate title=dom-MediaController-defaultPlaybackRate><code>defaultPlaybackRate</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
+ playback rate</a>, and on setting, must set the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
+ playback rate</a> to the new value, then <a href=#queue-a-task>queue a
+ task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-ratechange><a href=#event-mediacontroller-ratechange>ratechange</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <p>The <dfn id=dom-mediacontroller-playbackrate title=dom-MediaController-playbackRate><code>playbackRate</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
+ rate</a>, and on setting, must set the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
+ rate</a> to the new value, then <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-ratechange><a href=#event-mediacontroller-ratechange>ratechange</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=media-controller-volume-multiplier>media controller volume
+ multiplier</dfn>, which must be set to 1.0 when the
+ <code><a href=#mediacontroller>MediaController</a></code> object is created, and a <dfn id=media-controller-mute-override>media
+ controller mute override</dfn>, much must initially be false.</p>
+
+ <p>The <dfn id=dom-mediacontroller-volume title=dom-MediaController-volume><code>volume</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-volume-multiplier>media controller volume
+ multiplier</a>, and on setting, if the new value is in the range
+ 0.0 to 1.0 inclusive, must set the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-volume-multiplier>media controller volume multiplier</a> to the new value and
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-MediaController-volumechange><a href=#event-mediacontroller-volumechange>volumechange</a></code>
+ at the <code><a href=#mediacontroller>MediaController</a></code>. If the new value is outside the
+ range 0.0 to 1.0 inclusive, then, on setting, an
+ <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised instead.</p>
+
+ <p>The <dfn id=dom-mediacontroller-muted title=dom-MediaController-muted><code>muted</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
+ override</a>, and on setting, must set the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
+ override</a> to the new value and <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-volumechange><a href=#event-mediacontroller-volumechange>volumechange</a></code> at
+ the <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>The <a href=#media-resource title="media resource">media resources</a> of all
the <a href=#slaved-media-elements>slaved media elements</a> of a
<code><a href=#mediacontroller>MediaController</a></code> have a defined temporal relationship
which provides relative offsets between the zero time of each such
@@ -29158,15 +29344,7 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
exceptions.</li> <!-- i.e. "bring the media element up to speed
with its new media controller" -->
- </ol><p>When a <code><a href=#mediacontroller>MediaController</a></code> is created it is a
- <dfn id=playing-media-controller>playing media controller</dfn>. It can be changed into a
- <dfn id=paused-media-controller>paused media controller</dfn> and back either via the user
- agent's user interface (when the element is <a href=#expose-a-user-interface-to-the-user title="expose a
- user interface to the user">exposing a user interface to the
- user</a>) or via the APIs defined in this section (see
- below).</p>
-
- <p>A <code><a href=#mediacontroller>MediaController</a></code> is a <dfn id=blocked-media-controller>blocked media
+ </ol><p>A <code><a href=#mediacontroller>MediaController</a></code> is a <dfn id=blocked-media-controller>blocked media
controller</dfn> if the <code><a href=#mediacontroller>MediaController</a></code> is a
<a href=#paused-media-controller>paused media controller</a>, or if any of its <a href=#slaved-media-elements>slaved
media elements</a> are <a href=#blocked-media-element title="blocked media
@@ -29183,14 +29361,6 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
the <a href=#media-resource>media resource</a> relative to the
<code><a href=#mediacontroller>MediaController</a></code>'s timeline.</p>
- <p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=media-controller-default-playback-rate>media controller
- default playback rate</dfn>, a <dfn id=media-controller-playback-rate>media controller playback
- rate</dfn>, and a <dfn id=media-controller-volume-multiplier>media controller volume multiplier</dfn>,
- which must all be set to 1.0 when the <code><a href=#mediacontroller>MediaController</a></code>
- object is created. A <code><a href=#mediacontroller>MediaController</a></code> also has a
- <dfn id=media-controller-mute-override>media controller mute override</dfn>, much must initially be
- false.</p>
-
<p id=controller-playback>When a <code><a href=#mediacontroller>MediaController</a></code> is
not a <a href=#blocked-media-controller>blocked media controller</a> and it has at least one
<a href=#slaved-media-elements title="slaved media elements">slaved media element</a>
@@ -29201,134 +29371,106 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
<code><a href=#mediacontroller>MediaController</a></code>'s timeline per unit time of the clock
used by its <a href=#slaved-media-elements>slaved media elements</a>.</p>
- <hr><p>The <dfn id=dom-media-controller title=dom-media-controller><code>controller</code></dfn> attribute
- on a <a href=#media-element>media element</a>, on getting, must return the
- element's <a href=#current-media-controller>current media controller</a>, if any, or null
- otherwise. On setting, it must first remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute, if any,
- and then set the <a href=#current-media-controller>current media controller</a> to the given
- value. If the given value is null, the element no longer has a
- <a href=#current-media-controller>current media controller</a>; if it is not null, then the
- user agent must <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up to speed with its
- new media controller</a>.</p>
+ <p>When the zero point on the timeline of a
+ <code><a href=#mediacontroller>MediaController</a></code> moves relative to the timelines of the
+ <a href=#slaved-media-elements>slaved media elements</a> by a time difference <var title="">&Delta;T</var>, the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-position>media controller position</a> must be decremented by <var title="">&Delta;T</var>.</p>
+
+ <p class=note>In some situations, e.g. when playing back a live
+ stream without buffering anything, the <a href=#media-controller-position>media controller
+ position</a> would increase motonically as described above at the
+ same rate as the <var title="">&Delta;T</var> described in the
+ previous paragraph decreases it, with the end result that for all
+ intents and purposes, the <a href=#media-controller-position>media controller position</a>
+ would appear to remain constant (probably with the value 0).</p>
+
+ <hr><p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=most-recently-reported-readiness-state>most recently reported
+ readiness state</dfn>, which is a number from 0 to 4 derived from
+ the numbers used for the <a href=#media-element>media element</a> <code title=attr-media-readyState>readyState</code> attribute, and a
+ <dfn id=most-recently-reported-playback-state>most recently reported playback state</dfn>, which is either
+ <i>playing</i> or <i>waiting</i>.</p>
+
+ <p>When a <code><a href=#mediacontroller>MediaController</a></code> is created, its <a href=#most-recently-reported-readiness-state>most
+ recently reported readiness state</a> must be set to 0, and its
+ <a href=#most-recently-reported-playback-state>most recently reported playback state</a> must be set to
+ <i>waiting</i>.</p>
+
+ <p>When a user agent is required to <dfn id=report-the-controller-state>report the controller
+ state</dfn> for a <code><a href=#mediacontroller>MediaController</a></code>, the user agent must
+ run the following steps:</p>
- <hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
- constructor, when invoked, must return a newly created
- <code><a href=#mediacontroller>MediaController</a></code> object.</p>
+ <ol><li>
- <hr><p>The <dfn id=dom-mediacontroller-seekable title=dom-MediaController-seekable><code>seekable</code></dfn>
- attribute must return a new static <a href=#normalized-timeranges-object>normalized
- <code>TimeRanges</code> object</a> that represents the
- intersection of the ranges of the <a href=#media-resource title="media resource">media
- resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
- user agent is able to seek to, at the time the attribute is
- evaluated.</p>
+ <p>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved media
+ elements</a>, let <var title="">new readiness state</var> be
+ 0.</p>
- <p>The <dfn id=dom-mediacontroller-buffered title=dom-MediaController-buffered><code>buffered</code></dfn>
- attribute must return a new static <a href=#normalized-timeranges-object>normalized
- <code>TimeRanges</code> object</a> that represents the
- intersection of the ranges of the <a href=#media-resource title="media resource">media
- resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
- user agent has buffered, at the time the attribute is evaluated.
- Users agents must accurately determine the ranges available, even
- for media streams where this can only be determined by tedious
- inspection.</p>
-
- <p>The <dfn id=dom-mediacontroller-duration title=dom-MediaController-duration><code>duration</code></dfn>
- attribute must return the <a href=#media-controller-duration>media controller
- duration</a>.</p>
+ <p>Otherwise, let it have the lowest value of the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> IDL attributes of
+ all of its <a href=#slaved-media-elements>slaved media elements</a>.</p>
- <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
- <a href=#media-controller-duration>media controller duration</a> changes, whichever happens
- least often, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ </li>
- <p>The <dfn id=dom-mediacontroller-currenttime title=dom-MediaController-currentTime><code>currentTime</code></dfn>
- attribute must return the <a href=#media-controller-position>media controller position</a> on
- getting, and on setting must <a href=#seek-the-media-controller>seek the media controller</a>
- to the new value.</p>
+ <li>
- <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
- <a href=#media-controller-position>media controller position</a> changes, whichever happens
- least often, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-timeupdate><a href=#event-mediacontroller-timeupdate>timeupdate</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <p>If the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-readiness-state>most recently
+ reported readiness state</a> is not equal to <var title="">new
+ readiness state</var> then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
+ a simple event</a> at the <code><a href=#mediacontroller>MediaController</a></code> object,
+ whose name is the event name corresponding to the value of <var title="">new readiness state</var> given in the table below:</p>
+ <!-- hopefully everyone will understand what this means -->
- <hr><p>The <dfn id=dom-mediacontroller-paused title=dom-MediaController-paused><code>paused</code></dfn>
- attribute must return true if the <code><a href=#mediacontroller>MediaController</a></code>
- object is a <a href=#paused-media-controller>paused media controller</a>, and false
- otherwise.</p>
+ <table><thead><tr><th>Value of <var title="">new readiness state</var>
+ <th>Event name
- <p>When the <dfn id=dom-mediacontroller-pause title=dom-MediaController-pause><code>pause()</code></dfn> method
- is invoked, the user agent must change the
- <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#paused-media-controller>paused media
- controller</a>.</p>
+ <tbody><tr><td> 0
+ <td> <code title=event-MediaController-emptied><a href=#event-mediacontroller-emptied>emptied</a></code>
- <p>Whenever the <code><a href=#mediacontroller>MediaController</a></code> changes from a
- <a href=#playing-media-controller>playing media controller</a> to a <a href=#paused-media-controller>paused media
- controller</a>, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-pause><a href=#event-mediacontroller-pause>pause</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <tr><td> 1
+ <td> <code title=event-MediaController-loadedmetadata><a href=#event-mediacontroller-loadedmetadata>loadedmetadata</a></code>
- <p>When the <dfn id=dom-mediacontroller-play title=dom-MediaController-play><code>play()</code></dfn> method
- is invoked, the user agent must change the
- <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#playing-media-controller>playing media
- controller</a>.</p>
+ <tr><td> 2
+ <td> <code title=event-MediaController-loadeddata><a href=#event-mediacontroller-loadeddata>loadeddata</a></code>
- <p>Whenever the <code><a href=#mediacontroller>MediaController</a></code> changes from a
- <a href=#paused-media-controller>paused media controller</a> to a <a href=#playing-media-controller>playing media
- controller</a>, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-play><a href=#event-mediacontroller-play>play</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <tr><td> 3
+ <td> <code title=event-MediaController-canplay><a href=#event-mediacontroller-canplay>canplay</a></code>
- <hr><p>The <dfn id=dom-mediacontroller-defaultplaybackrate title=dom-MediaController-defaultPlaybackRate><code>defaultPlaybackRate</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
- playback rate</a>, and on setting, must set the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
- playback rate</a> to the new value.</p>
+ <tr><td> 4
+ <td> <code title=event-MediaController-canplaythrough><a href=#event-mediacontroller-canplaythrough>canplaythrough</a></code>
- <p>The <dfn id=dom-mediacontroller-playbackrate title=dom-MediaController-playbackRate><code>playbackRate</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
- rate</a>, and on setting, must set the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
- rate</a> to the new value.</p>
+ </table></li>
- <p>Whenever the <a href=#media-controller-default-playback-rate>media controller default playback rate</a>
- or the <a href=#media-controller-playback-rate>media controller playback rate</a> are changed, the
- user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-MediaController-ratechange><a href=#event-mediacontroller-ratechange>ratechange</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <li><p>Let the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-readiness-state>most recently
+ reported readiness state</a> be <var title="">new readiness
+ state</var>.</li>
- <hr><p>The <dfn id=dom-mediacontroller-volume title=dom-MediaController-volume><code>volume</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-volume-multiplier>media controller volume
- multiplier</a>, and on setting, if the new value is in the range
- 0.0 to 1.0 inclusive, must set the <code><a href=#mediacontroller>MediaController</a></code>'s
- <a href=#media-controller-volume-multiplier>media controller volume multiplier</a> to the new value. If
- the new value is outside the range 0.0 to 1.0 inclusive, then, on
- setting, an <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised
- instead.</p>
+ <li><p>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved
+ media elements</a>, or the <code><a href=#mediacontroller>MediaController</a></code> is a
+ <a href=#blocked-media-controller>blocked media controller</a>, let <var title="">new
+ playback state</var> be false; otherwise, let it be true.</li>
- <p>The <dfn id=dom-mediacontroller-muted title=dom-MediaController-muted><code>muted</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
- override</a>, and on setting, must set the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
- override</a> to the new value.</p>
+ <li><p>If the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
+ reported playback state</a> is not equal to <var title="">new
+ playback state</var> then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> at the <code><a href=#mediacontroller>MediaController</a></code> object,
+ whose name is <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code> if <var title="">new playback state</var> is true, and whose name is <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
+ otherwise.</li>
- <p>Whenever either the <a href=#media-controller-volume-multiplier>media controller volume
- multiplier</a> or the <a href=#media-controller-mute-override>media controller mute override</a>
- are changed, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-volumechange><a href=#event-mediacontroller-volumechange>volumechange</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <li><p>Let the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
+ reported playback state</a> be <var title="">new playback
+ state</var>.</li>
- <hr><p>The following are the <a href=#event-handlers>event handlers</a> that must be
+ </ol><hr><p>The following are the <a href=#event-handlers>event handlers</a> that must be
supported, as IDL attributes, by all objects implementing the
<code><a href=#mediacontroller>MediaController</a></code> interface:</p>
<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
+ <tbody><tr><td><dfn id=handler-mediacontroller-onemptied title=handler-MediaController-onemptied><code>onemptied</code></dfn> <td> <code title=event-MediaController-emptied><a href=#event-mediacontroller-emptied>emptied</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onloadedmetadata title=handler-MediaController-onloadedmetadata><code>onloadedmetadata</code></dfn> <td> <code title=event-MediaController-loadedmetadata><a href=#event-mediacontroller-loadedmetadata>loadedmetadata</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onloadeddata title=handler-MediaController-onloadeddata><code>onloadeddata</code></dfn> <td> <code title=event-MediaController-loadeddata><a href=#event-mediacontroller-loadeddata>loadeddata</a></code>
+ <tr><td><dfn id=handler-mediacontroller-oncanplay title=handler-MediaController-oncanplay><code>oncanplay</code></dfn> <td> <code title=event-MediaController-canplay><a href=#event-mediacontroller-canplay>canplay</a></code>
+ <tr><td><dfn id=handler-mediacontroller-oncanplaythrough title=handler-MediaController-oncanplaythrough><code>oncanplaythrough</code></dfn> <td> <code title=event-MediaController-canplaythrough><a href=#event-mediacontroller-canplaythrough>canplaythrough</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onplaying title=handler-MediaController-onplaying><code>onplaying</code></dfn> <td> <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onwaiting title=handler-MediaController-onwaiting><code>onwaiting</code></dfn> <td> <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
<tbody><tr><td><dfn id=handler-mediacontroller-ondurationchange title=handler-MediaController-ondurationchange><code>ondurationchange</code></dfn> <td> <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code>
<tr><td><dfn id=handler-mediacontroller-ontimeupdate title=handler-MediaController-ontimeupdate><code>ontimeupdate</code></dfn> <td> <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code>
<tr><td><dfn id=handler-mediacontroller-onplay title=handler-MediaController-onplay><code>onplay</code></dfn> <td> <code title=event-MediaController-play><a href=#event-mediacontroller-play>play</a></code>
@@ -33145,6 +33287,28 @@ <h5 id=mediaevents><span class=secno>4.8.10.16 </span>Event summary</h5>
<th>Interface
<th>Dispatched when...
+ <tbody><tr><td><dfn id=event-mediacontroller-emptied title=event-MediaController-emptied><code>emptied</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code> or greater, or there are no longer any <a href=#slaved-media-elements>slaved media elements</a>.
+ <tr><td><dfn id=event-mediacontroller-loadedmetadata title=event-MediaController-loadedmetadata><code>loadedmetadata</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-loadeddata title=event-MediaController-loadeddata><code>loadeddata</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-canplay title=event-MediaController-canplay><code>canplay</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-canplaythrough title=event-MediaController-canplaythrough><code>canplaythrough</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-playing title=event-MediaController-playing><code>playing</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>The <code><a href=#mediacontroller>MediaController</a></code> is no longer a <a href=#blocked-media-controller>blocked media controller</a>.
+ <tr><td><dfn id=event-mediacontroller-waiting title=event-MediaController-waiting><code>waiting</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>The <code><a href=#mediacontroller>MediaController</a></code> is now a <a href=#blocked-media-controller>blocked media controller</a>.
+
<tbody><tr><td><dfn id=event-mediacontroller-durationchange title=event-MediaController-durationchange><code>durationchange</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>The <code title=dom-MediaController-duration><a href=#dom-mediacontroller-duration>duration</a></code> attribute has just been updated.
View
690 index
@@ -243,7 +243,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard &mdash; Last Updated 15 April 2011</h2>
+ <h2 class="no-num no-toc">Living Standard &mdash; Last Updated 20 April 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -26483,7 +26483,11 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, then
run these substeps:</p>
- <ol><li><p>If a fetching process is in progress for the <a href=#media-element>media
+ <ol><li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-media-emptied><a href=#event-media-emptied>emptied</a></code> at the <a href=#media-element>media
+ element</a>.</li>
+
+ <li><p>If a fetching process is in progress for the <a href=#media-element>media
element</a>, the user agent should stop it.</li>
<li><p>Set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
@@ -26496,7 +26500,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<li><p>If <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is
not set to <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, then set it
- to that state.</li>
+ to that state.
+ <!-- this can do the "report the controller state" thing -->
+ </li>
<li><p>If the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>
attribute is false, then set it to true.</li>
@@ -26532,10 +26538,6 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
</li>
- <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-emptied><a href=#event-media-emptied>emptied</a></code> at the <a href=#media-element>media
- element</a>.</li>
-
</ol></li>
<li><p>Set the <code title=dom-media-playbackRate><a href=#dom-media-playbackrate>playbackRate</a></code> attribute to the
@@ -26980,21 +26982,20 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
</li>
- <li><p>Set the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to
- <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>.</li>
-
<li><p>For <code><a href=#video>video</a></code> elements, set the <code title=dom-video-videoWidth><a href=#dom-video-videowidth>videoWidth</a></code> and <code title=dom-video-videoHeight><a href=#dom-video-videoheight>videoHeight</a></code>
attributes.</li>
- <li id=fire-loadedmetadata>
+ <li>
- <p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> at the
- element.</p>
+ <p>Set the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to
+ <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>.</p>
+
+ <p class=note>A <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> DOM
+ event <a href=#fire-loadedmetadata>will be fired</a> as part
+ of setting the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to a
+ new value.</p>
- <p class=note>Before this task is run, as part of the event
- loop mechanism, the rendering will have been updated to resize
- the <code><a href=#video>video</a></code> element if appropriate.</p>
+ <!-- this can also do the "report the controller state" thing -->
</li>
@@ -27015,34 +27016,17 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
</li>
<!--CONTROLLER-->
- <li>
-
- <p>If either the <a href=#media-resource>media resource</a> or the address of
- the <var title="">current media resource</var> indicate a
- particular set of audio or video tracks to enable, then the
- selected audio tracks must be enabled in the element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> object, and
- the first selected video track must be selected in the
- element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> object.</p>
-
- </li>
-
- <li>
-
- <p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current
- media controller</a>, then: if the <a href=#initial-playback-position>initial playback
- position</a>, relative to the <a href=#current-media-controller>current media
- controller</a>'s timeline, is greater than the
- <a href=#current-media-controller>current media controller</a>'s <a href=#media-controller-position>media controller
- position</a>, then <a href=#seek-the-media-controller>seek the media controller</a>
- to the <a href=#media-element>media element</a>'s <a href=#initial-playback-position>initial playback
- position</a>, relative to the <a href=#current-media-controller>current media
- controller</a>'s timeline; otherwise, <a href=#dom-media-seek title=dom-media-seek>seek</a> the <a href=#media-element>media
- element</a> to the <a href=#media-controller-position>media controller position</a>,
- relative to the <a href=#media-element>media element</a>'s timeline,
- discarding any resulting exceptions.</p> <!-- i.e. "bring the
- media element up to speed with its new media controller" -->
-
- </li>
+ <li><p>If either the <a href=#media-resource>media resource</a> or the address
+ of the <var title="">current media resource</var> indicate a
+ particular set of audio or video tracks to enable, then the
+ selected audio tracks must be enabled in the element's <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> object, and
+ the first selected video track must be selected in the
+ element's <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code>
+ object.</li>
+
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current
+ media controller</a>, then <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up
+ to speed with its new media controller</a>.</p>
<!--CONTROLLER-->
<li>
@@ -27705,99 +27689,128 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<p>When the ready state of a <a href=#media-element>media element</a> whose <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> is not <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code> changes, the
user agent must follow the steps given below:</p>
- <dl class=switch><!-- going up to metadata --><dt>If the previous ready state was <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, and the new
- ready state is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code></dt>
+ <ol><li>
- <dd>
+ <p>Apply the first applicable set of substeps from the following
+ list:</p>
- <p class=note>A <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> DOM event <a href=#fire-loadedmetadata>will be fired</a> as part of the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm.</p>
- </dd>
+ <dl class=switch><!-- going up to metadata --><dt>If the previous ready state was <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, and the new
+ ready state is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code></dt>
- <!-- going up to current for the first time -->
+ <dd id=fire-loadedmetadata>
- <dt id=handling-first-frame-available>If the previous ready state
- was <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> and
- the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- greater</dt>
+ <p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-loadedmetadata><a href=#event-media-loadedmetadata>loadedmetadata</a></code> at the
+ element.</p>
- <dd>
+ <p class=note>Before this task is run, as part of the event
+ loop mechanism, the rendering will have been updated to resize
+ the <code><a href=#video>video</a></code> element if appropriate.</p>
- <p id=fire-loadeddata>If this is the first time this occurs for
- this <a href=#media-element>media element</a> since the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm was last invoked,
- the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-media-loadeddata><a href=#event-media-loadeddata>loadeddata</a></code> at the element.</p>
+ </dd>
- <p>If the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or
- <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code>,
- then the relevant steps below must then be run also.</p>
+ <!-- going up to current for the first time -->
- </dd>
+ <dt id=handling-first-frame-available>If the previous ready state
+ was <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> and
+ the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ greater</dt>
- <!-- going down -->
- <dt>If the previous ready state was <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or more,
- and the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- less</dt>
+ <dd>
- <dd>
+ <p id=fire-loadeddata>If this is the first time this occurs for
+ this <a href=#media-element>media element</a> since the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm was last invoked,
+ the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-loadeddata><a href=#event-media-loadeddata>loadeddata</a></code> at the element.</p>
- <p class=note>A <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> DOM
- event <a href=#fire-waiting-when-waiting>can be fired</a>,
- depending on the current state of playback.</p>
+ <p>If the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or
+ <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code>,
+ then the relevant steps below must then be run also.</p>
- </dd>
+ </dd>
- <!-- going up to future -->
- <dt>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- less, and the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code></dt>
+ <!-- going down -->
+ <dt>If the previous ready state was <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or more,
+ and the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ less</dt>
- <dd>
+ <dd>
- <p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>.</p>
+ <p id=fire-waiting-when-waiting>If the <a href=#media-element>media
+ element</a> was <a href=#potentially-playing>potentially playing</a> before its
+ <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
+ changed to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, and
+ the element has not <a href=#ended-playback>ended playback</a>, and playback
+ has not <a href=#stopped-due-to-errors>stopped due to errors</a>, and playback has not
+ <a href=#paused-for-user-interaction>paused for user interaction</a>, the user agent must
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at
+ the element, and <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> at the element.</p>
- <p>If the element's <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>
- attribute is false, the user agent must <a href=#queue-a-task>queue a task</a>
- to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+ </dd>
- </dd>
+ <!-- going up to future -->
+ <dt>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ less, and the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code></dt>
- <!-- going up to enough -->
- <dt>If the new ready state is <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code></dt>
+ <dd>
- <dd>
+ <p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>.</p>
+
+ <p>If the element's <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>
+ attribute is false, the user agent must <a href=#queue-a-task>queue a task</a>
+ to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+
+ </dd>
- <p>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
- less, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
- a simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>, and, if the element's
- <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is false,
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
- named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+ <!-- going up to enough -->
+ <dt>If the new ready state is <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code></dt>
- <p>If the <a href=#autoplaying-flag>autoplaying flag</a> is true, and the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is true, and the
- <a href=#media-element>media element</a> has an <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute specified,
- and the <a href=#media-element>media element</a>'s <code><a href=#document>Document</a></code>'s
- <a href=#browsing-context>browsing context</a> did not have the <a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed
- automatic features browsing context flag</a> set when the
- <code><a href=#document>Document</a></code> was created, then the user agent may also
- set the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute to
- false, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-play><a href=#event-media-play>play</a></code>, and
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
- named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+ <dd>
- <p class=note>User agents do not need to support autoplay,
- and it is suggested that user agents honor user preferences on the
- matter. Authors are urged to use the <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute rather than
- using script to force the video to play, so as to allow the user
- to override the behavior if so desired.</p>
+ <p>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
+ less, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
+ a simple event</a> named <code title=event-media-canplay><a href=#event-media-canplay>canplay</a></code>, and, if the element's
+ <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is false,
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
+
+ <p>If the <a href=#autoplaying-flag>autoplaying flag</a> is true, and the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is true, and the
+ <a href=#media-element>media element</a> has an <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute specified,
+ and the <a href=#media-element>media element</a>'s <code><a href=#document>Document</a></code>'s
+ <a href=#browsing-context>browsing context</a> did not have the <a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed
+ automatic features browsing context flag</a> set when the
+ <code><a href=#document>Document</a></code> was created, then the user agent may also
+ set the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute to
+ false, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-media-play><a href=#event-media-play>play</a></code>, and
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+ named <code title=event-media-playing><a href=#event-media-playing>playing</a></code>.</p>
- <p>In any case, the user agent must finally <a href=#queue-a-task>queue a
- task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-canplaythrough><a href=#event-media-canplaythrough>canplaythrough</a></code>.</p>
+ <p class=note>User agents do not need to support autoplay,
+ and it is suggested that user agents honor user preferences on the
+ matter. Authors are urged to use the <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute rather than
+ using script to force the video to play, so as to allow the user
+ to override the behavior if so desired.</p>
- </dd>
+ <p>In any case, the user agent must finally <a href=#queue-a-task>queue a
+ task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-canplaythrough><a href=#event-media-canplaythrough>canplaythrough</a></code>.</p>
- </dl></div>
+ </dd>
+
+ </dl></li>
+
+<!--CONTROLLER-->
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a>, then <a href=#report-the-controller-state>report the controller state</a>
+ for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current media
+ controller</a>.</li>
+<!--CONTROLLER-->
+
+ </ol></div>
<p class=note>It is possible for the ready state of a media
element to jump between these states discontinuously. For example,
@@ -28006,7 +28019,19 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code> and
the user agent has reached a point in the <a href=#media-resource>media
resource</a> where the user has to make a selection for the
- resource to continue.</p>
+ resource to continue.
+<!--CONTROLLER-->
+ If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a> when this happens, then the user agent must
+ <a href=#report-the-controller-state>report the controller state</a> for the <a href=#media-element>media
+ element</a>'s <a href=#current-media-controller>current media controller</a>. If If the
+ <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a> when the user makes a selection, allowing playback
+ to resume, the user agent must similarly <a href=#report-the-controller-state>report the controller
+ state</a> for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current
+ media controller</a>.
+<!--CONTROLLER-->
+ </p>
<p>It is possible for a <a href=#media-element>media element</a> to have both
<a href=#ended-playback>ended playback</a> and <a href=#paused-for-user-interaction>paused for user
@@ -28017,18 +28042,11 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
interaction</a>, the user agent must <a href=#queue-a-task>queue a task</a> to
<a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the element.</p>
- <p id=fire-waiting-when-waiting>When a <a href=#media-element>media element</a>
- that is <a href=#potentially-playing>potentially playing</a> stops playing because its
- <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
- changes to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, without
- the element having <a href=#ended-playback>ended playback</a>, or playback having
- <a href=#stopped-due-to-errors>stopped due to errors</a>, or playback having <a href=#paused-for-user-interaction>paused
- for user interaction</a>, or the <a href=#dom-media-seek title=dom-media-seek>seeking algorithm</a> being invoked, the
- user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code>
- at the element, and <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> at
- the element.</p>
+ <p class=note>A <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code>
+ DOM event <a href=#fire-waiting-when-waiting>can be fired</a> as a
+ result of an element that is <a href=#potentially-playing>potentially playing</a>
+ stopping playback due to its <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute changing to
+ a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>.</p>
<p>When the <a href=#current-playback-position>current playback position</a> reaches the end
of the <a href=#media-resource>media resource</a> when the <a href=#direction-of-playback>direction of
@@ -28177,6 +28195,13 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<li><p>Set the <a href=#media-element>media element</a>'s <a href=#autoplaying-flag>autoplaying
flag</a> to false.</li>
+<!--CONTROLLER-->
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a>, then <a href=#report-the-controller-state>report the controller state</a>
+ for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current media
+ controller</a>.</li>
+<!--CONTROLLER-->
+
</ol><hr><p>When the <dfn id=dom-media-pause title=dom-media-pause><code>pause()</code></dfn>
method is invoked, and when the user agent is required to pause the
<a href=#media-element>media element</a>, the user agent must run the following
@@ -28205,6 +28230,13 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
</ol></li>
+<!--CONTROLLER-->
+ <li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+ controller</a>, then <a href=#report-the-controller-state>report the controller state</a>
+ for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current media
+ controller</a>.</li>
+<!--CONTROLLER-->
+
</ol><hr><p>The
<!--CONTROLLER-->
<dfn id=effective-playback-rate>effective playback rate</dfn> is not necessarily the element's
@@ -28505,29 +28537,32 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<code title=dom-media-seeking><a href=#dom-media-seeking>seeking</a></code> IDL attribute to
false and abort these steps.</li>
- <li><p>Set the <a href=#current-playback-position>current playback position</a> to the given
- <var title="">new playback position</var>.</li>
-
<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-media-seeking><a href=#event-media-seeking>seeking</a></code>
at the element.</li>
- <li id=seekUpdate><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
- element.</li>
+ <li>
- <li><p>If the <a href=#media-element>media element</a> was <a href=#potentially-playing>potentially
- playing</a> immediately before it started seeking, but seeking
- caused its <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code>
- attribute to change to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, then
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> at the
- element.</li>
+ <p>Set the <a href=#current-playback-position>current playback position</a> to the given
+ <var title="">new playback position</var>.</p>
+
+ <p class=note>If the <a href=#media-element>media element</a> was
+ <a href=#potentially-playing>potentially playing</a> immediately before it started
+ seeking, but seeking caused its <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute to change
+ to a value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, then a
+ <code title=event-media-waiting><a href=#event-media-waiting>waiting</a></code> <a href=#fire-waiting-when-waiting>will be fired</a> at the
+ element.</p> <!-- also, timeupdate -->
+ <!-- also, it will do the "report the controller state" thing -->
+
+ </li>
<li><p>Wait until the user agent has established whether or not the
<a href=#media-data>media data</a> for the <var title="">new playback
position</var> is available, and, if it is, until it has decoded
- enough data to play back that position.</li>
+ enough data to play back that position.</p>
+ <!-- at which point, it will do the "port the controller state"
+ thing again -->
+ </li>
<li><p><a href=#await-a-stable-state>Await a stable state</a>. The <a href=#synchronous-section>synchronous
section</a> consists of all the remaining steps of this
@@ -28537,6 +28572,10 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<li><p>&#8987; Set the <code title=dom-media-seeking><a href=#dom-media-seeking>seeking</a></code> IDL attribute to
false.</li>
+ <li id=seekUpdate><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
+ element.</li>
+
<li><p>&#8987; <a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-media-seeked><a href=#event-media-seeked>seeked</a></code>
at the element.</li>
@@ -28919,6 +28958,14 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
attribute double <a href=#dom-mediacontroller-volume title=dom-MediaController-volume>volume</a>;
attribute boolean <a href=#dom-mediacontroller-muted title=dom-MediaController-muted>muted</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onemptied title=handler-MediaController-onemptied>onemptied</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onloadedmetadata title=handler-MediaController-onloadedmetadata>onloadedmetadata</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onloadeddata title=handler-MediaController-onloadeddata>onloadeddata</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-oncanplay title=handler-MediaController-oncanplay>oncanplay</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-oncanplaythrough title=handler-MediaController-oncanplaythrough>oncanplaythrough</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onplaying title=handler-MediaController-onplaying>onplaying</a>;
+ attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onwaiting title=handler-MediaController-onwaiting>onwaiting</a>;
+
attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-ondurationchange title=handler-MediaController-ondurationchange>ondurationchange</a>;
attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-ontimeupdate title=handler-MediaController-ontimeupdate>ontimeupdate</a>;
attribute <a href=#function>Function</a> <a href=#handler-mediacontroller-onplay title=handler-MediaController-onplay>onplay</a>;
@@ -29090,7 +29137,146 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
must use the same clock for their definition of their <a href=#media-timeline>media
timeline</a>'s unit time.</p>
- <p>The <a href=#media-resource title="media resource">media resources</a> of all
+ <hr><p>The <dfn id=dom-media-controller title=dom-media-controller><code>controller</code></dfn> attribute
+ on a <a href=#media-element>media element</a>, on getting, must return the
+ element's <a href=#current-media-controller>current media controller</a>, if any, or null
+ otherwise. On setting, it must first remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute, if any,
+ and then set the <a href=#current-media-controller>current media controller</a> to the given
+ value. If the given value is null, the element no longer has a
+ <a href=#current-media-controller>current media controller</a>; if it is not null, then the
+ user agent must <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up to speed with its
+ new media controller</a>.</p>
+
+ <hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
+ constructor, when invoked, must return a newly created
+ <code><a href=#mediacontroller>MediaController</a></code> object.</p>
+
+ <hr><p>The <dfn id=dom-mediacontroller-seekable title=dom-MediaController-seekable><code>seekable</code></dfn>
+ attribute must return a new static <a href=#normalized-timeranges-object>normalized
+ <code>TimeRanges</code> object</a> that represents the
+ intersection of the ranges of the <a href=#media-resource title="media resource">media
+ resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
+ user agent is able to seek to, at the time the attribute is
+ evaluated.</p>
+
+ <p>The <dfn id=dom-mediacontroller-buffered title=dom-MediaController-buffered><code>buffered</code></dfn>
+ attribute must return a new static <a href=#normalized-timeranges-object>normalized
+ <code>TimeRanges</code> object</a> that represents the
+ intersection of the ranges of the <a href=#media-resource title="media resource">media
+ resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
+ user agent has buffered, at the time the attribute is evaluated.
+ Users agents must accurately determine the ranges available, even
+ for media streams where this can only be determined by tedious
+ inspection.</p>
+
+ <p>The <dfn id=dom-mediacontroller-duration title=dom-MediaController-duration><code>duration</code></dfn>
+ attribute must return the <a href=#media-controller-duration>media controller
+ duration</a>.</p>
+
+ <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-duration>media controller duration</a> changes, whichever happens
+ least often, the user agent must <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code>
+ at the <code><a href=#mediacontroller>MediaController</a></code>. If the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-duration>media controller
+ duration</a> decreases such that the <a href=#media-controller-position>media controller
+ position</a> is greater than the <a href=#media-controller-duration>media controller
+ duration</a>, the user agent must immediately <a href=#seek-the-media-controller>seek the
+ media controller</a> to <a href=#media-controller-duration>media controller
+ duration</a>.</p>
+
+ <p>The <dfn id=dom-mediacontroller-currenttime title=dom-MediaController-currentTime><code>currentTime</code></dfn>
+ attribute must return the <a href=#media-controller-position>media controller position</a> on
+ getting, and on setting must <a href=#seek-the-media-controller>seek the media controller</a>
+ to the new value.</p>
+
+ <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-position>media controller position</a> changes, whichever happens
+ least often, the user agent must <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-timeupdate><a href=#event-mediacontroller-timeupdate>timeupdate</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>When a <code><a href=#mediacontroller>MediaController</a></code> is created it is a
+ <dfn id=playing-media-controller>playing media controller</dfn>. It can be changed into a
+ <dfn id=paused-media-controller>paused media controller</dfn> and back either via the user
+ agent's user interface (when the element is <a href=#expose-a-user-interface-to-the-user title="expose a
+ user interface to the user">exposing a user interface to the
+ user</a>) or by script using the APIs defined in this section
+ (see below).</p>
+
+ <p>The <dfn id=dom-mediacontroller-paused title=dom-MediaController-paused><code>paused</code></dfn>
+ attribute must return true if the <code><a href=#mediacontroller>MediaController</a></code>
+ object is a <a href=#paused-media-controller>paused media controller</a>, and false
+ otherwise.</p>
+
+ <p>When the <dfn id=dom-mediacontroller-pause title=dom-MediaController-pause><code>pause()</code></dfn> method
+ is invoked, if the <code><a href=#mediacontroller>MediaController</a></code> is a <a href=#playing-media-controller>playing
+ media controller</a> then the user agent must change the
+ <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#paused-media-controller>paused media
+ controller</a>, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-MediaController-pause><a href=#event-mediacontroller-pause>pause</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>, and then <a href=#report-the-controller-state>report the controller
+ state</a> of the <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <p>When the <dfn id=dom-mediacontroller-play title=dom-MediaController-play><code>play()</code></dfn> method is
+ invoked, if the <code><a href=#mediacontroller>MediaController</a></code> is a <a href=#paused-media-controller>paused media
+ controller</a>, the user agent must change the
+ <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#playing-media-controller>playing media
+ controller</a>, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-MediaController-play><a href=#event-mediacontroller-play>play</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>, and then <a href=#report-the-controller-state>report the controller
+ state</a> of the <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=media-controller-default-playback-rate>media controller
+ default playback rate</dfn> and a <dfn id=media-controller-playback-rate>media controller playback
+ rate</dfn>, which must both be set to 1.0 when the
+ <code><a href=#mediacontroller>MediaController</a></code> object is created.</p>
+
+ <p>The <dfn id=dom-mediacontroller-defaultplaybackrate title=dom-MediaController-defaultPlaybackRate><code>defaultPlaybackRate</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
+ playback rate</a>, and on setting, must set the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
+ playback rate</a> to the new value, then <a href=#queue-a-task>queue a
+ task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-ratechange><a href=#event-mediacontroller-ratechange>ratechange</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <p>The <dfn id=dom-mediacontroller-playbackrate title=dom-MediaController-playbackRate><code>playbackRate</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
+ rate</a>, and on setting, must set the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
+ rate</a> to the new value, then <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-ratechange><a href=#event-mediacontroller-ratechange>ratechange</a></code> at the
+ <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=media-controller-volume-multiplier>media controller volume
+ multiplier</dfn>, which must be set to 1.0 when the
+ <code><a href=#mediacontroller>MediaController</a></code> object is created, and a <dfn id=media-controller-mute-override>media
+ controller mute override</dfn>, much must initially be false.</p>
+
+ <p>The <dfn id=dom-mediacontroller-volume title=dom-MediaController-volume><code>volume</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-volume-multiplier>media controller volume
+ multiplier</a>, and on setting, if the new value is in the range
+ 0.0 to 1.0 inclusive, must set the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-volume-multiplier>media controller volume multiplier</a> to the new value and
+ <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-MediaController-volumechange><a href=#event-mediacontroller-volumechange>volumechange</a></code>
+ at the <code><a href=#mediacontroller>MediaController</a></code>. If the new value is outside the
+ range 0.0 to 1.0 inclusive, then, on setting, an
+ <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised instead.</p>
+
+ <p>The <dfn id=dom-mediacontroller-muted title=dom-MediaController-muted><code>muted</code></dfn>
+ attribute, on getting, must return the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
+ override</a>, and on setting, must set the
+ <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
+ override</a> to the new value and <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-volumechange><a href=#event-mediacontroller-volumechange>volumechange</a></code> at
+ the <code><a href=#mediacontroller>MediaController</a></code>.</p>
+
+ <hr><p>The <a href=#media-resource title="media resource">media resources</a> of all
the <a href=#slaved-media-elements>slaved media elements</a> of a
<code><a href=#mediacontroller>MediaController</a></code> have a defined temporal relationship
which provides relative offsets between the zero time of each such
@@ -29170,15 +29356,7 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
exceptions.</li> <!-- i.e. "bring the media element up to speed
with its new media controller" -->
- </ol><p>When a <code><a href=#mediacontroller>MediaController</a></code> is created it is a
- <dfn id=playing-media-controller>playing media controller</dfn>. It can be changed into a
- <dfn id=paused-media-controller>paused media controller</dfn> and back either via the user
- agent's user interface (when the element is <a href=#expose-a-user-interface-to-the-user title="expose a
- user interface to the user">exposing a user interface to the
- user</a>) or via the APIs defined in this section (see
- below).</p>
-
- <p>A <code><a href=#mediacontroller>MediaController</a></code> is a <dfn id=blocked-media-controller>blocked media
+ </ol><p>A <code><a href=#mediacontroller>MediaController</a></code> is a <dfn id=blocked-media-controller>blocked media
controller</dfn> if the <code><a href=#mediacontroller>MediaController</a></code> is a
<a href=#paused-media-controller>paused media controller</a>, or if any of its <a href=#slaved-media-elements>slaved
media elements</a> are <a href=#blocked-media-element title="blocked media
@@ -29195,14 +29373,6 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
the <a href=#media-resource>media resource</a> relative to the
<code><a href=#mediacontroller>MediaController</a></code>'s timeline.</p>
- <p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=media-controller-default-playback-rate>media controller
- default playback rate</dfn>, a <dfn id=media-controller-playback-rate>media controller playback
- rate</dfn>, and a <dfn id=media-controller-volume-multiplier>media controller volume multiplier</dfn>,
- which must all be set to 1.0 when the <code><a href=#mediacontroller>MediaController</a></code>
- object is created. A <code><a href=#mediacontroller>MediaController</a></code> also has a
- <dfn id=media-controller-mute-override>media controller mute override</dfn>, much must initially be
- false.</p>
-
<p id=controller-playback>When a <code><a href=#mediacontroller>MediaController</a></code> is
not a <a href=#blocked-media-controller>blocked media controller</a> and it has at least one
<a href=#slaved-media-elements title="slaved media elements">slaved media element</a>
@@ -29213,134 +29383,106 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
<code><a href=#mediacontroller>MediaController</a></code>'s timeline per unit time of the clock
used by its <a href=#slaved-media-elements>slaved media elements</a>.</p>
- <hr><p>The <dfn id=dom-media-controller title=dom-media-controller><code>controller</code></dfn> attribute
- on a <a href=#media-element>media element</a>, on getting, must return the
- element's <a href=#current-media-controller>current media controller</a>, if any, or null
- otherwise. On setting, it must first remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute, if any,
- and then set the <a href=#current-media-controller>current media controller</a> to the given
- value. If the given value is null, the element no longer has a
- <a href=#current-media-controller>current media controller</a>; if it is not null, then the
- user agent must <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up to speed with its
- new media controller</a>.</p>
-
- <hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
- constructor, when invoked, must return a newly created
- <code><a href=#mediacontroller>MediaController</a></code> object.</p>
+ <p>When the zero point on the timeline of a
+ <code><a href=#mediacontroller>MediaController</a></code> moves relative to the timelines of the
+ <a href=#slaved-media-elements>slaved media elements</a> by a time difference <var title="">&Delta;T</var>, the <code><a href=#mediacontroller>MediaController</a></code>'s
+ <a href=#media-controller-position>media controller position</a> must be decremented by <var title="">&Delta;T</var>.</p>
+
+ <p class=note>In some situations, e.g. when playing back a live
+ stream without buffering anything, the <a href=#media-controller-position>media controller
+ position</a> would increase motonically as described above at the
+ same rate as the <var title="">&Delta;T</var> described in the
+ previous paragraph decreases it, with the end result that for all
+ intents and purposes, the <a href=#media-controller-position>media controller position</a>
+ would appear to remain constant (probably with the value 0).</p>
+
+ <hr><p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=most-recently-reported-readiness-state>most recently reported
+ readiness state</dfn>, which is a number from 0 to 4 derived from
+ the numbers used for the <a href=#media-element>media element</a> <code title=attr-media-readyState>readyState</code> attribute, and a
+ <dfn id=most-recently-reported-playback-state>most recently reported playback state</dfn>, which is either
+ <i>playing</i> or <i>waiting</i>.</p>
+
+ <p>When a <code><a href=#mediacontroller>MediaController</a></code> is created, its <a href=#most-recently-reported-readiness-state>most
+ recently reported readiness state</a> must be set to 0, and its
+ <a href=#most-recently-reported-playback-state>most recently reported playback state</a> must be set to
+ <i>waiting</i>.</p>
+
+ <p>When a user agent is required to <dfn id=report-the-controller-state>report the controller
+ state</dfn> for a <code><a href=#mediacontroller>MediaController</a></code>, the user agent must
+ run the following steps:</p>
- <hr><p>The <dfn id=dom-mediacontroller-seekable title=dom-MediaController-seekable><code>seekable</code></dfn>
- attribute must return a new static <a href=#normalized-timeranges-object>normalized
- <code>TimeRanges</code> object</a> that represents the
- intersection of the ranges of the <a href=#media-resource title="media resource">media
- resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
- user agent is able to seek to, at the time the attribute is
- evaluated.</p>
+ <ol><li>
- <p>The <dfn id=dom-mediacontroller-buffered title=dom-MediaController-buffered><code>buffered</code></dfn>
- attribute must return a new static <a href=#normalized-timeranges-object>normalized
- <code>TimeRanges</code> object</a> that represents the
- intersection of the ranges of the <a href=#media-resource title="media resource">media
- resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
- user agent has buffered, at the time the attribute is evaluated.
- Users agents must accurately determine the ranges available, even
- for media streams where this can only be determined by tedious
- inspection.</p>
+ <p>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved media
+ elements</a>, let <var title="">new readiness state</var> be
+ 0.</p>
- <p>The <dfn id=dom-mediacontroller-duration title=dom-MediaController-duration><code>duration</code></dfn>
- attribute must return the <a href=#media-controller-duration>media controller
- duration</a>.</p>
+ <p>Otherwise, let it have the lowest value of the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> IDL attributes of
+ all of its <a href=#slaved-media-elements>slaved media elements</a>.</p>
- <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
- <a href=#media-controller-duration>media controller duration</a> changes, whichever happens
- least often, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ </li>
- <p>The <dfn id=dom-mediacontroller-currenttime title=dom-MediaController-currentTime><code>currentTime</code></dfn>
- attribute must return the <a href=#media-controller-position>media controller position</a> on
- getting, and on setting must <a href=#seek-the-media-controller>seek the media controller</a>
- to the new value.</p>
+ <li>
- <p>Every 15 to 250ms, or whenever the <code><a href=#mediacontroller>MediaController</a></code>'s
- <a href=#media-controller-position>media controller position</a> changes, whichever happens
- least often, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-timeupdate><a href=#event-mediacontroller-timeupdate>timeupdate</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <p>If the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-readiness-state>most recently
+ reported readiness state</a> is not equal to <var title="">new
+ readiness state</var> then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
+ a simple event</a> at the <code><a href=#mediacontroller>MediaController</a></code> object,
+ whose name is the event name corresponding to the value of <var title="">new readiness state</var> given in the table below:</p>
+ <!-- hopefully everyone will understand what this means -->
- <hr><p>The <dfn id=dom-mediacontroller-paused title=dom-MediaController-paused><code>paused</code></dfn>
- attribute must return true if the <code><a href=#mediacontroller>MediaController</a></code>
- object is a <a href=#paused-media-controller>paused media controller</a>, and false
- otherwise.</p>
+ <table><thead><tr><th>Value of <var title="">new readiness state</var>
+ <th>Event name
- <p>When the <dfn id=dom-mediacontroller-pause title=dom-MediaController-pause><code>pause()</code></dfn> method
- is invoked, the user agent must change the
- <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#paused-media-controller>paused media
- controller</a>.</p>
+ <tbody><tr><td> 0
+ <td> <code title=event-MediaController-emptied><a href=#event-mediacontroller-emptied>emptied</a></code>
- <p>Whenever the <code><a href=#mediacontroller>MediaController</a></code> changes from a
- <a href=#playing-media-controller>playing media controller</a> to a <a href=#paused-media-controller>paused media
- controller</a>, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-pause><a href=#event-mediacontroller-pause>pause</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <tr><td> 1
+ <td> <code title=event-MediaController-loadedmetadata><a href=#event-mediacontroller-loadedmetadata>loadedmetadata</a></code>
- <p>When the <dfn id=dom-mediacontroller-play title=dom-MediaController-play><code>play()</code></dfn> method
- is invoked, the user agent must change the
- <code><a href=#mediacontroller>MediaController</a></code> into a <a href=#playing-media-controller>playing media
- controller</a>.</p>
+ <tr><td> 2
+ <td> <code title=event-MediaController-loadeddata><a href=#event-mediacontroller-loadeddata>loadeddata</a></code>
- <p>Whenever the <code><a href=#mediacontroller>MediaController</a></code> changes from a
- <a href=#paused-media-controller>paused media controller</a> to a <a href=#playing-media-controller>playing media
- controller</a>, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-play><a href=#event-mediacontroller-play>play</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <tr><td> 3
+ <td> <code title=event-MediaController-canplay><a href=#event-mediacontroller-canplay>canplay</a></code>
- <hr><p>The <dfn id=dom-mediacontroller-defaultplaybackrate title=dom-MediaController-defaultPlaybackRate><code>defaultPlaybackRate</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
- playback rate</a>, and on setting, must set the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-default-playback-rate>media controller default
- playback rate</a> to the new value.</p>
+ <tr><td> 4
+ <td> <code title=event-MediaController-canplaythrough><a href=#event-mediacontroller-canplaythrough>canplaythrough</a></code>
- <p>The <dfn id=dom-mediacontroller-playbackrate title=dom-MediaController-playbackRate><code>playbackRate</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
- rate</a>, and on setting, must set the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-playback-rate>media controller playback
- rate</a> to the new value.</p>
+ </table></li>
- <p>Whenever the <a href=#media-controller-default-playback-rate>media controller default playback rate</a>
- or the <a href=#media-controller-playback-rate>media controller playback rate</a> are changed, the
- user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-MediaController-ratechange><a href=#event-mediacontroller-ratechange>ratechange</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <li><p>Let the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-readiness-state>most recently
+ reported readiness state</a> be <var title="">new readiness
+ state</var>.</li>
- <hr><p>The <dfn id=dom-mediacontroller-volume title=dom-MediaController-volume><code>volume</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-volume-multiplier>media controller volume
- multiplier</a>, and on setting, if the new value is in the range
- 0.0 to 1.0 inclusive, must set the <code><a href=#mediacontroller>MediaController</a></code>'s
- <a href=#media-controller-volume-multiplier>media controller volume multiplier</a> to the new value. If
- the new value is outside the range 0.0 to 1.0 inclusive, then, on
- setting, an <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised
- instead.</p>
+ <li><p>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved
+ media elements</a>, or the <code><a href=#mediacontroller>MediaController</a></code> is a
+ <a href=#blocked-media-controller>blocked media controller</a>, let <var title="">new
+ playback state</var> be false; otherwise, let it be true.</li>
- <p>The <dfn id=dom-mediacontroller-muted title=dom-MediaController-muted><code>muted</code></dfn>
- attribute, on getting, must return the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
- override</a>, and on setting, must set the
- <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#media-controller-mute-override>media controller mute
- override</a> to the new value.</p>
+ <li><p>If the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
+ reported playback state</a> is not equal to <var title="">new
+ playback state</var> then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+ simple event</a> at the <code><a href=#mediacontroller>MediaController</a></code> object,
+ whose name is <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code> if <var title="">new playback state</var> is true, and whose name is <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
+ otherwise.</li>
- <p>Whenever either the <a href=#media-controller-volume-multiplier>media controller volume
- multiplier</a> or the <a href=#media-controller-mute-override>media controller mute override</a>
- are changed, the user agent must <a href=#queue-a-task>queue a task</a> to
- <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-MediaController-volumechange><a href=#event-mediacontroller-volumechange>volumechange</a></code> at the
- <code><a href=#mediacontroller>MediaController</a></code>.</p>
+ <li><p>Let the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
+ reported playback state</a> be <var title="">new playback
+ state</var>.</li>
- <hr><p>The following are the <a href=#event-handlers>event handlers</a> that must be
+ </ol><hr><p>The following are the <a href=#event-handlers>event handlers</a> that must be
supported, as IDL attributes, by all objects implementing the
<code><a href=#mediacontroller>MediaController</a></code> interface:</p>
<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
+ <tbody><tr><td><dfn id=handler-mediacontroller-onemptied title=handler-MediaController-onemptied><code>onemptied</code></dfn> <td> <code title=event-MediaController-emptied><a href=#event-mediacontroller-emptied>emptied</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onloadedmetadata title=handler-MediaController-onloadedmetadata><code>onloadedmetadata</code></dfn> <td> <code title=event-MediaController-loadedmetadata><a href=#event-mediacontroller-loadedmetadata>loadedmetadata</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onloadeddata title=handler-MediaController-onloadeddata><code>onloadeddata</code></dfn> <td> <code title=event-MediaController-loadeddata><a href=#event-mediacontroller-loadeddata>loadeddata</a></code>
+ <tr><td><dfn id=handler-mediacontroller-oncanplay title=handler-MediaController-oncanplay><code>oncanplay</code></dfn> <td> <code title=event-MediaController-canplay><a href=#event-mediacontroller-canplay>canplay</a></code>
+ <tr><td><dfn id=handler-mediacontroller-oncanplaythrough title=handler-MediaController-oncanplaythrough><code>oncanplaythrough</code></dfn> <td> <code title=event-MediaController-canplaythrough><a href=#event-mediacontroller-canplaythrough>canplaythrough</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onplaying title=handler-MediaController-onplaying><code>onplaying</code></dfn> <td> <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code>
+ <tr><td><dfn id=handler-mediacontroller-onwaiting title=handler-MediaController-onwaiting><code>onwaiting</code></dfn> <td> <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
<tbody><tr><td><dfn id=handler-mediacontroller-ondurationchange title=handler-MediaController-ondurationchange><code>ondurationchange</code></dfn> <td> <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code>
<tr><td><dfn id=handler-mediacontroller-ontimeupdate title=handler-MediaController-ontimeupdate><code>ontimeupdate</code></dfn> <td> <code title=event-MediaController-durationchange><a href=#event-mediacontroller-durationchange>durationchange</a></code>
<tr><td><dfn id=handler-mediacontroller-onplay title=handler-MediaController-onplay><code>onplay</code></dfn> <td> <code title=event-MediaController-play><a href=#event-mediacontroller-play>play</a></code>
@@ -33157,6 +33299,28 @@ interface <dfn id=texttrackcue>TextTrackCue</dfn> {
<th>Interface
<th>Dispatched when...
+ <tbody><tr><td><dfn id=event-mediacontroller-emptied title=event-MediaController-emptied><code>emptied</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code> or greater, or there are no longer any <a href=#slaved-media-elements>slaved media elements</a>.
+ <tr><td><dfn id=event-mediacontroller-loadedmetadata title=event-MediaController-loadedmetadata><code>loadedmetadata</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-loadeddata title=event-MediaController-loadeddata><code>loadeddata</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-canplay title=event-MediaController-canplay><code>canplay</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-canplaythrough title=event-MediaController-canplaythrough><code>canplaythrough</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>All the <a href=#slaved-media-elements>slaved media elements</a> newly have <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> set to <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code> or greater.
+ <tr><td><dfn id=event-mediacontroller-playing title=event-MediaController-playing><code>playing</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>The <code><a href=#mediacontroller>MediaController</a></code> is no longer a <a href=#blocked-media-controller>blocked media controller</a>.
+ <tr><td><dfn id=event-mediacontroller-waiting title=event-MediaController-waiting><code>waiting</code></dfn>
+ <td><code><a href=#event>Event</a></code>
+ <td>The <code><a href=#mediacontroller>MediaController</a></code> is now a <a href=#blocked-media-controller>blocked media controller</a>.
+
<tbody><tr><td><dfn id=event-mediacontroller-durationchange title=event-MediaController-durationchange><code>durationchange</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>The <code title=dom-MediaController-duration><a href=#dom-mediacontroller-duration>duration</a></code> attribute has just been updated.
View
845 source
@@ -28629,6 +28629,11 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
<ol>
+ <li><p><span>Queue a task</span> to <span>fire a simple
+ event</span> named <code
+ title="event-media-emptied">emptied</code> at the <span>media
+ element</span>.</p></li>
+
<li><p>If a fetching process is in progress for the <span>media
element</span>, the user agent should stop it.</p></li>
@@ -28645,7 +28650,9 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
<li><p>If <code title="dom-media-readyState">readyState</code> is
not set to <code
title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, then set it
- to that state.</p></li>
+ to that state.
+ <!-- this can do the "report the controller state" thing -->
+ </p></li>
<li><p>If the <code title="dom-media-paused">paused</code>
attribute is false, then set it to true.</p></li>
@@ -28683,11 +28690,6 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
</li>
- <li><p><span>Queue a task</span> to <span>fire a simple
- event</span> named <code
- title="event-media-emptied">emptied</code> at the <span>media
- element</span>.</p></li>
-
</ol>
</li>
@@ -29235,26 +29237,26 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
</li>
- <li><p>Set the <code
- title="dom-media-readyState">readyState</code> attribute to
- <code
- title="dom-media-HAVE_METADATA">HAVE_METADATA</code>.</p></li>
-
<li><p>For <code>video</code> elements, set the <code
title="dom-video-videoWidth">videoWidth</code> and <code
title="dom-video-videoHeight">videoHeight</code>
attributes.</p></li>
- <li id="fire-loadedmetadata">
+ <li>
- <p><span>Queue a task</span> to <span>fire a simple
- event</span> named <code
- title="event-media-loadedmetadata">loadedmetadata</code> at the
- element.</p>
+ <p>Set the <code
+ title="dom-media-readyState">readyState</code> attribute to
+ <code
+ title="dom-media-HAVE_METADATA">HAVE_METADATA</code>.</p>
+
+ <p class="note">A <code
+ title="event-media-loadedmetadata">loadedmetadata</code> DOM
+ event <a href="#fire-loadedmetadata">will be fired</a> as part
+ of setting the <code
+ title="dom-media-readyState">readyState</code> attribute to a
+ new value.</p>
- <p class="note">Before this task is run, as part of the event
- loop mechanism, the rendering will have been updated to resize
- the <code>video</code> element if appropriate.</p>
+ <!-- this can also do the "report the controller state" thing -->
</li>
@@ -29277,37 +29279,19 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
</li>
<!--END w3c-html--><!--CONTROLLER-->
- <li>
-
- <p>If either the <span>media resource</span> or the address of
- the <var title="">current media resource</var> indicate a
- particular set of audio or video tracks to enable, then the
- selected audio tracks must be enabled in the element's <code
- title="dom-media-audioTracks">audioTracks</code> object, and
- the first selected video track must be selected in the
- element's <code
- title="dom-media-videoTracks">videoTracks</code> object.</p>
-
- </li>
-
- <li>
-
- <p>If the <span>media element</span> has a <span>current
- media controller</span>, then: if the <span>initial playback
- position</span>, relative to the <span>current media
- controller</span>'s timeline, is greater than the
- <span>current media controller</span>'s <span>media controller
- position</span>, then <span>seek the media controller</span>
- to the <span>media element</span>'s <span>initial playback
- position</span>, relative to the <span>current media
- controller</span>'s timeline; otherwise, <span
- title="dom-media-seek">seek</span> the <span>media
- element</span> to the <span>media controller position</span>,
- relative to the <span>media element</span>'s timeline,
- discarding any resulting exceptions.</p> <!-- i.e. "bring the
- media element up to speed with its new media controller" -->
+ <li><p>If either the <span>media resource</span> or the address
+ of the <var title="">current media resource</var> indicate a
+ particular set of audio or video tracks to enable, then the
+ selected audio tracks must be enabled in the element's <code
+ title="dom-media-audioTracks">audioTracks</code> object, and
+ the first selected video track must be selected in the
+ element's <code
+ title="dom-media-videoTracks">videoTracks</code>
+ object.</p></li>
- </li>
+ <li><p>If the <span>media element</span> has a <span>current
+ media controller</span>, then <span>bring the media element up
+ to speed with its new media controller</span>.</p>
<!--START w3c-html--><!--CONTROLLER-->
<li>
@@ -30083,124 +30067,157 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> changes, the
user agent must follow the steps given below:</p>
- <dl class="switch">
+ <ol>
- <!-- going up to metadata -->
- <dt>If the previous ready state was <code
- title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, and the new
- ready state is <code
- title="dom-media-HAVE_METADATA">HAVE_METADATA</code></dt>
+ <li>
- <dd>
+ <p>Apply the first applicable set of substeps from the following
+ list:</p>
- <p class="note">A <code
- title="event-media-loadedmetadata">loadedmetadata</code> DOM event <a
- href="#fire-loadedmetadata">will be fired</a> as part of the <code
- title="dom-media-load">load()</code> algorithm.</p>
- </dd>
+ <dl class="switch">
- <!-- going up to current for the first time -->
+ <!-- going up to metadata -->
+ <dt>If the previous ready state was <code
+ title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, and the new
+ ready state is <code
+ title="dom-media-HAVE_METADATA">HAVE_METADATA</code></dt>
- <dt id="handling-first-frame-available">If the previous ready state
- was <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code> and
- the new ready state is <code
- title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
- greater</dt>
+ <dd id="fire-loadedmetadata">
- <dd>
+ <p><span>Queue a task</span> to <span>fire a simple event</span>
+ named <code
+ title="event-media-loadedmetadata">loadedmetadata</code> at the
+ element.</p>
- <p id="fire-loadeddata">If this is the first time this occurs for
- this <span>media element</span> since the <code
- title="dom-media-load">load()</code> algorithm was last invoked,
- the user agent must <span>queue a task</span> to <span>fire a
- simple event</span> named <code
- title="event-media-loadeddata">loadeddata</code> at the element.</p>
+ <p class="note">Before this task is run, as part of the event
+ loop mechanism, the rendering will have been updated to resize
+ the <code>video</code> element if appropriate.</p>
- <p>If the new ready state is <code
- title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or
- <code title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>,
- then the relevant steps below must then be run also.</p>
+ </dd>
- </dd>
+ <!-- going up to current for the first time -->
- <!-- going down -->
- <dt>If the previous ready state was <code
- title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or more,
- and the new ready state is <code
- title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
- less</dt>
+ <dt id="handling-first-frame-available">If the previous ready state
+ was <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code> and
+ the new ready state is <code
+ title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
+ greater</dt>
- <dd>
+ <dd>
- <p class="note">A <code title="event-media-waiting">waiting</code> DOM
- event <a href="#fire-waiting-when-waiting">can be fired</a>,
- depending on the current state of playback.</p>
+ <p id="fire-loadeddata">If this is the first time this occurs for
+ this <span>media element</span> since the <code
+ title="dom-media-load">load()</code> algorithm was last invoked,
+ the user agent must <span>queue a task</span> to <span>fire a
+ simple event</span> named <code
+ title="event-media-loadeddata">loadeddata</code> at the element.</p>
- </dd>
+ <p>If the new ready state is <code
+ title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or
+ <code title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>,
+ then the relevant steps below must then be run also.</p>
- <!-- going up to future -->
- <dt>If the previous ready state was <code
- title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
- less, and the new ready state is <code
- title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code></dt>
+ </dd>
- <dd>
+ <!-- going down -->
+ <dt>If the previous ready state was <code
+ title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or more,
+ and the new ready state is <code
+ title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
+ less</dt>
- <p>The user agent must <span>queue a task</span> to <span>fire a
- simple event</span> named <code
- title="event-media-canplay">canplay</code>.</p>
+ <dd>
- <p>If the element's <code title="dom-media-paused">paused</code>
- attribute is false, the user agent must <span>queue a task</span>
- to <span>fire a simple event</span> named <code
- title="event-media-playing">playing</code>.</p>
+ <p id="fire-waiting-when-waiting">If the <span>media
+ element</span> was <span>potentially playing</span> before its
+ <code title="dom-media-readyState">readyState</code> attribute
+ changed to a value lower than <code
+ title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, and
+ the element has not <span>ended playback</span>, and playback
+ has not <span>stopped due to errors</span>, and playback has not
+ <span>paused for user interaction</span>, the user agent must
+ <span>queue a task</span> to <span>fire a simple event</span>
+ named <code title="event-media-timeupdate">timeupdate</code> at
+ the element, and <span>queue a task</span> to <span>fire a
+ simple event</span> named <code
+ title="event-media-waiting">waiting</code> at the element.</p>
- </dd>
+ </dd>
- <!-- going up to enough -->
- <dt>If the new ready state is <code
- title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code></dt>
+ <!-- going up to future -->
+ <dt>If the previous ready state was <code
+ title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
+ less, and the new ready state is <code
+ title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code></dt>
- <dd>
+ <dd>
- <p>If the previous ready state was <code
- title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
- less, the user agent must <span>queue a task</span> to <span>fire
- a simple event</span> named <code
- title="event-media-canplay">canplay</code>, and, if the element's
- <code title="dom-media-paused">paused</code> attribute is false,
- <span>queue a task</span> to <span>fire a simple event</span>
- named <code title="event-media-playing">playing</code>.</p>
-
- <p>If the <span>autoplaying flag</span> is true, and the <code
- title="dom-media-paused">paused</code> attribute is true, and the
- <span>media element</span> has an <code
- title="attr-media-autoplay">autoplay</code> attribute specified,
- and the <span>media element</span>'s <code>Document</code>'s
- <span>browsing context</span> did not have the <span>sandboxed
- automatic features browsing context flag</span> set when the
- <code>Document</code> was created, then the user agent may also
- set the <code title="dom-media-paused">paused</code> attribute to
- false, <span>queue a task</span> to <span>fire a simple
- event</span> named <code title="event-media-play">play</code>, and
- <span>queue a task</span> to <span>fire a simple event</span>
- named <code title="event-media-playing">playing</code>.</p>
+ <p>The user agent must <span>queue a task</span> to <span>fire a
+ simple event</span> named <code
+ title="event-media-canplay">canplay</code>.</p>
- <p class="note">User agents do not need to support autoplay,
- and it is suggested that user agents honor user preferences on the
- matter. Authors are urged to use the <code
- title="attr-media-autoplay">autoplay</code> attribute rather than
- using script to force the video to play, so as to allow the user
- to override the behavior if so desired.</p>
+ <p>If the element's <code title="dom-media-paused">paused</code>
+ attribute is false, the user agent must <span>queue a task</span>
+ to <span>fire a simple event</span> named <code
+ title="event-media-playing">playing</code>.</p>
- <p>In any case, the user agent must finally <span>queue a
- task</span> to <span>fire a simple event</span> named <code
- title="event-media-canplaythrough">canplaythrough</code>.</p>
+ </dd>
- </dd>
+ <!-- going up to enough -->
+ <dt>If the new ready state is <code
+ title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code></dt>
- </dl>
+ <dd>
+
+ <p>If the previous ready state was <code
+ title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
+ less, the user agent must <span>queue a task</span> to <span>fire
+ a simple event</span> named <code
+ title="event-media-canplay">canplay</code>, and, if the element's
+ <code title="dom-media-paused">paused</code> attribute is false,
+ <span>queue a task</span> to <span>fire a simple event</span>
+ named <code title="event-media-playing">playing</code>.</p>
+
+ <p>If the <span>autoplaying flag</span> is true, and the <code
+ title="dom-media-paused">paused</code> attribute is true, and the
+ <span>media element</span> has an <code
+ title="attr-media-autoplay">autoplay</code> attribute specified,
+ and the <span>media element</span>'s <code>Document</code>'s
+ <span>browsing context</span> did not have the <span>sandboxed
+ automatic features browsing context flag</span> set when the
+ <code>Document</code> was created, then the user agent may also
+ set the <code title="dom-media-paused">paused</code> attribute to
+ false, <span>queue a task</span> to <span>fire a simple
+ event</span> named <code title="event-media-play">play</code>, and
+ <span>queue a task</span> to <span>fire a simple event</span>
+ named <code title="event-media-playing">playing</code>.</p>
+
+ <p class="note">User agents do not need to support autoplay,
+ and it is suggested that user agents honor user preferences on the
+ matter. Authors are urged to use the <code
+ title="attr-media-autoplay">autoplay</code> attribute rather than
+ using script to force the video to play, so as to allow the user
+ to override the behavior if so desired.</p>
+
+ <p>In any case, the user agent must finally <span>queue a
+ task</span> to <span>fire a simple event</span> named <code
+ title="event-media-canplaythrough">canplaythrough</code>.</p>
+
+ </dd>
+
+ </dl>
+
+ </li>
+
+<!--END w3c-html--><!--CONTROLLER-->
+ <li><p>If the <span>media element</span> has a <span>current media
+ controller</span>, then <span>report the controller state</span>
+ for the <span>media element</span>'s <span>current media
+ controller</span>.</p></li>
+<!--START w3c-html--><!--CONTROLLER-->
+
+ </ol>
</div>
@@ -30443,7 +30460,19 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
<code title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code> and
the user agent has reached a point in the <span>media
resource</span> where the user has to make a selection for the
- resource to continue.</p>
+ resource to continue.
+<!--END w3c-html--><!--CONTROLLER-->
+ If the <span>media element</span> has a <span>current media
+ controller</span> when this happens, then the user agent must
+ <span>report the controller state</span> for the <span>media
+ element</span>'s <span>current media controller</span>. If If the
+ <span>media element</span> has a <span>current media
+ controller</span> when the user makes a selection, allowing playback
+ to resume, the user agent must similarly <span>report the controller
+ state</span> for the <span>media element</span>'s <span>current
+ media controller</span>.
+<!--START w3c-html--><!--CONTROLLER-->
+ </p>
<p>It is possible for a <span>media element</span> to have both
<span>ended playback</span> and <span>paused for user
@@ -30455,20 +30484,13 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
<span>fire a simple event</span> named <code
title="event-media-timeupdate">timeupdate</code> at the element.</p>
- <p id="fire-waiting-when-waiting">When a <span>media element</span>
- that is <span>potentially playing</span> stops playing because its
- <code title="dom-media-readyState">readyState</code> attribute
- changes to a value lower than <code
- title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, without
- the element having <span>ended playback</span>, or playback having
- <span>stopped due to errors</span>, or playback having <span>paused
- for user interaction</span>, or the <span
- title="dom-media-seek">seeking algorithm</span> being invoked, the
- user agent must <span>queue a task</span> to <span>fire a simple
- event</span> named <code title="event-media-timeupdate">timeupdate</code>
- at the element, and <span>queue a task</span> to <span>fire a simple
- event</span> named <code title="event-media-waiting">waiting</code> at
- the element.</p>
+ <p class="note">A <code title="event-media-waiting">waiting</code>
+ DOM event <a href="#fire-waiting-when-waiting">can be fired</a> as a
+ result of an element that is <span>potentially playing</span>
+ stopping playback due to its <code
+ title="dom-media-readyState">readyState</code> attribute changing to
+ a value lower than <code
+ title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>.</p>
<p>When the <span>current playback position</span> reaches the end
of the <span>media resource</span> when the <span>direction of
@@ -30660,6 +30682,13 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
<li><p>Set the <span>media element</span>'s <span>autoplaying
flag</span> to false.</p></li>
+<!--END w3c-html--><!--CONTROLLER-->
+ <li><p>If the <span>media element</span> has a <span>current media
+ controller</span>, then <span>report the controller state</span>
+ for the <span>media element</span>'s <span>current media
+ controller</span>.</p></li>
+<!--START w3c-html--><!--CONTROLLER-->
+
</ol>
<hr>
@@ -30704,6 +30733,13 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
</li>
+<!--END w3c-html--><!--CONTROLLER-->
+ <li><p>If the <span>media element</span> has a <span>current media
+ controller</span>, then <span>report the controller state</span>
+ for the <span>media element</span>'s <span>current media
+ controller</span>.</p></li>
+<!--START w3c-html--><!--CONTROLLER-->
+
</ol>
<hr>
@@ -31053,31 +31089,35 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
<code title="dom-media-seeking">seeking</code> IDL attribute to
false and abort these steps.</p></li>
- <li><p>Set the <span>current playback position</span> to the given
- <var title="">new playback position</var>.</p></li>
-
<li><p><span>Queue a task</span> to <span>fire a simple
event</span> named <code title="event-media-seeking">seeking</code>
at the element.</p></li>
- <li id="seekUpdate"><p><span>Queue a task</span> to <span>fire a
- simple event</span> named <code
- title="event-media-timeupdate">timeupdate</code> at the
- element.</p></li>
+ <li>
- <li><p>If the <span>media element</span> was <span>potentially
- playing</span> immediately before it started seeking, but seeking
- caused its <code title="dom-media-readyState">readyState</code>
- attribute to change to a value lower than <code
- title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, then
- <span>queue a task</span> to <span>fire a simple event</span> named
- <code title="event-media-waiting">waiting</code> at the