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
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Time.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibMedia/Forward.h>
|
||||
#include <LibMedia/Track.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
|
@ -23,17 +22,6 @@ public:
|
|||
|
||||
void set_video_track_list(Badge<VideoTrackList>, GC::Ptr<VideoTrackList> video_track_list) { m_video_track_list = video_track_list; }
|
||||
|
||||
void play_video(Badge<HTMLVideoElement>);
|
||||
void pause_video(Badge<HTMLVideoElement>);
|
||||
void stop_video(Badge<HTMLVideoElement>);
|
||||
|
||||
AK::Duration position() const;
|
||||
AK::Duration duration() const;
|
||||
void seek(AK::Duration, MediaSeekMode);
|
||||
|
||||
u64 pixel_width() const;
|
||||
u64 pixel_height() const;
|
||||
|
||||
String const& id() const { return m_id; }
|
||||
String const& kind() const { return m_kind; }
|
||||
String const& label() const { return m_label; }
|
||||
|
|
@ -42,8 +30,10 @@ public:
|
|||
bool selected() const { return m_selected; }
|
||||
void set_selected(bool selected);
|
||||
|
||||
Media::Track const& track_in_playback_manager() const { return m_track_in_playback_manager; }
|
||||
|
||||
private:
|
||||
VideoTrack(JS::Realm&, GC::Ref<HTMLMediaElement>, NonnullOwnPtr<Media::PlaybackManager>);
|
||||
VideoTrack(JS::Realm&, GC::Ref<HTMLMediaElement>, Media::Track const& track);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
|
@ -66,7 +56,7 @@ private:
|
|||
GC::Ref<HTMLMediaElement> m_media_element;
|
||||
GC::Ptr<VideoTrackList> m_video_track_list;
|
||||
|
||||
NonnullOwnPtr<Media::PlaybackManager> m_playback_manager;
|
||||
Media::Track m_track_in_playback_manager;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue