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:
Zaggy1024 2025-10-03 00:39:39 -05:00 committed by Jelle Raaijmakers
parent 0f9fa47352
commit 6caa2f99aa
Notes: github-actions[bot] 2025-10-28 00:35:44 +00:00
15 changed files with 371 additions and 1234 deletions

View file

@ -36,17 +36,10 @@ public:
void set_video_height(u32 video_height) { m_video_height = video_height; }
u32 video_height() const;
void set_video_track(GC::Ptr<VideoTrack>);
void set_current_frame(Badge<VideoTrack>, RefPtr<Gfx::Bitmap> frame, double position);
VideoFrame const& current_frame() const { return m_current_frame; }
RefPtr<Gfx::Bitmap> const& poster_frame() const { return m_poster_frame; }
// FIXME: This is a hack for images used as CanvasImageSource. Do something more elegant.
RefPtr<Gfx::Bitmap> bitmap() const
{
return current_frame().frame;
}
RefPtr<Gfx::Bitmap> bitmap() const;
private:
HTMLVideoElement(DOM::Document&, DOM::QualifiedName);
@ -63,11 +56,6 @@ private:
virtual GC::Ptr<Layout::Node> create_layout_node(GC::Ref<CSS::ComputedProperties>) override;
virtual void adjust_computed_style(CSS::ComputedProperties&) override;
virtual void on_playing() override;
virtual void on_paused() override;
virtual void on_seek(double, MediaSeekMode) override;
virtual void on_volume_change() override;
WebIDL::ExceptionOr<void> determine_element_poster_frame(Optional<String> const& poster);
GC::Ptr<HTML::VideoTrack> m_video_track;