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