mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibWeb: Explicitly set the audio element playback position after seeking
The audio element behaves a bit differently than the video element in that the audio element drives itself on a timer (as opposed to LibVideo notifying the video element when a frame is available). So if an audio element is paused while seeking, we wouldn't receive an updated playback position until the element is unpaused. This fixes an issue where you would have to click the play button twice to re-start an audio track after it reached the end.
This commit is contained in:
parent
58478d572f
commit
e81abbde7b
Notes:
sideshowbarker
2024-07-17 04:41:05 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/e81abbde7b Pull-request: https://github.com/SerenityOS/serenity/pull/19423
1 changed files with 1 additions and 0 deletions
|
@ -98,6 +98,7 @@ void AudioTrack::seek(double position, MediaSeekMode seek_mode)
|
|||
position = position / duration * static_cast<double>(m_loader->total_samples());
|
||||
|
||||
m_loader->seek(position).release_value_but_fixme_should_propagate_errors();
|
||||
m_media_element->set_current_playback_position(this->position().to_milliseconds() / 1000.0);
|
||||
}
|
||||
|
||||
void AudioTrack::update_volume()
|
||||
|
|
Loading…
Reference in a new issue