HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/6025

SVNBugCommentTime (UTC)
6025[Gecko] [Internet Explorer] [Opera] [Webkit] Fix a few places where a media element could get out of sync with its controller, and re-enable media fragments for loading resources with a controller.2011-04-22 19:36
Index: source
===================================================================
--- source	(revision 6024)
+++ source	(revision 6025)
@@ -29266,15 +29266,18 @@
 
        </li>
 
+       <li><p>Let <var title="">jumped</var> be false.</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 and then <span
-        title="dom-media-seek">seek</span> to that time. Ignore any
-        resulting exceptions (if the position is out of range, it is
-        effectively ignored).</p>
+        position</span> to that time, <span
+        title="dom-media-seek">seek</span> to that time, and let <var
+        title="">jumped</var> be true. Ignore any resulting exceptions
+        (if the position is out of range, it is effectively
+        ignored).</p>
 
         <p class="example">For example, with media formats that
         support the <cite>Media Fragments URI</cite> fragment
@@ -29296,8 +29299,26 @@
        object.</p></li>
 
        <li><p>If the <span>media element</span> has a <span>current
-       media controller</span>, then <span>bring the media element up
-       to speed with its new media controller</span>.</p>
+       media controller</span>, then: if <var title="">jumped</var> is
+       true and the <span>initial playback position</span>, relative
+       to the <span>current media controller</span>'s timeline, is
+       greater than the <span>current media controller</span>'s
+       <span>media controller position</span>, then <span>seek the
+       media controller</span> to the <span>media element</span>'s
+       <span>initial playback position</span>, relative to the
+       <span>current media controller</span>'s timeline; otherwise,
+       <span title="dom-media-seek">seek</span> the <span>media
+       element</span> to the <span>media controller position</span>,
+       relative to the <span>media element</span>'s timeline,
+       discarding any resulting exceptions.</p></li> <!-- i.e. "bring
+       the media element up to speed with its new media controller"
+       --> <!-- we do this because otherwise the fragment identifier
+       initial position is lost. Basically this means that if you are
+       attached to a media controller when you load your resource, and
+       you have a fragment identifier with a start time, you'll jump
+       the media controller to that time if it's not already past it.
+       (So if there are several, you'll jump the media controller to
+       the furthest one in the timeline.) -->
 <!--START w3c-html--><!--CONTROLLER-->
 
        <li>
@@ -30630,9 +30651,13 @@
    <li>
 
     <p>If the <span title="ended playback">playback has ended</span>
-    and the <span>direction of playback</span> is forwards, <span
-    title="dom-media-seek">seek</span> to the <span>earliest possible
-    position</span> of the <span>media resource</span>.</p>
+    and the <span>direction of playback</span> is forwards,
+<!--END w3c-html--><!--CONTROLLER-->
+    and the <span>media element</span> does not have a <span>current
+    media controller</span>,
+<!--START w3c-html--><!--CONTROLLER-->
+    <span title="dom-media-seek">seek</span> to the <span>earliest
+    possible position</span> of the <span>media resource</span>.</p>
 
     <p class="note">This <a href="#seekUpdate">will cause</a> the user
     agent to <span>queue a task</span> to <span>fire a simple
@@ -30643,6 +30668,12 @@
 
    </li>
 
+<!--END w3c-html--><!--CONTROLLER-->
+   <li><p>If the <span>media element</span> has a <span>current
+   media controller</span>, then <span>bring the media element up
+   to speed with its new media controller</span>.</p>
+<!--START w3c-html--><!--CONTROLLER-->
+
    <li>
 
     <p>If the <span>media element</span>'s <code
@@ -31173,7 +31204,13 @@
   the user agent must act as if the algorithm for <span
   title="dom-media-seek">seeking</span> was used whenever the
   <span>current playback position</span> changes in a discontinuous
-  fashion (so that the relevant events fire).</p>
+  fashion (so that the relevant events fire).
+<!--END w3c-html--><!--CONTROLLER-->
+  If the <span>media element</span> has a <span>current media
+  controller</span>, then the user agent must <span>seek the media
+  controller</span> appropriately instead.
+<!--START w3c-html--><!--CONTROLLER-->
+  </p>
 
   </div>
 

|