/src/serenity/Userland/Libraries/LibWeb/MediaSourceExtensions/MediaSource.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <LibWeb/DOM/EventTarget.h> |
10 | | |
11 | | namespace Web::MediaSourceExtensions { |
12 | | |
13 | | // https://w3c.github.io/media-source/#dom-mediasource |
14 | | class MediaSource : public DOM::EventTarget { |
15 | | WEB_PLATFORM_OBJECT(MediaSource, DOM::EventTarget); |
16 | | JS_DECLARE_ALLOCATOR(MediaSource); |
17 | | |
18 | | public: |
19 | | [[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaSource>> construct_impl(JS::Realm&); |
20 | | |
21 | | // https://w3c.github.io/media-source/#dom-mediasource-canconstructindedicatedworker |
22 | 0 | static bool can_construct_in_dedicated_worker(JS::VM&) { return true; } |
23 | | |
24 | | protected: |
25 | | MediaSource(JS::Realm&); |
26 | | |
27 | | virtual ~MediaSource() override; |
28 | | |
29 | | virtual void initialize(JS::Realm&) override; |
30 | | |
31 | | private: |
32 | | }; |
33 | | |
34 | | } |