mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Keep a seek's target position when pausing a media element
The spec's steps for pausing an HTMLMediaElements prescribe setting the official playback position to the current playback position, but the seeking steps are not synchronous, so there's no guarantee that the current playback position reflects the seek. Therefore, we need to skip that step if we're in the middle of a seek. This is included in a pull request to the HTML spec: https://github.com/whatwg/html/pull/11792
This commit is contained in:
committed by
Gregory Bertilson
parent
7ede4e8b03
commit
e8dcf5fad2
Notes:
github-actions[bot]
2026-02-06 10:55:46 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/e8dcf5fad26 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7473
@@ -1787,7 +1787,11 @@ void HTMLMediaElement::pause_element()
|
||||
});
|
||||
|
||||
// 4. Set the official playback position to the current playback position.
|
||||
m_official_playback_position = m_current_playback_position;
|
||||
// AD-HOC: If the seeking attribute is set, we don't want to overwrite the official playback position, since that
|
||||
// means it is temporarily set to the seeking target position instead of the current playback position.
|
||||
// See: https://github.com/whatwg/html/issues/11773 and https://github.com/whatwg/html/pull/11792
|
||||
if (!seeking())
|
||||
m_official_playback_position = m_current_playback_position;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user