Bug 303126

Summary: [MSE] ended event may never be fired
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: MediaAssignee: 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=303130

Jean-Yves Avenard [:jya]
Reported 2025-11-25 23:44:44 PST
The MediaPlayerPrivateMediaSourceAVFObjC monitors for gaps in the buffered ranges and set the AudioVideoRenderer to stall on the start of the gap. The observer for the time is set whenever the buffered changes. However, if the currentTime is slightly before the start of the buffered range ; https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm#675-676 the condition ``` size_t index = ranges.find(currentTime); if (index == notFound) return; // Find the next gap (or end of media) ``` index is always notFound and so we won't ever set the time observer, and so playback will continue past the duration, and the `ended` event will never be fired.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-11-25 23:44:51 PST
Jean-Yves Avenard [:jya]
Comment 2 2025-11-25 23:45:53 PST
An example can be observed with the video in LayoutTests/media/media-source/content/content/test-vp8-24fps.web ; it starts at 0.007
Radar WebKit Bug Importer
Comment 3 2025-11-25 23:45:59 PST
Jean-Yves Avenard [:jya]
Comment 4 2025-11-26 01:10:58 PST
EWS
Comment 5 2025-11-27 02:38:50 PST
Committed 303596@main (cf7ea924ed64): <https://commits.webkit.org/303596@main> Reviewed commits have been landed. Closing PR #54473 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.