[html5] r2498 - [gow] (2) New plan. Introduce a 'playing' event for when the playback actually b [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Dec 1 04:31:22 PST 2008


Author: ianh
Date: 2008-12-01 04:31:21 -0800 (Mon, 01 Dec 2008)
New Revision: 2498

Modified:
   index
   source
Log:
[gow] (2) New plan. Introduce a 'playing' event for when the playback actually begins.

Modified: index
===================================================================
--- index	2008-12-01 12:08:23 UTC (rev 2497)
+++ index	2008-12-01 12:31:21 UTC (rev 2498)
@@ -17859,9 +17859,17 @@
    <dt>If the prevous 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>
 
-   <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> called <code title=event-canplay><a href=#event-canplay>canplay</a></code>.</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> called <code title=event-canplay><a href=#event-canplay>canplay</a></code>.</p>
+
+    <p>If the element is <a href=#potentially-playing>potentially playing</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> called <code title=event-playing><a href=#event-playing>playing</a></code>.</p>
+
+   </dd>
+
    <!-- 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>
 
@@ -17883,6 +17891,11 @@
     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 is now <a href=#potentially-playing>potentially playing</a>, and the
+    previous ready state was not <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, 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> called <code title=event-playing><a href=#event-playing>playing</a></code>.</p>
+
    </dd>
 
   </dl><p class=note>It is possible for the ready state of a media
@@ -18111,16 +18124,27 @@
     <p>If the <a href=#media-element>media element</a>'s <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is true, it must
     be set to false.</p>
 
-    <p>If this changed the value of <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>, 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>
-    called <code title=event-play><a href=#event-play>play</a></code> at the element; if, in
-    addition, the <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute has a
-    value lower than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, the
-    user agent must also <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
-    simple event</a> called <code title=event-waiting><a href=#event-waiting>waiting</a></code> at the element.</p>
+    <p>If this changed the value of <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>, the user agent must run the following substeps:</p>
 
-   </li>
+    <ol><li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+     called <code title=event-play><a href=#event-play>play</a></code> at the element.</li>
 
+     <li><p>If the <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute has the
+     value <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>
+     or <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>,
+     <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+     called <code title=event-waiting><a href=#event-waiting>waiting</a></code> at the
+     element.</li>
+
+     <li><p>Otherwise, the <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute has the value
+     <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>;
+     <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
+     called <code title=event-playing><a href=#event-playing>playing</a></code> at the
+     element.</li>
+
+    </ol></li>
+
    <li><p>The <a href=#media-element>media element</a>'s <a href=#autoplaying-flag>autoplaying
    flag</a> must be set to false.</li>
 
@@ -18221,16 +18245,13 @@
    steps.</li>
 
    <li><p>If the time was reached through the usual monotonic increase
-   of the current playback position during normal playback, and if
-   either the user agent has not fired a <code title=event-timeupdate><a href=#event-timeupdate>timeupdate</a></code> event at the element in
-   the past 15 to 250ms, or there has been an instant since the last
-   time such an event was fired that the element was not
-   <a href=#potentially-playing>potentially playing</a>, then 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>
-   called <code title=event-timeupdate><a href=#event-timeupdate>timeupdate</a></code> at the
-   element. (In the other cases, such as explicit seeks, relevant
-   events get fired as part of the overall process of changing the
-   current playback position.)</p>
+   of the current playback position during normal playback, and if the
+   user agent has not fired a <code title=event-timeupdate><a href=#event-timeupdate>timeupdate</a></code> event at the element in
+   the past 15 to 250ms, then 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> called <code title=event-timeupdate><a href=#event-timeupdate>timeupdate</a></code> at the element. (In the
+   other cases, such as explicit seeks, relevant events get fired as
+   part of the overall process of changing the current playback
+   position.)</p>
 
    <p class=note>The event thus is not to be fired faster than about
    66Hz or slower than 4Hz. User agents are encouraged to vary the
@@ -18541,7 +18562,7 @@
 
    <tbody><tr><td><dfn id=event-play title=event-play><code>play</code></dfn>
      <td><code>Event</code>
-     <td>Playback has begun. Fired after the <code title=dom-media-play><a href=#dom-media-play>play</a></code> method has returned.
+     <td>Playback has begun. Fired after the <code title=dom-media-play><a href=#dom-media-play>play()</a></code> method has returned.
      <td><code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is newly false.
     <tr><td><dfn id=event-pause title=event-pause><code>pause</code></dfn>
      <td><code>Event</code>
@@ -18560,6 +18581,10 @@
      <td><code>Event</code>
      <td>Playback has stopped because the next frame is not available, but the user agent expects that frame to become available in due course.
      <td><code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is newly equal to or less than <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>, and <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is false. Either <code title=dom-media-seeking><a href=#dom-media-seeking>seeking</a></code> is true, or the <a href=#current-playback-position>current playback position</a> is not contained in any of the ranges in <code title=dom-media-buffered><a href=#dom-media-buffered>buffered</a></code>. It is possible for playback to stop for two other reasons without <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> being false, but those two reasons do not fire this event: maybe <a href=#ended-playback title="ended playback">playback ended</a>, or playback <a href=#stopped-due-to-errors>stopped due to errors</a>.
+    <tr><td><dfn id=event-playing title=event-playing><code>playing</code></dfn>
+     <td><code>Event</code>
+     <td>Playback has started.
+     <td><code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is newly equal to or greater than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>, <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is false, <code title=dom-media-seeking><a href=#dom-media-seeking>seeking</a></code> is false, or the <a href=#current-playback-position>current playback position</a> is contained in one of the ranges in <code title=dom-media-buffered><a href=#dom-media-buffered>buffered</a></code>.
     <tr><td><dfn id=event-canplay title=event-canplay><code>canplay</code></dfn>
      <td><code>Event</code>
      <td>The user agent can resume playback of the <a href=#media-data>media data</a>, but estimates that if playback were to be started now, the <a href=#media-resource>media resource</a> could not be rendered at the current playback rate up to its end without having to stop for further buffering of content.

Modified: source
===================================================================
--- source	2008-12-01 12:08:23 UTC (rev 2497)
+++ source	2008-12-01 12:31:21 UTC (rev 2498)
@@ -19299,10 +19299,19 @@
    less, and the new ready state is <code
    title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code></dt>
 
-   <dd><p>The user agent must <span>queue a task</span> to
-   <span>fire a simple event</span> called <code
-   title="event-canplay">canplay</code>.</p></dd>
+   <dd>
 
+    <p>The user agent must <span>queue a task</span> to <span>fire a
+    simple event</span> called <code
+    title="event-canplay">canplay</code>.</p>
+
+    <p>If the element is <span>potentially playing</span>, the user
+    agent must <span>queue a task</span> to <span>fire a simple
+    event</span> called <code
+    title="event-playing">playing</code>.</p>
+
+   </dd>
+
    <!-- going up to enough -->
    <dt>If the new ready state is <code
    title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code></dt>
@@ -19331,6 +19340,13 @@
     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 is now <span>potentially playing</span>, and the
+    previous ready state was not <code
+    title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, the
+    user agent must <span>queue a task</span> to <span>fire a simple
+    event</span> called <code
+    title="event-playing">playing</code>.</p>
+
    </dd>
 
   </dl>
@@ -19614,17 +19630,33 @@
     be set to false.</p>
 
     <p>If this changed the value of <code
-    title="dom-media-paused">paused</code>, the user agent must
-    <span>queue a task</span> to <span>fire a simple event</span>
-    called <code title="event-play">play</code> at the element; if, in
-    addition, the <span>media element</span>'s <code
-    title="dom-media-readyState">readyState</code> attribute has a
-    value lower than <code
-    title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, the
-    user agent must also <span>queue a task</span> to <span>fire a
-    simple event</span> called <code
-    title="event-waiting">waiting</code> at the element.</p>
+    title="dom-media-paused">paused</code>, the user agent must run the following substeps:</p>
 
+    <ol>
+
+     <li><p><span>Queue a task</span> to <span>fire a simple event</span>
+     called <code title="event-play">play</code> at the element.</p></li>
+
+     <li><p>If the <span>media element</span>'s <code
+     title="dom-media-readyState">readyState</code> attribute has the
+     value <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code>
+     or <code
+     title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>,
+     <span>queue a task</span> to <span>fire a simple event</span>
+     called <code title="event-waiting">waiting</code> at the
+     element.</p></li>
+
+     <li><p>Otherwise, the <span>media element</span>'s <code
+     title="dom-media-readyState">readyState</code> attribute has the value
+     <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>
+     or <code
+     title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>;
+     <span>queue a task</span> to <span>fire a simple event</span>
+     called <code title="event-playing">playing</code> at the
+     element.</p></li>
+
+    </ol>
+
    </li>
 
    <li><p>The <span>media element</span>'s <span>autoplaying
@@ -19752,17 +19784,15 @@
    steps.</p></li>
 
    <li><p>If the time was reached through the usual monotonic increase
-   of the current playback position during normal playback, and if
-   either the user agent has not fired a <code
+   of the current playback position during normal playback, and if the
+   user agent has not fired a <code
    title="event-timeupdate">timeupdate</code> event at the element in
-   the past 15 to 250ms, or there has been an instant since the last
-   time such an event was fired that the element was not
-   <span>potentially playing</span>, then the user agent must
-   <span>queue a task</span> to <span>fire a simple event</span>
-   called <code title="event-timeupdate">timeupdate</code> at the
-   element. (In the other cases, such as explicit seeks, relevant
-   events get fired as part of the overall process of changing the
-   current playback position.)</p>
+   the past 15 to 250ms, then the user agent must <span>queue a
+   task</span> to <span>fire a simple event</span> called <code
+   title="event-timeupdate">timeupdate</code> at the element. (In the
+   other cases, such as explicit seeks, relevant events get fired as
+   part of the overall process of changing the current playback
+   position.)</p>
 
    <p class="note">The event thus is not to be fired faster than about
    66Hz or slower than 4Hz. User agents are encouraged to vary the
@@ -20120,7 +20150,7 @@
     <tr>
      <td><dfn title="event-play"><code>play</code></dfn>
      <td><code>Event</code>
-     <td>Playback has begun. Fired after the <code title="dom-media-play">play</code> method has returned.
+     <td>Playback has begun. Fired after the <code title="dom-media-play">play()</code> method has returned.
      <td><code title="dom-media-paused">paused</code> is newly false.
     <tr>
      <td><dfn title="event-pause"><code>pause</code></dfn>
@@ -20145,6 +20175,11 @@
      <td>Playback has stopped because the next frame is not available, but the user agent expects that frame to become available in due course.
      <td><code title="dom-media-readyState">readyState</code> is newly equal to or less than <code title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>, and <code title="dom-media-paused">paused</code> is false. Either <code title="dom-media-seeking">seeking</code> is true, or the <span>current playback position</span> is not contained in any of the ranges in <code title="dom-media-buffered">buffered</code>. It is possible for playback to stop for two other reasons without <code title="dom-media-paused">paused</code> being false, but those two reasons do not fire this event: maybe <span title="ended playback">playback ended</span>, or playback <span>stopped due to errors</span>.
     <tr>
+     <td><dfn title="event-playing"><code>playing</code></dfn>
+     <td><code>Event</code>
+     <td>Playback has started.
+     <td><code title="dom-media-readyState">readyState</code> is newly equal to or greater than <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, <code title="dom-media-paused">paused</code> is false, <code title="dom-media-seeking">seeking</code> is false, or the <span>current playback position</span> is contained in one of the ranges in <code title="dom-media-buffered">buffered</code>.
+    <tr>
      <td><dfn title="event-canplay"><code>canplay</code></dfn>
      <td><code>Event</code>
      <td>The user agent can resume playback of the <span>media data</span>, but estimates that if playback were to be started now, the <span>media resource</span> could not be rendered at the current playback rate up to its end without having to stop for further buffering of content.




More information about the Commit-Watchers mailing list