[html5] r6580 - [giow] (1) Make setting .currentTime before the media has loaded still work (by [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Sep 23 15:18:20 PDT 2011


Author: ianh
Date: 2011-09-23 15:18:18 -0700 (Fri, 23 Sep 2011)
New Revision: 6580

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Make setting .currentTime before the media has loaded still work (by waiting til it is loaded to seek).
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=13503

Modified: complete.html
===================================================================
--- complete.html	2011-09-23 19:57:40 UTC (rev 6579)
+++ complete.html	2011-09-23 22:18:18 UTC (rev 6580)
@@ -27352,10 +27352,8 @@
 
      <dt id=getting-media-metadata>Once enough of the <a href=#media-data>media
      data</a> has been fetched to determine the duration of the
-     <a href=#media-resource>media resource</a>, its dimensions, and other
-     metadata,
-     and once <a href=#the-text-tracks-are-ready>the text tracks are ready</a>
-     </dt>
+     <a href=#media-resource>media resource</a>, its dimensions, and other metadata,
+     and once <a href=#the-text-tracks-are-ready>the text tracks are ready</a> </dt>
 
      <dd>
 
@@ -27421,12 +27419,18 @@
 
        <li><p>Let <var title="">jumped</var> be false.</li>
 
+       <li><p>If the <a href=#media-element>media element</a>'s <a href=#default-playback-start-position>default playback
+       start position</a> is greater than zero, then <a href=#dom-media-seek title=dom-media-seek>seek</a> to that time, and let <var title="">jumped</var> be true.</li>
+
+       <li><p>Let the <a href=#media-element>media element</a>'s <a href=#default-playback-start-position>default playback
+       start position</a> be zero.</li>
+
        <li>
 
         <p>If either the <a href=#media-resource>media resource</a> or the address of
         the <var title="">current media resource</var> indicate a
         particular start time, then set the <a href=#initial-playback-position>initial playback
-        position</a> to that time, <a href=#dom-media-seek title=dom-media-seek>seek</a> to that time, and let <var title="">jumped</var> be true.</p>
+        position</a> to that time and, if <var title="">jumped</var> is still false, <a href=#dom-media-seek title=dom-media-seek>seek</a> to that time and let <var title="">jumped</var> be true.</p>
 
         <p class=example>For example, with media formats that
         support the <cite>Media Fragments URI</cite> fragment
@@ -27468,26 +27472,22 @@
        it's not already past it. (So if there are several, you'll jump
        the media controller to the furthest one in the timeline.) -->
 
-       <li>
+      </ol><p>Once the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
+      reaches <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>,
+      <a href=#fire-loadeddata>after the <code title=event-media-loadeddata>loadeddata</code> event has been
+      fired</a>, set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event
+      flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load
+      event">delaying the load event</a>.</p>
 
-        <p>Once the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
-        reaches <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>,
-        <a href=#fire-loadeddata>after the <code title=event-media-loadeddata>loadeddata</code> event has been
-        fired</a>, set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event
-        flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load
-        event">delaying the load event</a>.</p>
+      <p class=note>A user agent that is attempting to reduce
+      network usage while still fetching the metadata for each
+      <a href=#media-resource>media resource</a> would also stop buffering at this
+      point, following <a href=#resourceSuspend>the rules
+      described previously</a>, which involve the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
+      switching to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value and a
+      <code title=event-suspend>suspend</code> event firing.</p>
 
-        <p class=note>A user agent that is attempting to reduce
-        network usage while still fetching the metadata for each
-        <a href=#media-resource>media resource</a> would also stop buffering at this
-        point, following <a href=#resourceSuspend>the rules
-        described previously</a>, which involve the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
-        switching to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value and a
-        <code title=event-suspend>suspend</code> event firing.</p>
-
-       </li>
-
-      </ol><p class=note>The user agent is <em>required</em> to
+      <p class=note>The user agent is <em>required</em> to
       determine the duration of the <a href=#media-resource>media resource</a> and
       go through this step before playing.</p> <!-- actually defined
       in the 'duration' section -->
@@ -27522,8 +27522,9 @@
      </dd>
 
 
-     <dt>If the connection is interrupted after some <a href=#media-data>media data</a> has been received, causing the user agent to
-     give up trying to fetch the resource</dt>
+     <dt>If the connection is interrupted after some <a href=#media-data>media
+     data</a> has been received, causing the user agent to give up
+     trying to fetch the resource</dt>
 
      <dd>
 
@@ -27936,17 +27937,25 @@
   approximation of the <a href=#current-playback-position>current playback position</a>
   that is kept stable while scripts are running.</p>
 
+  <p><a href=#media-element title="media element">Media elements</a> also have a
+  <dfn id=default-playback-start-position>default playback start position</dfn>, which must initially be
+  set to zero seconds. This time is used to allow the element to be
+  seeked even before the media is loaded.</p>
+
   <p>The <dfn id=dom-media-currenttime title=dom-media-currentTime><code>currentTime</code></dfn>
-  attribute must, on getting, return the <a href=#official-playback-position>official playback
-  position</a>, expressed in seconds. On setting, if the
-  <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+  attribute must, on getting, return the <a href=#media-element>media element</a>'s
+  <a href=#default-playback-start-position>default playback start position</a>, unless that is zero,
+  in which case it must return the element's <a href=#official-playback-position>official playback
+  position</a>. The returned value must be expressed in seconds. On
+  setting, if the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
   controller</a>, then the user agent must throw an
   <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception; otherwise, if the
-  <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, then it must
-  raise an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception; otherwise, the it
-  must set the <a href=#official-playback-position>official playback position</a> to the new
-  value and then <a href=#dom-media-seek title=dom-media-seek>seek</a> to the new
-  value.</p>
+  <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, then it must set
+  the <a href=#media-element>media element</a>'s <a href=#default-playback-start-position>default playback start
+  position</a> to the new value; otherwise, it must set the
+  <a href=#official-playback-position>official playback position</a> to the new value and then
+  <a href=#dom-media-seek title=dom-media-seek>seek</a> to the new value. The new
+  value must be interpreted as being in seconds.</p>
 
   <p><a href=#media-element title="media element">Media elements</a> have an
   <dfn id=initial-playback-position>initial playback position</dfn>, which must initially (i.e. in

Modified: index
===================================================================
--- index	2011-09-23 19:57:40 UTC (rev 6579)
+++ index	2011-09-23 22:18:18 UTC (rev 6580)
@@ -27219,10 +27219,8 @@
 
      <dt id=getting-media-metadata>Once enough of the <a href=#media-data>media
      data</a> has been fetched to determine the duration of the
-     <a href=#media-resource>media resource</a>, its dimensions, and other
-     metadata,
-     and once <a href=#the-text-tracks-are-ready>the text tracks are ready</a>
-     </dt>
+     <a href=#media-resource>media resource</a>, its dimensions, and other metadata,
+     and once <a href=#the-text-tracks-are-ready>the text tracks are ready</a> </dt>
 
      <dd>
 
@@ -27288,12 +27286,18 @@
 
        <li><p>Let <var title="">jumped</var> be false.</li>
 
+       <li><p>If the <a href=#media-element>media element</a>'s <a href=#default-playback-start-position>default playback
+       start position</a> is greater than zero, then <a href=#dom-media-seek title=dom-media-seek>seek</a> to that time, and let <var title="">jumped</var> be true.</li>
+
+       <li><p>Let the <a href=#media-element>media element</a>'s <a href=#default-playback-start-position>default playback
+       start position</a> be zero.</li>
+
        <li>
 
         <p>If either the <a href=#media-resource>media resource</a> or the address of
         the <var title="">current media resource</var> indicate a
         particular start time, then set the <a href=#initial-playback-position>initial playback
-        position</a> to that time, <a href=#dom-media-seek title=dom-media-seek>seek</a> to that time, and let <var title="">jumped</var> be true.</p>
+        position</a> to that time and, if <var title="">jumped</var> is still false, <a href=#dom-media-seek title=dom-media-seek>seek</a> to that time and let <var title="">jumped</var> be true.</p>
 
         <p class=example>For example, with media formats that
         support the <cite>Media Fragments URI</cite> fragment
@@ -27335,26 +27339,22 @@
        it's not already past it. (So if there are several, you'll jump
        the media controller to the furthest one in the timeline.) -->
 
-       <li>
+      </ol><p>Once the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
+      reaches <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>,
+      <a href=#fire-loadeddata>after the <code title=event-media-loadeddata>loadeddata</code> event has been
+      fired</a>, set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event
+      flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load
+      event">delaying the load event</a>.</p>
 
-        <p>Once the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
-        reaches <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>,
-        <a href=#fire-loadeddata>after the <code title=event-media-loadeddata>loadeddata</code> event has been
-        fired</a>, set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event
-        flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load
-        event">delaying the load event</a>.</p>
+      <p class=note>A user agent that is attempting to reduce
+      network usage while still fetching the metadata for each
+      <a href=#media-resource>media resource</a> would also stop buffering at this
+      point, following <a href=#resourceSuspend>the rules
+      described previously</a>, which involve the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
+      switching to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value and a
+      <code title=event-suspend>suspend</code> event firing.</p>
 
-        <p class=note>A user agent that is attempting to reduce
-        network usage while still fetching the metadata for each
-        <a href=#media-resource>media resource</a> would also stop buffering at this
-        point, following <a href=#resourceSuspend>the rules
-        described previously</a>, which involve the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
-        switching to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value and a
-        <code title=event-suspend>suspend</code> event firing.</p>
-
-       </li>
-
-      </ol><p class=note>The user agent is <em>required</em> to
+      <p class=note>The user agent is <em>required</em> to
       determine the duration of the <a href=#media-resource>media resource</a> and
       go through this step before playing.</p> <!-- actually defined
       in the 'duration' section -->
@@ -27389,8 +27389,9 @@
      </dd>
 
 
-     <dt>If the connection is interrupted after some <a href=#media-data>media data</a> has been received, causing the user agent to
-     give up trying to fetch the resource</dt>
+     <dt>If the connection is interrupted after some <a href=#media-data>media
+     data</a> has been received, causing the user agent to give up
+     trying to fetch the resource</dt>
 
      <dd>
 
@@ -27803,17 +27804,25 @@
   approximation of the <a href=#current-playback-position>current playback position</a>
   that is kept stable while scripts are running.</p>
 
+  <p><a href=#media-element title="media element">Media elements</a> also have a
+  <dfn id=default-playback-start-position>default playback start position</dfn>, which must initially be
+  set to zero seconds. This time is used to allow the element to be
+  seeked even before the media is loaded.</p>
+
   <p>The <dfn id=dom-media-currenttime title=dom-media-currentTime><code>currentTime</code></dfn>
-  attribute must, on getting, return the <a href=#official-playback-position>official playback
-  position</a>, expressed in seconds. On setting, if the
-  <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
+  attribute must, on getting, return the <a href=#media-element>media element</a>'s
+  <a href=#default-playback-start-position>default playback start position</a>, unless that is zero,
+  in which case it must return the element's <a href=#official-playback-position>official playback
+  position</a>. The returned value must be expressed in seconds. On
+  setting, if the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
   controller</a>, then the user agent must throw an
   <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception; otherwise, if the
-  <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, then it must
-  raise an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception; otherwise, the it
-  must set the <a href=#official-playback-position>official playback position</a> to the new
-  value and then <a href=#dom-media-seek title=dom-media-seek>seek</a> to the new
-  value.</p>
+  <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, then it must set
+  the <a href=#media-element>media element</a>'s <a href=#default-playback-start-position>default playback start
+  position</a> to the new value; otherwise, it must set the
+  <a href=#official-playback-position>official playback position</a> to the new value and then
+  <a href=#dom-media-seek title=dom-media-seek>seek</a> to the new value. The new
+  value must be interpreted as being in seconds.</p>
 
   <p><a href=#media-element title="media element">Media elements</a> have an
   <dfn id=initial-playback-position>initial playback position</dfn>, which must initially (i.e. in

Modified: source
===================================================================
--- source	2011-09-23 19:57:40 UTC (rev 6579)
+++ source	2011-09-23 22:18:18 UTC (rev 6580)
@@ -29558,10 +29558,8 @@
 
      <dt id="getting-media-metadata">Once enough of the <span>media
      data</span> has been fetched to determine the duration of the
-     <span>media resource</span>, its dimensions, and other
-     metadata,
-     and once <span>the text tracks are ready</span>
-     </dt>
+     <span>media resource</span>, its dimensions, and other metadata,
+     and once <span>the text tracks are ready</span> </dt>
 
      <dd>
 
@@ -29638,13 +29636,22 @@
 
        <li><p>Let <var title="">jumped</var> be false.</p></li>
 
+       <li><p>If the <span>media element</span>'s <span>default playback
+       start position</span> is greater than zero, then <span
+       title="dom-media-seek">seek</span> to that time, and let <var
+       title="">jumped</var> be true.</p></li>
+
+       <li><p>Let the <span>media element</span>'s <span>default playback
+       start position</span> be zero.</p></li>
+
        <li>
 
         <p>If either the <span>media resource</span> or the address of
         the <var title="">current media resource</var> indicate a
         particular start time, then set the <span>initial playback
-        position</span> to that time, <span
-        title="dom-media-seek">seek</span> to that time, and let <var
+        position</span> to that time and, if <var
+        title="">jumped</var> is still false, <span
+        title="dom-media-seek">seek</span> to that time and let <var
         title="">jumped</var> be true.</p>
 
         <p class="example">For example, with media formats that
@@ -29690,32 +29697,28 @@
        it's not already past it. (So if there are several, you'll jump
        the media controller to the furthest one in the timeline.) -->
 
-       <li>
+      </ol>
 
-        <p>Once the <code
-        title="dom-media-readyState">readyState</code> attribute
-        reaches <code
-        title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>,
-        <a href="#fire-loadeddata">after the <code
-        title="event-media-loadeddata">loadeddata</code> event has been
-        fired</a>, set the element's <span>delaying-the-load-event
-        flag</span> to false. This stops <span title="delay the load
-        event">delaying the load event</span>.</p>
+      <p>Once the <code
+      title="dom-media-readyState">readyState</code> attribute
+      reaches <code
+      title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>,
+      <a href="#fire-loadeddata">after the <code
+      title="event-media-loadeddata">loadeddata</code> event has been
+      fired</a>, set the element's <span>delaying-the-load-event
+      flag</span> to false. This stops <span title="delay the load
+      event">delaying the load event</span>.</p>
 
-        <p class="note">A user agent that is attempting to reduce
-        network usage while still fetching the metadata for each
-        <span>media resource</span> would also stop buffering at this
-        point, following <a href="#resourceSuspend">the rules
-        described previously</a>, which involve the <code
-        title="dom-media-networkState">networkState</code> attribute
-        switching to the <code
-        title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> value and a
-        <code title="event-suspend">suspend</code> event firing.</p>
+      <p class="note">A user agent that is attempting to reduce
+      network usage while still fetching the metadata for each
+      <span>media resource</span> would also stop buffering at this
+      point, following <a href="#resourceSuspend">the rules
+      described previously</a>, which involve the <code
+      title="dom-media-networkState">networkState</code> attribute
+      switching to the <code
+      title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> value and a
+      <code title="event-suspend">suspend</code> event firing.</p>
 
-       </li>
-
-      </ol>
-
       <p class="note">The user agent is <em>required</em> to
       determine the duration of the <span>media resource</span> and
       go through this step before playing.</p> <!-- actually defined
@@ -29756,8 +29759,9 @@
      </dd>
 
 
-     <dt>If the connection is interrupted after some <span>media data</span> has been received, causing the user agent to
-     give up trying to fetch the resource</dt>
+     <dt>If the connection is interrupted after some <span>media
+     data</span> has been received, causing the user agent to give up
+     trying to fetch the resource</dt>
 
      <dd>
 
@@ -30244,20 +30248,28 @@
   approximation of the <span>current playback position</span>
   that is kept stable while scripts are running.</p>
 
+  <p><span title="media element">Media elements</span> also have a
+  <dfn>default playback start position</dfn>, which must initially be
+  set to zero seconds. This time is used to allow the element to be
+  seeked even before the media is loaded.</p>
+
   <p>The <dfn
   title="dom-media-currentTime"><code>currentTime</code></dfn>
-  attribute must, on getting, return the <span>official playback
-  position</span>, expressed in seconds. On setting, if the
-  <span>media element</span> has a <span>current media
+  attribute must, on getting, return the <span>media element</span>'s
+  <span>default playback start position</span>, unless that is zero,
+  in which case it must return the element's <span>official playback
+  position</span>. The returned value must be expressed in seconds. On
+  setting, if the <span>media element</span> has a <span>current media
   controller</span>, then the user agent must throw an
   <code>INVALID_STATE_ERR</code> exception; otherwise, if the
   <span>media element</span>'s <code
   title="dom-media-readyState">readyState</code> is <code
-  title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, then it must
-  raise an <code>INVALID_STATE_ERR</code> exception; otherwise, the it
-  must set the <span>official playback position</span> to the new
-  value and then <span title="dom-media-seek">seek</span> to the new
-  value.</p>
+  title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, then it must set
+  the <span>media element</span>'s <span>default playback start
+  position</span> to the new value; otherwise, it must set the
+  <span>official playback position</span> to the new value and then
+  <span title="dom-media-seek">seek</span> to the new value. The new
+  value must be interpreted as being in seconds.</p>
 
   <p><span title="media element">Media elements</span> have an
   <dfn>initial playback position</dfn>, which must initially (i.e. in




More information about the Commit-Watchers mailing list