2023-04-04 10:26:02 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
2025-09-30 19:18:32 -03:00
|
|
|
* Copyright (c) 2025, Gregory Bertilson <gregory@ladybird.org>
|
2023-04-04 10:26:02 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/String.h>
|
|
|
|
|
#include <AK/Time.h>
|
2025-10-03 02:39:39 -03:00
|
|
|
#include <LibMedia/Track.h>
|
2023-04-04 10:26:02 -03:00
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2025-09-30 19:18:32 -03:00
|
|
|
#include <LibWeb/HTML/MediaTrackBase.h>
|
2023-04-04 10:26:02 -03:00
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
2025-09-30 19:18:32 -03:00
|
|
|
class VideoTrack final : public MediaTrackBase {
|
|
|
|
|
WEB_PLATFORM_OBJECT(VideoTrack, MediaTrackBase);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(VideoTrack);
|
2023-04-04 10:26:02 -03:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual ~VideoTrack() override;
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
void set_video_track_list(Badge<VideoTrackList>, GC::Ptr<VideoTrackList> video_track_list) { m_video_track_list = video_track_list; }
|
2023-04-04 10:26:02 -03:00
|
|
|
|
|
|
|
|
bool selected() const { return m_selected; }
|
|
|
|
|
void set_selected(bool selected);
|
|
|
|
|
|
|
|
|
|
private:
|
2025-10-03 02:39:39 -03:00
|
|
|
VideoTrack(JS::Realm&, GC::Ref<HTMLMediaElement>, Media::Track const& track);
|
2023-04-04 10:26:02 -03:00
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-04-04 10:26:02 -03:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-selected
|
|
|
|
|
bool m_selected { false };
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ptr<VideoTrackList> m_video_track_list;
|
2023-04-04 10:26:02 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|