Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[gow] (2) Fix a variety of issues with how media playback works when …
…playbackRate is backwards.

git-svn-id: http://svn.whatwg.org/webapps@3012 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 28, 2009
1 parent 1452249 commit e818db7
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 47 deletions.
69 changes: 47 additions & 22 deletions index
Expand Up @@ -20918,30 +20918,36 @@ interface <dfn id=cuerangecallback>CueRangeCallback</dfn> {
<dt><dfn id=dom-media-have_current_data title=dom-media-HAVE_CURRENT_DATA><code>HAVE_CURRENT_DATA</code></dfn> (numeric value 2)</dt>

<dd>Data for the immediate <a href=#current-playback-position>current playback position</a>
is available, but not enough data is available that the user agent
could successfully advance the <a href=#current-playback-position>current playback
position</a> at all without immediately reverting to the <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> state. For
example, in video this corresponds to the user agent having data
from the current frame, but not the next frame.</dd>
is available, but either not enough data is available that the user
agent could successfully advance the <a href=#current-playback-position>current playback
position</a> in the <a href=#direction-of-playback>direction of playback</a> at all
without immediately reverting to the <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> state, or
there is no more data to obtain in the <a href=#direction-of-playback>direction of
playback</a>. For example, in video this corresponds to the user
agent having data from the current frame, but not the next frame;
and to when <a href=#ended-playback title="ended playback">playback has
ended</a>.</dd>

<dt><dfn id=dom-media-have_future_data title=dom-media-HAVE_FUTURE_DATA><code>HAVE_FUTURE_DATA</code></dfn> (numeric value 3)</dt>

<dd>Data for the immediate <a href=#current-playback-position>current playback position</a>
is available, as well as enough data for the user agent to advance
the <a href=#current-playback-position>current playback position</a> at least a little
without immediately reverting to the <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> state. For
example, In video this corresponds to the user agent having data
for at least the current frame and the next frame.</dd>
the <a href=#current-playback-position>current playback position</a> in the <a href=#direction-of-playback>direction
of playback</a> at least a little without immediately reverting
to the <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code>
state. For example, in video this corresponds to the user agent
having data for at least the current frame and the next frame. The
user agent cannot be in this state if <a href=#ended-playback title="ended
playback">playback has ended</a>, as the <a href=#current-playback-position>current playback
position</a> can never advanced in this case.</dd>

<dt><dfn id=dom-media-have_enough_data title=dom-media-HAVE_ENOUGH_DATA><code>HAVE_ENOUGH_DATA</code></dfn> (numeric value 4)</dt>

<dd>Data for the immediate <a href=#current-playback-position>current playback position</a>
is available, as well as enough data for the user agent to advance
the <a href=#current-playback-position>current playback position</a> at least a little
without immediately reverting to the <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> state, and,
in addition, the user agent estimates that data is being fetched at
a rate where the <a href=#current-playback-position>current playback position</a>, if it were
to advance at the rate given by the <code title=dom-media-defaultPlaybackRate><a href=#dom-media-defaultplaybackrate>defaultPlaybackRate</a></code>
<dd>All the conditions described for the <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> state
are met, and, in addition, the user agent estimates that data is
being fetched at a rate where the <a href=#current-playback-position>current playback
position</a>, if it were to advance at the rate given by the
<code title=dom-media-defaultPlaybackRate><a href=#dom-media-defaultplaybackrate>defaultPlaybackRate</a></code>
attribute, would not overtake the available data before playback
reaches the end of the <a href=#media-resource>media resource</a>.</dd>

Expand Down Expand Up @@ -21241,14 +21247,18 @@ interface <dfn id=cuerangecallback>CueRangeCallback</dfn> {

<p>A <a href=#media-element>media element</a> is said to have <dfn id=ended-playback>ended
playback</dfn> when the element's <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> or greater, and
the <a href=#current-playback-position>current playback position</a> is the end of the
<a href=#media-resource>media resource</a>, and the <a href=#media-element>media element</a> does
either the <a href=#current-playback-position>current playback position</a> is the end of the
<a href=#media-resource>media resource</a> and the <a href=#direction-of-playback>direction of
playback</a> is forwards and the <a href=#media-element>media element</a> does
not have a <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code> attribute
specified.</p>
specified, or the <a href=#current-playback-position>current playback position</a> is the
<var><a href=#earliest-possible-position>earliest possible position</a></var> and the <a href=#direction-of-playback>direction of
playback</a> is backwards.</p>

<p>The <dfn id=dom-media-ended title=dom-media-ended><code>ended</code></dfn>
attribute must return true if the <a href=#media-element>media element</a> has
<a href=#ended-playback>ended playback</a>, and false otherwise.</p>
<a href=#ended-playback>ended playback</a> and the <a href=#direction-of-playback>direction of
playback</a> is forwards, and false otherwise.</p>

<p>A <a href=#media-element>media element</a> is said to have <dfn id=stopped-due-to-errors>stopped due to
errors</dfn> when the element's <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> or greater, and
Expand Down Expand Up @@ -21288,8 +21298,9 @@ interface <dfn id=cuerangecallback>CueRangeCallback</dfn> {
the element.</p>

<p>When the <a href=#current-playback-position>current playback position</a> reaches the end
of the <a href=#media-resource>media resource</a>, then the user agent must follow
these steps:</p>
of the <a href=#media-resource>media resource</a> when the <a href=#direction-of-playback>direction of
playback</a> is forwards, then the user agent must follow these
steps:</p>

<ol><li><p>If the <a href=#media-element>media element</a> has a <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code> attribute specified, then <a href=#dom-media-seek title=dom-media-seek>seek</a> to the <var><a href=#earliest-possible-position>earliest possible
position</a></var> of the <a href=#media-resource>media resource</a> and abort these
Expand All @@ -21310,6 +21321,16 @@ interface <dfn id=cuerangecallback>CueRangeCallback</dfn> {
a simple event</a> called <code title=event-ended><a href=#event-ended>ended</a></code>
at the element.</li>

</ol><p>When the <a href=#current-playback-position>current playback position</a> reaches the
<var><a href=#earliest-possible-position>earliest possible position</a></var> of the <a href=#media-resource>media
resource</a> when the <a href=#direction-of-playback>direction of playback</a> is
backwards, then the user agent must follow these steps:</p>

<ol><li><p>Stop playback.</li>

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

</ol><p>The <dfn id=dom-media-defaultplaybackrate title=dom-media-defaultPlaybackRate><code>defaultPlaybackRate</code></dfn>
attribute gives the desired speed at which the <a href=#media-resource>media
resource</a> is to play, as a multiple of its intrinsic
Expand All @@ -21328,6 +21349,10 @@ interface <dfn id=cuerangecallback>CueRangeCallback</dfn> {
value, and the playback must change speed (if the element is
<a href=#potentially-playing>potentially playing</a>).</p>

<p>If the <code title=dom-media-playbackRate><a href=#dom-media-playbackrate>playbackRate</a></code>
is positive or zero, then the <dfn id=direction-of-playback>direction of playback</dfn> is
forwards. Otherwise, it is backwards.</p>

<p>The "play" function in a user agent's interface must set the
<code title=dom-media-playbackRate><a href=#dom-media-playbackrate>playbackRate</a></code> attribute
to the value of the <code title=dom-media-defaultPlaybackRate><a href=#dom-media-defaultplaybackrate>defaultPlaybackRate</a></code>
Expand Down
79 changes: 54 additions & 25 deletions source
Expand Up @@ -22672,33 +22672,38 @@ interface <dfn>CueRangeCallback</dfn> {
<dt><dfn title="dom-media-HAVE_CURRENT_DATA"><code>HAVE_CURRENT_DATA</code></dfn> (numeric value 2)</dt>

<dd>Data for the immediate <span>current playback position</span>
is available, but not enough data is available that the user agent
could successfully advance the <span>current playback
position</span> at all without immediately reverting to the <code
title="dom-media-HAVE_METADATA">HAVE_METADATA</code> state. For
example, in video this corresponds to the user agent having data
from the current frame, but not the next frame.</dd>
is available, but either not enough data is available that the user
agent could successfully advance the <span>current playback
position</span> in the <span>direction of playback</span> at all
without immediately reverting to the <code
title="dom-media-HAVE_METADATA">HAVE_METADATA</code> state, or
there is no more data to obtain in the <span>direction of
playback</span>. For example, in video this corresponds to the user
agent having data from the current frame, but not the next frame;
and to when <span title="ended playback">playback has
ended</span>.</dd>

<dt><dfn title="dom-media-HAVE_FUTURE_DATA"><code>HAVE_FUTURE_DATA</code></dfn> (numeric value 3)</dt>

<dd>Data for the immediate <span>current playback position</span>
is available, as well as enough data for the user agent to advance
the <span>current playback position</span> at least a little
without immediately reverting to the <code
title="dom-media-HAVE_METADATA">HAVE_METADATA</code> state. For
example, In video this corresponds to the user agent having data
for at least the current frame and the next frame.</dd>
the <span>current playback position</span> in the <span>direction
of playback</span> at least a little without immediately reverting
to the <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code>
state. For example, in video this corresponds to the user agent
having data for at least the current frame and the next frame. The
user agent cannot be in this state if <span title="ended
playback">playback has ended</span>, as the <span>current playback
position</span> can never advanced in this case.</dd>

<dt><dfn title="dom-media-HAVE_ENOUGH_DATA"><code>HAVE_ENOUGH_DATA</code></dfn> (numeric value 4)</dt>

<dd>Data for the immediate <span>current playback position</span>
is available, as well as enough data for the user agent to advance
the <span>current playback position</span> at least a little
without immediately reverting to the <code
title="dom-media-HAVE_METADATA">HAVE_METADATA</code> state, and,
in addition, the user agent estimates that data is being fetched at
a rate where the <span>current playback position</span>, if it were
to advance at the rate given by the <code
<dd>All the conditions described for the <code
title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> state
are met, and, in addition, the user agent estimates that data is
being fetched at a rate where the <span>current playback
position</span>, if it were to advance at the rate given by the
<code
title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>
attribute, would not overtake the available data before playback
reaches the end of the <span>media resource</span>.</dd>
Expand Down Expand Up @@ -23063,14 +23068,18 @@ interface <dfn>CueRangeCallback</dfn> {
playback</dfn> when the element's <code
title="dom-media-readyState">readyState</code> attribute is <code
title="dom-media-HAVE_METADATA">HAVE_METADATA</code> or greater, and
the <span>current playback position</span> is the end of the
<span>media resource</span>, and the <span>media element</span> does
either the <span>current playback position</span> is the end of the
<span>media resource</span> and the <span>direction of
playback</span> is forwards and the <span>media element</span> does
not have a <code title="attr-media-loop">loop</code> attribute
specified.</p>
specified, or the <span>current playback position</span> is the
<var>earliest possible position</var> and the <span>direction of
playback</span> is backwards.</p>

<p>The <dfn title="dom-media-ended"><code>ended</code></dfn>
attribute must return true if the <span>media element</span> has
<span>ended playback</span>, and false otherwise.</p>
<span>ended playback</span> and the <span>direction of
playback</span> is forwards, and false otherwise.</p>

<p>A <span>media element</span> is said to have <dfn>stopped due to
errors</dfn> when the element's <code
Expand Down Expand Up @@ -23117,8 +23126,9 @@ interface <dfn>CueRangeCallback</dfn> {
the element.</p>

<p>When the <span>current playback position</span> reaches the end
of the <span>media resource</span>, then the user agent must follow
these steps:</p>
of the <span>media resource</span> when the <span>direction of
playback</span> is forwards, then the user agent must follow these
steps:</p>

<ol>

Expand Down Expand Up @@ -23147,6 +23157,21 @@ interface <dfn>CueRangeCallback</dfn> {

</ol>

<p>When the <span>current playback position</span> reaches the
<var>earliest possible position</var> of the <span>media
resource</span> when the <span>direction of playback</span> is
backwards, then the user agent must follow these steps:</p>

<ol>

<li><p>Stop playback.</p></li>

<li><p>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.</p></li>

</ol>

<p>The <dfn
title="dom-media-defaultPlaybackRate"><code>defaultPlaybackRate</code></dfn>
attribute gives the desired speed at which the <span>media
Expand All @@ -23168,6 +23193,10 @@ interface <dfn>CueRangeCallback</dfn> {
value, and the playback must change speed (if the element is
<span>potentially playing</span>).</p>

<p>If the <code title="dom-media-playbackRate">playbackRate</code>
is positive or zero, then the <dfn>direction of playback</dfn> is
forwards. Otherwise, it is backwards.</p>

<p>The "play" function in a user agent's interface must set the
<code title="dom-media-playbackRate">playbackRate</code> attribute
to the value of the <code
Expand Down

0 comments on commit e818db7

Please sign in to comment.