Skip to content

Commit

Permalink
[gow] (2) Prevent firing double 'waiting' events in play(). Make sure…
Browse files Browse the repository at this point in the history
… we fire a 'timeupdate' when we begin playing, even if we only paused very briefly.

git-svn-id: http://svn.whatwg.org/webapps@2497 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 1, 2008
1 parent d17fff0 commit cf9a9b5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
32 changes: 17 additions & 15 deletions index
Expand Up @@ -18101,7 +18101,8 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<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>

Expand All @@ -18112,19 +18113,17 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael

<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>
Expand Down Expand Up @@ -18222,13 +18221,16 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
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
Expand Down
38 changes: 20 additions & 18 deletions source
Expand Up @@ -19602,7 +19602,8 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>

Expand All @@ -19615,21 +19616,20 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<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>
Expand Down Expand Up @@ -19752,15 +19752,17 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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
Expand Down

0 comments on commit cf9a9b5

Please sign in to comment.