mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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.
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
#include <AK/Time.h>
|
|
#include <LibMedia/Track.h>
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class VideoTrack final : public Bindings::PlatformObject {
|
|
WEB_PLATFORM_OBJECT(VideoTrack, Bindings::PlatformObject);
|
|
GC_DECLARE_ALLOCATOR(VideoTrack);
|
|
|
|
public:
|
|
virtual ~VideoTrack() override;
|
|
|
|
void set_video_track_list(Badge<VideoTrackList>, GC::Ptr<VideoTrackList> video_track_list) { m_video_track_list = video_track_list; }
|
|
|
|
String const& id() const { return m_id; }
|
|
String const& kind() const { return m_kind; }
|
|
String const& label() const { return m_label; }
|
|
String const& language() const { return m_language; }
|
|
|
|
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>, Media::Track const& track);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-id
|
|
String m_id;
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-kind
|
|
String m_kind;
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-label
|
|
String m_label;
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-language
|
|
String m_language;
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-selected
|
|
bool m_selected { false };
|
|
|
|
GC::Ref<HTMLMediaElement> m_media_element;
|
|
GC::Ptr<VideoTrackList> m_video_track_list;
|
|
|
|
Media::Track m_track_in_playback_manager;
|
|
};
|
|
|
|
}
|