[html5] r2497 - [gow] (2) Prevent firing double 'waiting' events in play(). Make sure we fire a [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Dec 1 04:08:24 PST 2008


Author: ianh
Date: 2008-12-01 04:08:23 -0800 (Mon, 01 Dec 2008)
New Revision: 2497

Modified:
   index
   source
Log:
[gow] (2) Prevent firing double 'waiting' events in play(). Make sure we fire a 'timeupdate' when we begin playing, even if we only paused very briefly.

Modified: index
===================================================================
--- index	2008-12-01 11:36:32 UTC (rev 2496)
+++ index	2008-12-01 12:08:23 UTC (rev 2497)
@@ -18101,7 +18101,8 @@
     <p class=note>This <a href=#seekUpdate>will cause</a> the user
     agent to <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 <a href=#media-element>media
-    element</a>.</p>
+    element</a>.</p> <!-- if we're already playing at this point,
+    it might also fire 'waiting' -->
 
    </li>
 
@@ -18112,19 +18113,17 @@
 
     <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.</p>
+    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>
 
    </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>
 
-   <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 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 <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>The method must then return.</li>
 
   </ol><hr><p>When the <dfn id=dom-media-pause title=dom-media-pause><code>pause()</code></dfn>
@@ -18222,13 +18221,16 @@
    steps.</li>
 
    <li><p>If the time was reached through the usual monotonic increase
-   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, the user agent must then <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
+   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>
 
    <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

Modified: source
===================================================================
--- source	2008-12-01 11:36:32 UTC (rev 2496)
+++ source	2008-12-01 12:08:23 UTC (rev 2497)
@@ -19602,7 +19602,8 @@
     agent to <span>queue a task</span> to <span>fire a simple
     event</span> called <code
     title="event-timeupdate">timeupdate</code> at the <span>media
-    element</span>.</p>
+    element</span>.</p> <!-- if we're already playing at this point,
+    it might also fire 'waiting' -->
 
    </li>
 
@@ -19615,21 +19616,20 @@
     <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.</p>
+    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>
 
    </li>
 
    <li><p>The <span>media element</span>'s <span>autoplaying
    flag</span> must be set to false.</p></li>
 
-   <li><p>If 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 <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>The method must then return.</p></li>
 
   </ol>
@@ -19752,15 +19752,17 @@
    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 the
-   user agent has not fired a <code
+   of the current playback position during normal playback, and if
+   either the user agent has not fired a <code
    title="event-timeupdate">timeupdate</code> event at the element in
-   the past 15 to 250ms, the user agent must then <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, 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>
 
    <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




More information about the Commit-Watchers mailing list