Skip to content

Commit

Permalink
[e] (0) Clean up the play() and pause() algorithms.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@3992 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 24, 2009
1 parent 88f89ba commit bc96eb6
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 53 deletions.
53 changes: 27 additions & 26 deletions index
Expand Up @@ -23380,16 +23380,15 @@ interface <dfn>CueRangeCallback</dfn> {
must run the following steps.</p>

<ol><li><p>If the <a href=#media-element>media element</a>'s <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute has
the value <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, then the user
agent must invoke the <a href=#media-element>media element</a>'s <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
the value <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, invoke the
<a href=#media-element>media element</a>'s <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
algorithm</a>.</li>

<li>

<p>If the <a href=#ended-playback title="ended playback">playback has ended</a>,
then the user agent must <a href=#dom-media-seek title=dom-media-seek>seek</a>
to the <a href=#earliest-possible-position>earliest possible position</a> of the <a href=#media-resource>media
resource</a>.</p>
<a href=#dom-media-seek title=dom-media-seek>seek</a> to the <a href=#earliest-possible-position>earliest
possible position</a> of the <a href=#media-resource>media resource</a>.</p>

<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
Expand All @@ -23401,13 +23400,12 @@ interface <dfn>CueRangeCallback</dfn> {

<li>

<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 run
<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, run
the following substeps:</p>

<ol><li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
<ol><li><p>Change the value of <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> to false.</li>

<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-media-play><a href=#event-media-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
Expand All @@ -23427,31 +23425,34 @@ interface <dfn>CueRangeCallback</dfn> {

</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>

<li><p>The method must then return.</li>
<li><p>Set the <a href=#media-element>media element</a>'s <a href=#autoplaying-flag>autoplaying
flag</a> to false.</li>

</ol><hr><p>When the <dfn id=dom-media-pause title=dom-media-pause><code>pause()</code></dfn>
method is invoked, the user agent must run the following steps:</p>

<ol><li><p>If the <a href=#media-element>media element</a>'s <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute has
the value <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, then the user
agent must invoke the <a href=#media-element>media element</a>'s <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
the value <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code>, invoke the
<a href=#media-element>media element</a>'s <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
algorithm</a>.</li>

<li><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 false, it must
be set to true.</li>
<li><p>Set the <a href=#media-element>media element</a>'s <a href=#autoplaying-flag>autoplaying
flag</a> to false.</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-paused><a href=#dom-media-paused>paused</a></code> attribute is false, run the
following steps:</p>

<li><p>If the second step above changed the value of <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code>, 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-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
element, and <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-media-pause><a href=#event-media-pause>pause</a></code> at the
element.</li>
<ol><li><p>Change the value of <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> to true.</li>

<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-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
element.</li>

<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-media-pause><a href=#event-media-pause>pause</a></code>
at the element.</li>

</ol></li>

</ol><hr><p id=media-playback>When a <a href=#media-element>media element</a> is
<a href=#potentially-playing>potentially playing</a> and its <code>Document</code> is an
Expand Down
60 changes: 33 additions & 27 deletions source
Expand Up @@ -25327,17 +25327,16 @@ interface <dfn>CueRangeCallback</dfn> {
<li><p>If the <span>media element</span>'s <code
title="dom-media-networkState">networkState</code> attribute has
the value <code
title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, then the user
agent must invoke the <span>media element</span>'s <span
title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, invoke the
<span>media element</span>'s <span
title="concept-media-load-algorithm">resource selection
algorithm</span>.</p></li>

<li>

<p>If the <span title="ended playback">playback has ended</span>,
then the user agent must <span title="dom-media-seek">seek</span>
to the <span>earliest possible position</span> of the <span>media
resource</span>.</p>
<span title="dom-media-seek">seek</span> to the <span>earliest
possible position</span> of the <span>media resource</span>.</p>

<p class="note">This <a href="#seekUpdate">will cause</a> the user
agent to <span>queue a task</span> to <span>fire a simple
Expand All @@ -25351,15 +25350,14 @@ interface <dfn>CueRangeCallback</dfn> {
<li>

<p>If the <span>media element</span>'s <code
title="dom-media-paused">paused</code> attribute is true, it must
be set to false.</p>

<p>If this changed the value of <code
title="dom-media-paused">paused</code>, the user agent must run
title="dom-media-paused">paused</code> attribute is true, run
the following substeps:</p>

<ol>

<li><p>Change the value of <code
title="dom-media-paused">paused</code> to false.</p></li>

<li><p><span>Queue a task</span> to <span>fire a simple event</span>
called <code title="event-media-play">play</code> at the element.</p></li>

Expand All @@ -25386,10 +25384,8 @@ interface <dfn>CueRangeCallback</dfn> {

</li>

<li><p>The <span>media element</span>'s <span>autoplaying
flag</span> must be set to false.</p></li>

<li><p>The method must then return.</p></li>
<li><p>Set the <span>media element</span>'s <span>autoplaying
flag</span> to false.</p></li>

</ol>

Expand All @@ -25403,25 +25399,35 @@ interface <dfn>CueRangeCallback</dfn> {
<li><p>If the <span>media element</span>'s <code
title="dom-media-networkState">networkState</code> attribute has
the value <code
title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, then the user
agent must invoke the <span>media element</span>'s <span
title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, invoke the
<span>media element</span>'s <span
title="concept-media-load-algorithm">resource selection
algorithm</span>.</p></li>

<li><p>Set the <span>media element</span>'s <span>autoplaying
flag</span> to false.</p></li>

<li><p>If the <span>media element</span>'s <code
title="dom-media-paused">paused</code> attribute is false, it must
be set to true.</p></li>
title="dom-media-paused">paused</code> attribute is false, run the
following steps:</p>

<li><p>The <span>media element</span>'s <span>autoplaying
flag</span> must be set to false.</p></li>
<ol>

<li><p>If the second step above changed the value of <code
title="dom-media-paused">paused</code>, then the user agent must
<span>queue a task</span> to <span>fire a simple event</span>
called <code title="event-media-timeupdate">timeupdate</code> at the
element, and <span>queue a task</span> to <span>fire a simple
event</span> called <code title="event-media-pause">pause</code> at the
element.</p></li>
<li><p>Change the value of <code
title="dom-media-paused">paused</code> to true.</p></li>

<li><p><span>Queue a task</span> to <span>fire a simple
event</span> called <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> called <code title="event-media-pause">pause</code>
at the element.</p></li>

</ol>

</li>

</ol>

Expand Down

0 comments on commit bc96eb6

Please sign in to comment.