Bug 254136 - [MSE] readyState may not move from HAVE_METADATA following a seek.
Summary: [MSE] readyState may not move from HAVE_METADATA following a seek.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-19 07:42 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-03-22 02:06 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-03-19 07:42:42 PDT
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'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
Comment 1 Radar WebKit Bug Importer 2023-03-19 07:43:06 PDT
<rdar://problem/106914173>
Comment 2 Jean-Yves Avenard [:jya] 2023-03-19 17:35:35 PDT
Pull request: https://github.com/WebKit/WebKit/pull/11699
Comment 3 EWS 2023-03-22 02:06:54 PDT
Committed 261949@main (e1d76fd08756): <https://commits.webkit.org/261949@main>

Reviewed commits have been landed. Closing PR #11699 and removing active labels.