mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibMedia+LibWeb: Rewrite PlaybackManager using the provider/sink model
With this commit, all PlaybackManager can do is autoplay a file from start to finish, with no pausing or seeking functionality. All audio playback functionality has been removed from HTMLMediaElement and HTMLAudioElement in anticipation of PlaybackManager taking that over, for both audio-only and audio/video.
This commit is contained in:
parent
0f9fa47352
commit
6caa2f99aa
Notes:
github-actions[bot]
2025-10-28 00:35:44 +00:00
Author: https://github.com/Zaggy1024
Commit: 6caa2f99aa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6410
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/gmta ✅
15 changed files with 371 additions and 1234 deletions
|
|
@ -7,8 +7,6 @@
|
|||
#include <LibWeb/Bindings/HTMLAudioElementPrototype.h>
|
||||
#include <LibWeb/CSS/ComputedProperties.h>
|
||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||
#include <LibWeb/HTML/AudioTrack.h>
|
||||
#include <LibWeb/HTML/AudioTrackList.h>
|
||||
#include <LibWeb/HTML/HTMLAudioElement.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/Layout/AudioBox.h>
|
||||
|
|
@ -57,32 +55,4 @@ Layout::AudioBox const* HTMLAudioElement::layout_node() const
|
|||
return static_cast<Layout::AudioBox const*>(Node::layout_node());
|
||||
}
|
||||
|
||||
void HTMLAudioElement::on_playing()
|
||||
{
|
||||
audio_tracks()->for_each_enabled_track([](auto& audio_track) {
|
||||
audio_track.play();
|
||||
});
|
||||
}
|
||||
|
||||
void HTMLAudioElement::on_paused()
|
||||
{
|
||||
audio_tracks()->for_each_enabled_track([](auto& audio_track) {
|
||||
audio_track.pause();
|
||||
});
|
||||
}
|
||||
|
||||
void HTMLAudioElement::on_seek(double position, MediaSeekMode seek_mode)
|
||||
{
|
||||
audio_tracks()->for_each_enabled_track([&](auto& audio_track) {
|
||||
audio_track.seek(position, seek_mode);
|
||||
});
|
||||
}
|
||||
|
||||
void HTMLAudioElement::on_volume_change()
|
||||
{
|
||||
audio_tracks()->for_each_enabled_track([&](auto& audio_track) {
|
||||
audio_track.update_volume();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue