HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/6562

SVNBugCommentTime (UTC)
656212559[Gecko] [Internet Explorer] [Opera] [Webkit] When a media element ends, pause it. Same for MediaControllers. Also a bunch of minor editorial tweaks.2011-09-22 22:27
Index: source
===================================================================
--- source	(revision 6561)
+++ source	(revision 6562)
@@ -30845,9 +30845,10 @@
   </ul>
 
   <p>The <dfn title="dom-media-ended"><code>ended</code></dfn>
-  attribute must return true if the <span>media element</span> has
+  attribute must return true if, the last time the <span>event
+  loop</span> reached step 1, the <span>media element</span> had
   <span>ended playback</span> and the <span>direction of
-  playback</span> is forwards, and false otherwise.</p>
+  playback</span> was forwards, and false otherwise.</p>
 
   <p>A <span>media element</span> is said to have <dfn>stopped due to
   errors</dfn> when the element's <code
@@ -30870,7 +30871,7 @@
   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
+  element</span>'s <span>current media controller</span>. 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
@@ -30915,37 +30916,45 @@
    inexplicable (since the normally matching 'ended' given below event
    doesn't fire in the loop case). -->
 
-   <li><p>Stop playback.</p><p class="note">The <code
-   title="dom-media-ended">ended</code> attribute becomes
-   true.</p></li>
+   <li><p>As defined above, the <code
+   title="dom-media-ended">ended</code> IDL attribute starts returning
+   true once the <span>event loop</span>'s current <span
+   title="concept-task">task</span> ends.</p></li>
 
-   <li><p>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.</p></li>
+   <li><p><span>Queue a task</span> to <span>fire a simple
+   event</span> named <code
+   title="event-media-timeupdate">timeupdate</code> at the <span>media
+   element</span>.</p></li>
 
-   <li><p>The user agent must <span>queue a task</span> to <span>fire
-   a simple event</span> named <code title="event-media-ended">ended</code>
-   at the element.</p></li>
+   <li><p><span>Queue a task</span> that, if the <span>media
+   element</span> does not have a <span>current media
+   controller</span>, and the <span>media element</span> has still
+   <span>ended playback</span>, and the <span>direction of
+   playback</span> is still forwards, and <span
+   title="dom-media-paused">paused</span> is false, changes <span
+   title="dom-media-paused">paused</span> to true and <span
+   title="fire a simple event">fires a simple event</span> named <code
+   title="event-media-pause">pause</code> at the <span>media
+   element</span>.</p></li>
 
+   <li><p><span>Queue a task</span> to <span>fire a simple
+   event</span> named <code title="event-media-ended">ended</code> at
+   the <span>media element</span>.</p></li>
+
+   <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>
+
   </ol>
 
   <p>When the <span>current playback position</span> reaches the
   <span>earliest possible position</span> of the <span>media
   resource</span> when the <span>direction of playback</span> is
-  backwards, then the user agent must follow these steps:</p>
+  backwards, then the user agent must only <span>queue a task</span>
+  to <span>fire a simple event</span> named <code
+  title="event-media-timeupdate">timeupdate</code> at the element.</p>
 
-  <ol>
-
-   <li><p>Stop playback.</p></li>
-
-   <li><p>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.</p></li>
-
-  </ol>
-
   <hr>
 
   <p>The <dfn
@@ -32356,31 +32365,31 @@
 
    </dd>
 
-   <dt><var title="">controller</var> . <code title="dom-MediaController-played">played</code></dt>
+   <dt><var title="">controller</var> . <code title="dom-MediaController-play">play</code>()</dt>
 
    <dd>
 
-    <p>Returns a <code>TimeRanges</code> object that represents the
-    union of the time ranges in all the slaved <span title="media
-    element">media elements</span> that have been played.</p>
+    <p>Sets the <code title="dom-MediaController-paused">paused</code>
+    attribute to false.</p>
 
    </dd>
 
-   <dt><var title="">controller</var> . <code title="dom-MediaController-play">play</code>()</dt>
+   <dt><var title="">controller</var> . <code title="dom-MediaController-pause">pause</code>()</dt>
 
    <dd>
 
     <p>Sets the <code title="dom-MediaController-paused">paused</code>
-    attribute to false.</p>
+    attribute to true.</p>
 
    </dd>
 
-   <dt><var title="">controller</var> . <code title="dom-MediaController-pause">pause</code>()</dt>
+   <dt><var title="">controller</var> . <code title="dom-MediaController-played">played</code></dt>
 
    <dd>
 
-    <p>Sets the <code title="dom-MediaController-paused">paused</code>
-    attribute to true.</p>
+    <p>Returns a <code>TimeRanges</code> object that represents the
+    union of the time ranges in all the slaved <span title="media
+    element">media elements</span> that have been played.</p>
 
    </dd>
 
@@ -32548,15 +32557,6 @@
   object is a <span>paused media controller</span>, and false
   otherwise.</p>
 
-  <p>The <dfn
-  title="dom-MediaController-played"><code>played</code></dfn>
-  attribute must return a new static <span>normalized
-  <code>TimeRanges</code> object</span> that represents the union of
-  the ranges of the <span title="media resource">media
-  resources</span> of the <span>slaved media elements</span> that the
-  user agent has so far rendered, at the time the attribute is
-  evaluated.</p>
-
   <p>When the <dfn
   title="dom-MediaController-pause"><code>pause()</code></dfn> method
   is invoked, if the <code>MediaController</code> is a <span>playing
@@ -32579,6 +32579,15 @@
   <code>MediaController</code>, and then <span>report the controller
   state</span> of the <code>MediaController</code>.</p>
 
+  <p>The <dfn
+  title="dom-MediaController-played"><code>played</code></dfn>
+  attribute must return a new static <span>normalized
+  <code>TimeRanges</code> object</span> that represents the union of
+  the ranges of the <span title="media resource">media
+  resources</span> of the <span>slaved media elements</span> that the
+  user agent has so far rendered, at the time the attribute is
+  evaluated.</p>
+
   <hr>
 
   <p>A <code>MediaController</code> has a <dfn>media controller
@@ -32884,6 +32893,21 @@
 
    <li><p>If the <code>MediaController</code>'s <span>most recently
    reported playback state</span> is not equal to <var title="">new
+   playback state</var> and the <var title="">new playback state</var>
+   is <i>ended</i>, then <span>queue a task</span> that, if the
+   <code>MediaController</code> object is a <span>playing media
+   controller</span>, and all of the <code>MediaController</code>'s
+   <span>slaved media elements</span> have still <span>ended
+   playback</span>, and the <span>media controller playback
+   rate</span> is still positive or zero, changes the
+   <code>MediaController</code> object to a <span>paused media
+   controller</span> and then <span title="fire a simple event">fires
+   a simple event</span> named <code
+   title="event-MediaController-pause">pause</code> at the
+   <code>MediaController</code> object.</p></li>
+
+   <li><p>If the <code>MediaController</code>'s <span>most recently
+   reported playback state</span> is not equal to <var title="">new
    playback state</var> then <span>queue a task</span> to <span>fire a
    simple event</span> at the <code>MediaController</code> object,
    whose name is <code

|