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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>254136</bug_id>
          
          <creation_ts>2023-03-19 07:42:42 -0700</creation_ts>
          <short_desc>[MSE] readyState may not move from HAVE_METADATA following a seek.</short_desc>
          <delta_ts>2023-03-22 02:06:56 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=254199</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=254198</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jean-Yves Avenard [:jya]">jean-yves.avenard</reporter>
          <assigned_to name="Jean-Yves Avenard [:jya]">jean-yves.avenard</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1942409</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-03-19 07:42:42 -0700</bug_when>
    <thetext>Seen with LayoutTests/media/media-source/media-source-end-of-stream-buffered.html when running in the GPU process.

When we seek to the end of the video while the MediaSource is still in open state, the readyState move to HAVE_METADATA [1] as we have the new playback position not in any TimeRanges of HTMLMediaElement.buffered.

Once MediaSource.endOfStream() was called the readyState should be moved to HAVE_CURRENT_DATA as currentTime is now at the end of the video [2]
However, we do not update the readyState under those circumstances and we stay in HAVE_METADATA

As such if play() is called, playback wouldn&apos;t start (for the video to then end end the ended event should be fired) and the waiting event would fire instead.

[1] https://w3c.github.io/media-source/#mediasource-seeking
[2] https://html.spec.whatwg.org/multipage/media.html#dom-media-have_current_data</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942410</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-03-19 07:43:06 -0700</bug_when>
    <thetext>&lt;rdar://problem/106914173&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942445</commentid>
    <comment_count>2</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-03-19 17:35:35 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/11699</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943040</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-03-22 02:06:54 -0700</bug_when>
    <thetext>Committed 261949@main (e1d76fd08756): &lt;https://commits.webkit.org/261949@main&gt;

Reviewed commits have been landed. Closing PR #11699 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>