Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (0) Make 'playing' fire even if the video is paused for user i…
…nteraction, since otherwise you never get that event, which could be rather confusing for authors. Sadly this makes 'playing' somewhat redundant with a combination of 'canplay', 'canplaythrough', and 'play', but it's probably still useful enough.

git-svn-id: http://svn.whatwg.org/webapps@6017 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 15, 2011
1 parent 9711ca0 commit 8518770
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 47 deletions.
30 changes: 15 additions & 15 deletions complete.html
Expand Up @@ -27744,9 +27744,9 @@ <h5 id=the-ready-states><span class=secno>4.8.10.7 </span>The ready states</h5>
<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 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> named <code title=event-media-playing><a href=#event-media-playing>playing</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>

Expand All @@ -27757,9 +27757,10 @@ <h5 id=the-ready-states><span class=secno>4.8.10.7 </span>The ready states</h5>

<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 is also
<a href=#potentially-playing>potentially playing</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-media-playing><a href=#event-media-playing>playing</a></code>.</p>
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,
Expand Down Expand Up @@ -28152,10 +28153,10 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the

<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>; if
the <a href=#media-element>media element</a> is <a href=#potentially-playing>potentially
playing</a>, 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-playing><a href=#event-media-playing>playing</a></code> at the element.</p>
<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>
named <code title=event-media-playing><a href=#event-media-playing>playing</a></code> at the
element.</p>

</li>

Expand Down Expand Up @@ -33087,13 +33088,12 @@ <h5 id=mediaevents><span class=secno>4.8.10.16 </span>Event summary</h5>
<td><code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is newly equal to <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code>.
<tr><td><dfn id=event-media-playing title=event-media-playing><code>playing</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>Playback has started after having been delayed due to lack of <a href=#media-data>media data</a>.
<td>The element is newly <a href=#potentially-playing>potentially playing</a>, either because <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>, or because <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is newly false. It is possible for playback to start without this event firing, e.g. if when playback would have started,
<td>Playback is ready to start after having been paused or delayed due to lack of <a href=#media-data>media data</a>.
<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> and <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is false, or <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is newly false and <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is equal to or greater than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>. Even if this event fires, the element might still not be <a href=#potentially-playing>potentially playing</a>, e.g. if
<!--CONTROLLER-->
the element was <a href=#blocked-on-its-media-controller>blocked on its media controller</a>, or
the element is <a href=#blocked-on-its-media-controller>blocked on its media controller</a> (e.g. because the <a href=#current-media-controller>current media controller</a> is paused, or another <a href=#slaved-media-elements title="slaved media elements">slaved media element</a> is stalled somehow, or because the <a href=#media-resource>media resource</a> has no data corresponding to the <a href=#media-controller-position>media controller position</a>), or
<!--CONTROLLER-->
the element had been <a href=#paused-for-user-interaction>paused for user interaction</a>.
<!-- XXXXX we should change this so that 'playing' fires in those three cases too (when readyState/paused change, not when playback actually starts) -->
the element is <a href=#paused-for-user-interaction>paused for user interaction</a>.
<tr><td><dfn id=event-media-waiting title=event-media-waiting><code>waiting</code></dfn>
<td><code><a href=#event>Event</a></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.
Expand Down
30 changes: 15 additions & 15 deletions index
Expand Up @@ -27756,9 +27756,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<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 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> named <code title=event-media-playing><a href=#event-media-playing>playing</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>

Expand All @@ -27769,9 +27769,10 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael

<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 is also
<a href=#potentially-playing>potentially playing</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-media-playing><a href=#event-media-playing>playing</a></code>.</p>
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,
Expand Down Expand Up @@ -28164,10 +28165,10 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael

<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>; if
the <a href=#media-element>media element</a> is <a href=#potentially-playing>potentially
playing</a>, 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-playing><a href=#event-media-playing>playing</a></code> at the element.</p>
<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>
named <code title=event-media-playing><a href=#event-media-playing>playing</a></code> at the
element.</p>

</li>

Expand Down Expand Up @@ -33099,13 +33100,12 @@ interface <dfn id=texttrackcue>TextTrackCue</dfn> {
<td><code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is newly equal to <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code>.
<tr><td><dfn id=event-media-playing title=event-media-playing><code>playing</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>Playback has started after having been delayed due to lack of <a href=#media-data>media data</a>.
<td>The element is newly <a href=#potentially-playing>potentially playing</a>, either because <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>, or because <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is newly false. It is possible for playback to start without this event firing, e.g. if when playback would have started,
<td>Playback is ready to start after having been paused or delayed due to lack of <a href=#media-data>media data</a>.
<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> and <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is false, or <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> is newly false and <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is equal to or greater than <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code>. Even if this event fires, the element might still not be <a href=#potentially-playing>potentially playing</a>, e.g. if
<!--CONTROLLER-->
the element was <a href=#blocked-on-its-media-controller>blocked on its media controller</a>, or
the element is <a href=#blocked-on-its-media-controller>blocked on its media controller</a> (e.g. because the <a href=#current-media-controller>current media controller</a> is paused, or another <a href=#slaved-media-elements title="slaved media elements">slaved media element</a> is stalled somehow, or because the <a href=#media-resource>media resource</a> has no data corresponding to the <a href=#media-controller-position>media controller position</a>), or
<!--CONTROLLER-->
the element had been <a href=#paused-for-user-interaction>paused for user interaction</a>.
<!-- XXXXX we should change this so that 'playing' fires in those three cases too (when readyState/paused change, not when playback actually starts) -->
the element is <a href=#paused-for-user-interaction>paused for user interaction</a>.
<tr><td><dfn id=event-media-waiting title=event-media-waiting><code>waiting</code></dfn>
<td><code><a href=#event>Event</a></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.
Expand Down
32 changes: 15 additions & 17 deletions source
Expand Up @@ -30151,9 +30151,9 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
simple event</span> named <code
title="event-media-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> named <code
<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>

</dd>
Expand All @@ -30168,10 +30168,10 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
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 is also
<span>potentially playing</span>, <span>queue a task</span> to
<span>fire a simple event</span> named <code
title="event-media-playing">playing</code>.</p>
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
Expand Down Expand Up @@ -30646,11 +30646,10 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
value <code
title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or
<code
title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>; if
the <span>media element</span> is <span>potentially
playing</span>, then <span>queue a task</span> to <span>fire a
simple event</span> named <code
title="event-media-playing">playing</code> at the element.</p>
title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>:
<span>queue a task</span> to <span>fire a simple event</span>
named <code title="event-media-playing">playing</code> at the
element.</p>

</li>

Expand Down Expand Up @@ -36399,13 +36398,12 @@ interface <dfn>TextTrackCue</dfn> {
<tr>
<td><dfn title="event-media-playing"><code>playing</code></dfn>
<td><code>Event</code>
<td>Playback has started after having been delayed due to lack of <span>media data</span>.
<td>The element is newly <span>potentially playing</span>, either because <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>, or because <code title="dom-media-paused">paused</code> is newly false. It is possible for playback to start without this event firing, e.g. if when playback would have started,
<td>Playback is ready to start after having been paused or delayed due to lack of <span>media data</span>.
<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> and <code title="dom-media-paused">paused</code> is false, or <code title="dom-media-paused">paused</code> is newly false and <code title="dom-media-readyState">readyState</code> is equal to or greater than <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>. Even if this event fires, the element might still not be <span>potentially playing</span>, e.g. if
<!--END w3c-html--><!--CONTROLLER-->
the element was <span>blocked on its media controller</span>, or
the element is <span>blocked on its media controller</span> (e.g. because the <span>current media controller</span> is paused, or another <span title="slaved media elements">slaved media element</span> is stalled somehow, or because the <span>media resource</span> has no data corresponding to the <span>media controller position</span>), or
<!--START w3c-html--><!--CONTROLLER-->
the element had been <span>paused for user interaction</span>.
<!-- XXXXX we should change this so that 'playing' fires in those three cases too (when readyState/paused change, not when playback actually starts) -->
the element is <span>paused for user interaction</span>.
<tr>
<td><dfn title="event-media-waiting"><code>waiting</code></dfn>
<td><code>Event</code>
Expand Down

0 comments on commit 8518770

Please sign in to comment.