mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-17 00:23:00 +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/SourceBufferPrototype.h>
|
||||
#include <LibWeb/MediaSourceExtensions/EventNames.h>
|
||||
#include <LibWeb/MediaSourceExtensions/SourceBuffer.h>
|
||||
|
||||
namespace Web::MediaSourceExtensions {
|
||||
|
@ -25,4 +26,64 @@ void SourceBuffer::initialize(JS::Realm& realm)
|
|||
WEB_SET_PROTOTYPE_FOR_INTERFACE(SourceBuffer);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onupdatestart
|
||||
void SourceBuffer::set_onupdatestart(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::updatestart, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onupdatestart
|
||||
GC::Ptr<WebIDL::CallbackType> SourceBuffer::onupdatestart()
|
||||
{
|
||||
return event_handler_attribute(EventNames::updatestart);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onupdate
|
||||
void SourceBuffer::set_onupdate(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::update, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onupdate
|
||||
GC::Ptr<WebIDL::CallbackType> SourceBuffer::onupdate()
|
||||
{
|
||||
return event_handler_attribute(EventNames::update);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onupdateend
|
||||
void SourceBuffer::set_onupdateend(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::updateend, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onupdateend
|
||||
GC::Ptr<WebIDL::CallbackType> SourceBuffer::onupdateend()
|
||||
{
|
||||
return event_handler_attribute(EventNames::updateend);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onerror
|
||||
void SourceBuffer::set_onerror(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::error, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onerror
|
||||
GC::Ptr<WebIDL::CallbackType> SourceBuffer::onerror()
|
||||
{
|
||||
return event_handler_attribute(EventNames::error);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onabort
|
||||
void SourceBuffer::set_onabort(GC::Ptr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::abort, event_handler);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/media-source/#dom-sourcebuffer-onabort
|
||||
GC::Ptr<WebIDL::CallbackType> SourceBuffer::onabort()
|
||||
{
|
||||
return event_handler_attribute(EventNames::abort);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue