<?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>28125</bug_id>
          
          <creation_ts>2015-03-03 02:00:50 +0000</creation_ts>
          <short_desc>Pausing a playing media element requires the final paused position to be known synchronously</short_desc>
          <delta_ts>2016-02-01 17:26:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc>https://html.spec.whatwg.org/#internal-pause-steps</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>118239</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2015-03-03 02:00:50 +0000</bug_when>
    <thetext>Specification: https://html.spec.whatwg.org/
Multipage: https://html.spec.whatwg.org/multipage/#internal-pause-steps
Complete: https://html.spec.whatwg.org/#internal-pause-steps
Referrer: 

Comment:
Pausing a playing media element requires the final paused position to be known
synchronously

Posted from: 14.162.102.1
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36 OPR/27.0.1689.76</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118240</commentid>
    <comment_count>1</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2015-03-03 02:10:06 +0000</bug_when>
    <thetext>The internal pause steps say &quot;Set the official playback position to the current playback position&quot; as a synchronous part of those steps.

The current playback position amounts to the time currently reported by the media framework, but if we are playing we still have to ask it to pause and wait for it to pause before known the final paused position.

Blink actually implements this, but it causes a problem:
https://code.google.com/p/chromium/issues/detail?id=460904

Because the media framework continues to play for a fraction of a second, the buffered ranges may change so that when paused, the official playback position is outside of the buffered ranges.

This could be fixed by making pause() async similarly to seeking, which says &quot;Wait until the user agent has established whether or not the media data for the new playback position is available, and, if it is, until it has decoded enough data to play back that position.&quot;

(It could also be fixed by treating all state as a single data structure and always updating it together so that it cannot be inconsistent, but then it would still be stale after pausing.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118322</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-03-04 22:05:17 +0000</bug_when>
    <thetext>Will anything break if we make it async?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118349</commentid>
    <comment_count>3</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2015-03-05 07:20:59 +0000</bug_when>
    <thetext>I&apos;m pretty optimistic that it&apos;d be Web compatible. For it to break, you need to use currentTime at the time you pause() and somehow depend on it being exactly unchanged when the pause event fires or something similar. It could be lack of imagination, but I&apos;m failing to come up with a realistic scenario for this.

As long as the timeupdate event is fired when the playback position has settled, any UI code that has the same bug found in Chromium (assuming that currentTime is in one of the buffered ranges) should start working.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124793</commentid>
    <comment_count>4</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2016-02-01 17:26:16 +0000</bug_when>
    <thetext>Would be fixed as part of https://github.com/whatwg/html/issues/310</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>