mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
LibWeb: Add MediaSourceExtensions events
Continuing the boilerplate for these interfaces.
This commit is contained in:
parent
ff791a63fc
commit
66530086a4
Notes:
github-actions[bot]
2024-11-18 10:59:22 +00:00
Author: https://github.com/shannonbooth
Commit: 66530086a4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2415
Reviewed-by: https://github.com/Lubrsi ✅
19 changed files with 280 additions and 13 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/ManagedMediaSourcePrototype.h>
|
||||
#include <LibWeb/MediaSourceExtensions/EventNames.h>
|
||||
#include <LibWeb/MediaSourceExtensions/ManagedMediaSource.h>
|
||||
|
||||
namespace Web::MediaSourceExtensions {
|
||||
|
@ -30,4 +31,28 @@ void ManagedMediaSource::initialize(JS::Realm& realm)
|
|||
WEB_SET_PROTOTYPE_FOR_INTERFACE(ManagedMediaSource);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-managedmediasource-onstartstreaming
|
||||
void ManagedMediaSource::set_onstartstreaming(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::startstreaming, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-managedmediasource-onstartstreaming
|
||||
GC::Ptr<WebIDL::CallbackType> ManagedMediaSource::onstartstreaming()
|
||||
{
|
||||
return event_handler_attribute(EventNames::startstreaming);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-managedmediasource-onendstreaming
|
||||
void ManagedMediaSource::set_onendstreaming(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::endstreaming, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-managedmediasource-onendstreaming
|
||||
GC::Ptr<WebIDL::CallbackType> ManagedMediaSource::onendstreaming()
|
||||
{
|
||||
return event_handler_attribute(EventNames::endstreaming);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue