mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 14:02:51 +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/SourceBufferListPrototype.h>
|
||||
#include <LibWeb/MediaSourceExtensions/EventNames.h>
|
||||
#include <LibWeb/MediaSourceExtensions/SourceBufferList.h>
|
||||
|
||||
namespace Web::MediaSourceExtensions {
|
||||
|
@ -25,4 +26,28 @@ void SourceBufferList::initialize(JS::Realm& realm)
|
|||
WEB_SET_PROTOTYPE_FOR_INTERFACE(SourceBufferList);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebufferlist-onaddsourcebuffer
|
||||
void SourceBufferList::set_onaddsourcebuffer(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::addsourcebuffer, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebufferlist-onaddsourcebuffer
|
||||
GC::Ptr<WebIDL::CallbackType> SourceBufferList::onaddsourcebuffer()
|
||||
{
|
||||
return event_handler_attribute(EventNames::addsourcebuffer);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebufferlist-onremovesourcebuffer
|
||||
void SourceBufferList::set_onremovesourcebuffer(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::removesourcebuffer, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebufferlist-onremovesourcebuffer
|
||||
GC::Ptr<WebIDL::CallbackType> SourceBufferList::onremovesourcebuffer()
|
||||
{
|
||||
return event_handler_attribute(EventNames::removesourcebuffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue