mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 12:12:53 +00:00
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/DOM/EventTarget.h>
|
|
|
|
namespace Web::MediaSourceExtensions {
|
|
|
|
// https://w3c.github.io/media-source/#dom-mediasource
|
|
class MediaSource : public DOM::EventTarget {
|
|
WEB_PLATFORM_OBJECT(MediaSource, DOM::EventTarget);
|
|
GC_DECLARE_ALLOCATOR(MediaSource);
|
|
|
|
public:
|
|
[[nodiscard]] static WebIDL::ExceptionOr<GC::Ref<MediaSource>> construct_impl(JS::Realm&);
|
|
|
|
// https://w3c.github.io/media-source/#dom-mediasource-canconstructindedicatedworker
|
|
static bool can_construct_in_dedicated_worker(JS::VM&) { return true; }
|
|
|
|
void set_onsourceopen(GC::Ptr<WebIDL::CallbackType>);
|
|
GC::Ptr<WebIDL::CallbackType> onsourceopen();
|
|
|
|
void set_onsourceended(GC::Ptr<WebIDL::CallbackType>);
|
|
GC::Ptr<WebIDL::CallbackType> onsourceended();
|
|
|
|
void set_onsourceclose(GC::Ptr<WebIDL::CallbackType>);
|
|
GC::Ptr<WebIDL::CallbackType> onsourceclose();
|
|
|
|
static bool is_type_supported(JS::VM&, String const&);
|
|
|
|
protected:
|
|
MediaSource(JS::Realm&);
|
|
|
|
virtual ~MediaSource() override;
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
private:
|
|
};
|
|
|
|
}
|