[html5] r3012 - [gow] (2) Fix a variety of issues with how media playback works when playbackRat [...]
whatwg at whatwg.org
whatwg at whatwg.org
Tue Apr 28 15:38:21 PDT 2009
Author: ianh
Date: 2009-04-28 15:38:20 -0700 (Tue, 28 Apr 2009)
New Revision: 3012
Modified:
index
source
Log:
[gow] (2) Fix a variety of issues with how media playback works when playbackRate is backwards.
Modified: index
===================================================================
--- index 2009-04-28 22:11:44 UTC (rev 3011)
+++ index 2009-04-28 22:38:20 UTC (rev 3012)
@@ -20918,30 +20918,36 @@
<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>
@@ -21241,14 +21247,18 @@
<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
@@ -21288,8 +21298,9 @@
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
@@ -21310,6 +21321,16 @@
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
@@ -21328,6 +21349,10 @@
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>
Modified: source
===================================================================
--- source 2009-04-28 22:11:44 UTC (rev 3011)
+++ source 2009-04-28 22:38:20 UTC (rev 3012)
@@ -22672,33 +22672,38 @@
<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>
@@ -23063,14 +23068,18 @@
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
@@ -23117,8 +23126,9 @@
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>
@@ -23147,6 +23157,21 @@
</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
@@ -23168,6 +23193,10 @@
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
More information about the Commit-Watchers
mailing list