<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>12541</bug_id>
          
          <creation_ts>2011-04-22 21:49:26 +0000</creation_ts>
          <short_desc>&lt;video&gt; Make seeking change the current playback position before going async, then update it to the clamped value ASAP, then try to buffer</short_desc>
          <delta_ts>2011-08-29 16:38:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#seeking</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>media, needsAction, needsReview</keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>12267</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>kinetik</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>silviapfeiffer1</cc>
    
    <cc>w3c</cc>
    
    <cc>waldron.rick</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47612</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-04-22 21:49:26 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
Section: http://www.whatwg.org/specs/web-apps/current-work/#seeking

Comment:
The asynchronous behaviour of steps 5-12 causes unexpected, unwanted behaviour
when getting the currentTime immediately after it&apos;s been set.
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-January/029961.html

Posted from: 75.150.66.249
User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.0 Safari/534.30</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47613</commentid>
    <comment_count>1</comment_count>
    <who name="Rick Waldron">waldron.rick</who>
    <bug_when>2011-04-22 21:52:58 +0000</bug_when>
    <thetext>Further information can be found here: 

https://bugzilla.mozilla.org/show_bug.cgi?id=627139</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48758</commentid>
    <comment_count>2</comment_count>
    <who name="Rick Waldron">waldron.rick</who>
    <bug_when>2011-05-25 00:07:06 +0000</bug_when>
    <thetext>I&apos;ve taken the liberty to mark this as critical considering every major browser vendor has implemented a &quot;fixed&quot; version, yet the spec still lists this bizarre behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48800</commentid>
    <comment_count>3</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-05-25 08:17:24 +0000</bug_when>
    <thetext>I don&apos;t think it&apos;s that anyone has &quot;fixed&quot; this, it&apos;s just that the spec used to say something different. In any case, it important that currentTime be updated to the new value even before we know if it&apos;s possible to seek to that position, or the seekbar UI would seem very laggy/jumpy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48807</commentid>
    <comment_count>4</comment_count>
    <who name="Rick Waldron">waldron.rick</who>
    <bug_when>2011-05-25 13:20:52 +0000</bug_when>
    <thetext>@Philip

Thanks for your time! And to clarify, by &quot;fixed&quot; I meant that a workaround was added to accommodate a &quot;desired&quot; behaviour. 


Thanks again, 

Rick



ps. I quoted &quot;desired&quot; to emphasize that this is not the intended spec behaviour, but a logical deviation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49808</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-06-17 21:49:17 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; In any case, it important that currentTime be
&gt; updated to the new value even before we know if it&apos;s possible to seek to that
&gt; position, or the seekbar UI would seem very laggy/jumpy.

It appears that the spec doesn&apos;t do this currently. Setting currentTime invokes seek which changes the &quot;current playback position&quot; async. Getting currentTime returns &quot;current playback position&quot;. So getting currentTime immediately after setting it would return the old time per spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49953</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-06-21 05:15:31 +0000</bug_when>
    <thetext>You can&apos;t just set currentTime to the new value, because the new value might be greater than the length of the clip, and in that case you need to warp to the end of the clip, but you might not know that time synchronously. No?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50009</commentid>
    <comment_count>7</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2011-06-21 08:09:10 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; You can&apos;t just set currentTime to the new value, because the new value might be
&gt; greater than the length of the clip, and in that case you need to warp to the
&gt; end of the clip, but you might not know that time synchronously. No?

When the position where we actually seek to is know, we just set currentTime to that instead. Possibly currentTime should be clamped to duration synchronously to make it a bit less weird.

It&apos;s also quite possible we have different ideas about how this would work if currentTime were only updated asynchronously. If it is updated as soon as it is known to which point it is possible to seek, this should be fairly fast. However, updating it only as the seek that position has succeeded would make the UI look sluggish.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50033</commentid>
    <comment_count>8</comment_count>
    <who name="Rick Waldron">waldron.rick</who>
    <bug_when>2011-06-21 15:10:40 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; You can&apos;t just set currentTime to the new value, because the new value might be
&gt; greater than the length of the clip, and in that case you need to warp to the
&gt; end of the clip, but you might not know that time synchronously. No?


I&apos;m not sure how else to describe the problem that this behaviour causes...

1. Given &quot;video&quot; 

2. Starting at currentTime equals zero;
  
    video.currentTime;
    // 0

3. Set &quot;video&quot;s currentTime to 1 second
    
    video.currentTime = 1;

4. Get &quot;video&quot;s currentTime

    video.currentTime;
    // Could be 0, but we&apos;re expecting 1


The only browser that implements the async behaviour without additionally implementing a means to always return the correct currentTime is Firefox 3.6 -- I&apos;v put together the following test case: http://dl.dropbox.com/u/3531958/12541.html which can be run in that browser to illustrate the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51924</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-01 21:19:50 +0000</bug_when>
    <thetext>We can&apos;t set currentTime once only, since some UAs can&apos;t know ahead of time if the stream is seekable.

What we _could_ do is have currentTime get set immediately, and then adjust itself asynchronously if the seek is not possible.

That would basically be the same as now except that the attribute does get set straight away. In most cases that would mean it seems synchronous. In cases where seeking to the given time doesn&apos;t work, it would mean the attribute changes twice, so you could still find that immediately after setting it it doesn&apos;t have the same value in one UA as another. (Then again, that&apos;s always going to be true modulo bug 12267.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51938</commentid>
    <comment_count>10</comment_count>
    <who name="Rick Waldron">waldron.rick</who>
    <bug_when>2011-08-02 00:56:21 +0000</bug_when>
    <thetext>At this point, every UA is doing _something_ to ensure that a very close approximation of the expected currentTime is returned when media.currentTime is accessed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53239</commentid>
    <comment_count>11</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:11:48 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55964</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-29 05:28:36 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: I&apos;ve made currentTime return the value at the last time the event loop ran, the last time it was set, or the last time the clip was paused, whichever happened last.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55968</commentid>
    <comment_count>13</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-08-29 07:33:57 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6531.
Check-in comment: Make video.currentTime return a stable value rather than the current value. This lets us make setting this attribute always seem to work, so authors don&apos;t find the attribute hasn&apos;t changed after they set it.
http://html5.org/tools/web-apps-tracker?from=6530&amp;to=6531</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55972</commentid>
    <comment_count>14</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-08-29 10:00:44 +0000</bug_when>
    <thetext>Assume you meant FIXED</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55984</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-29 16:38:18 +0000</bug_when>
    <thetext>Oops, yes. Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>