HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
3012[Gecko] [Opera] [Webkit] Fix a variety of issues with how media playback works when playbackRate is backwards.2009-04-28 22:38
@@ -22665,47 +22665,52 @@ interface <dfn>CueRangeCallback</dfn> {
    <dd>Enough of the resource has been obtained that the duration of
    the resource is available. In the case of a <code>video</code>
    element, the dimensions of the video are also available. The API
    will no longer raise an exception when seeking. No <span>media
    data</span> is available for the immediate <span>current playback
    position</span>.</dd>
 
    <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>
 
   </dl>
 
   <div class="impl">
 
   <p>When the ready state of a <span>media element</span> whose <code
   title="dom-media-networkState">networkState</code> is not <code
@@ -23056,28 +23061,32 @@ interface <dfn>CueRangeCallback</dfn> {
   <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or
   <code title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>,
   the element has not <span>ended playback</span>, playback has not
   <span>stopped due to errors</span>, and the element has not
   <span>paused for user interaction</span>.</p>
 
   <p>A <span>media element</span> is said to have <dfn>ended
   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
   title="dom-media-readyState">readyState</code> attribute is <code
   title="dom-media-HAVE_METADATA">HAVE_METADATA</code> or greater, and
   the user agent <a href="#non-fatal-media-error">encounters a
   non-fatal error</a> during the processing of the <span>media
   data</span>, and due to that error, is not able to play the content
   at the <span>current playback position</span>.</p>
 
@@ -23110,22 +23119,23 @@ interface <dfn>CueRangeCallback</dfn> {
   <span>stopped due to errors</span>, or playback having <span>paused
   for user interaction</span>, or the <span
   title="dom-media-seek">seeking algorithm</span> being invoked, 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, and <span>queue a task</span> to <span>fire a simple
   event</span> called <code title="event-waiting">waiting</code> at
   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>
 
    <li><p>If the <span>media element</span> has a <code
    title="attr-media-loop">loop</code> attribute specified, then <span
    title="dom-media-seek">seek</span> to the <var>earliest possible
    position</var> of the <span>media resource</span> and abort these
    steps.</p></li> <!-- v2/v3: We should fire a 'looping' event here
    to explain why this immediately fires a 'playing' event, otherwise
    the 'playing' event that fires from the readyState going from
@@ -23140,20 +23150,35 @@ interface <dfn>CueRangeCallback</dfn> {
    <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>
 
    <li><p>The user agent must <span>queue a task</span> to <span>fire
    a simple event</span> called <code title="event-ended">ended</code>
    at the element.</p></li>
 
   </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
   resource</span> is to play, as a multiple of its intrinsic
   speed. The attribute is mutable: on getting it must return the last
   value it was set to, or 1.0 if it hasn't yet been set; on setting
   the attribute must be set to the new value.</p>
 
   <p>The <dfn
   title="dom-media-playbackRate"><code>playbackRate</code></dfn>
@@ -23161,20 +23186,24 @@ interface <dfn>CueRangeCallback</dfn> {
   plays, as a multiple of its intrinsic speed. If it is not equal to
   the <code
   title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>,
   then the implication is that the user is using a feature such as
   fast forward or slow motion playback. The attribute is mutable: on
   getting it must return the last value it was set to, or 1.0 if it
   hasn't yet been set; on setting the attribute must be set to the new
   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
   title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>
   attribute before invoking the <code
   title="dom-media-play">play()</code> method's steps. Features such
   as fast-forward or rewind must be implemented by only changing the
   <code title="dom-media-playbackRate">playbackRate</code>
   attribute.</p>
 

|