Bug 254198
Summary: | [MSE] readyState should change back to HAVE_METADATA when removing sample at current playtime | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
Component: | Media | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=254136 https://bugs.webkit.org/show_bug.cgi?id=254207 |
Jean-Yves Avenard [:jya]
This is similar to the side fix made in https://bugs.webkit.org/show_bug.cgi?id=254136
where we ensured that the readyState was updated before we fired `updateend`.
Per spec in the coded frame removal [1]
step5:
```
If this object is in activeSourceBuffers, the current playback position is greater than or equal to start and less than the remove end timestamp, and HTMLMediaElement.readyState is greater than HAVE_METADATA, then set the HTMLMediaElement.readyState attribute to HAVE_METADATA and stall playback.
```
This occurs before we return from the coded frame remove algorithm, so readyState should change before we fire the `updateend` event.
Note that there's a similar code flow for when evicting data. However due to how the MediaPlayer works in the GPU process this isn't currently achievable as the readyState change require a back and forth from CP to GPU Process, incompatible with the synchronous nature of the prepare append algorithm [2].
However, in practice it doesn't matter, as the eviction algorithm is designed in such a way that it will never evict data at the current time, and as such, the readyState can never move back to HAVE_METADATA
[1] https://w3c.github.io/media-source/#sourcebuffer-coded-frame-removal
[2] https://w3c.github.io/media-source/#sourcebuffer-prepare-append
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/106979551>
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/11751
EWS
Committed 261955@main (20053bdeedfd): <https://commits.webkit.org/261955@main>
Reviewed commits have been landed. Closing PR #11751 and removing active labels.