hixie: Make setting .currentTime before the media has loaded still work (by waiting til it is loaded to seek). (whatwg r6580)

hixie: Make setting .currentTime before the media has loaded still work
(by waiting til it is loaded to seek). (whatwg r6580)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5273&r2=1.5274&f=h
http://html5.org/tools/web-apps-tracker?from=6579&to=6580

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.5273
retrieving revision 1.5274
diff -u -d -r1.5273 -r1.5274
--- Overview.html 23 Sep 2011 20:00:06 -0000 1.5273
+++ Overview.html 23 Sep 2011 22:20:44 -0000 1.5274
@@ -22635,10 +22635,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>
 
@@ -22704,12 +22702,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
@@ -22743,26 +22747,22 @@
        element</a> to the <a href="#media-controller-position">media controller position</a>,
        relative to the <a href="#media-element">media element</a>'s timeline.</li>
         
-       <li>
-
-        <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>
+      </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>
 
-       </li>
+      <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>
 
-      </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> 
      </dd>
@@ -22793,8 +22793,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>
 
@@ -23176,17 +23177,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

Received on Friday, 23 September 2011 22:21:11 UTC