[webkit-changes] [WebKit/WebKit] 71a7e0: [Media] Avoid play() call during seek flow before ...
Enrique Ocaña González
noreply at github.com
Tue Dec 3 04:15:14 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 71a7e0a09291cc45f28866d3cc93adb0da61050c
https://github.com/WebKit/WebKit/commit/71a7e0a09291cc45f28866d3cc93adb0da61050c
Author: Enrique Ocaña González <eocanha at igalia.com>
Date: 2024-12-03 (Tue, 03 Dec 2024)
Changed paths:
M Source/WebCore/html/HTMLMediaElement.cpp
M Source/WebCore/html/HTMLMediaElement.h
Log Message:
-----------
[Media] Avoid play() call during seek flow before the finishSeek()
https://bugs.webkit.org/show_bug.cgi?id=283172
Reviewed by Xabier Rodriguez-Calvar.
During the video playback states should ideally flow as play -> pause ->
seek_start -> seek_done -> play, but randomly it is observed that the
play event is being sent before finishing the seek (seek_done) i.e, play
-> pause -> seek_start -> play -> seek_done. Ideally play call might be
triggered continuously by the webapp when we are playing a video, so in
our scenario between seek_start and seek_done we should avoid the play
call.
This commit adds a new condition to skip the playPlayer() call during
updatePlayState() when the seek is ongoing. This would avoid the play
event to happen.
There's also some special cases to not skip playPlayer() on first play,
because initial seeks aren't fully supported on WebKitGTK/WPE and that
play call might be required for them to work:
- First time playing
- Looping
- Resuming playback
- Seek after playback ended (either as part of a loop or a manual seek)
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1423
Co-authored with: gowthami <gchikkadasarahallilo.ext at libertyglobal.com>
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekWithTolerance): Set seek after playback ended flag when the current position is equal to duration.
(WebCore::HTMLMediaElement::finishSeek): Reset the seek after playback ended flag.
(WebCore::HTMLMediaElement::playInternal): Set seek after playback ended flag when needed.
(WebCore::HTMLMediaElement::updatePlayState): Add the new conditions and exceptions to disallow playback when seeking.
(WebCore::HTMLMediaElement::mayResumePlayback): Set the isResumingPlayback condition and reset it after the call to play().
* Source/WebCore/html/HTMLMediaElement.h: Added m_isResumingPlayback and m_seekAfterPlaybackEnded flags.
Canonical link: https://commits.webkit.org/287274@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list