Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 21dffebd3c18524639ab71d1513869442bb495b1
      
https://github.com/WebKit/WebKit/commit/21dffebd3c18524639ab71d1513869442bb495b1
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2026-05-06 (Wed, 06 May 2026)

  Changed paths:
    M 
LayoutTests/media/media-source/media-managedmse-resume-after-stall-expected.txt
    M LayoutTests/media/media-source/media-managedmse-resume-after-stall.html
    A 
LayoutTests/media/media-source/media-managedmse-waiting-at-gap-expected.txt
    A LayoutTests/media/media-source/media-managedmse-waiting-at-gap.html
    M LayoutTests/platform/glib/TestExpectations
    M Source/WebCore/html/HTMLMediaElement.cpp

  Log Message:
  -----------
  [MSE] waiting event is fired up to 250ms late when playhead reaches a 
buffered gap
https://bugs.webkit.org/show_bug.cgi?id=314171
rdar://176330683

Reviewed by Youenn Fablet.

When MSE playback reaches the end of a buffered range, the readyState must move 
to HAVE_CURRENT_DATA
as per spec:
"If HTMLMediaElement's buffered contains a TimeRanges that ends at the
current playback position and does not have a range covering the time
immediately after the current position:
  - Set the HTMLMediaElement's readyState attribute to HAVE_CURRENT_DATA.
"

However, the MediaSource::monitorSourceBuffers is only called every 250ms
via the HTMLMediaElement::playbackProgressTimerFired

We call monitorSourceBuffers from HTMLMediaElement::mediaPlayerTimeChanged so 
the
transition happens in the same call stack as when the timeupdate event is fired.

Test: media/media-source/media-managedmse-waiting-at-gap.html

* 
LayoutTests/media/media-source/media-managedmse-resume-after-stall-expected.txt:
* LayoutTests/media/media-source/media-managedmse-resume-after-stall.html: 
Assert
readyState == HAVE_CURRENT_DATA at the `waiting` event (was implicit).
* LayoutTests/media/media-source/media-managedmse-waiting-at-gap-expected.txt: 
Added.
* LayoutTests/media/media-source/media-managedmse-waiting-at-gap.html: Added. 
Fails
without the fix with `readyStateAtLastTimeupdate == '3'` observed.
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):

Canonical link: https://commits.webkit.org/312694@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to