mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/WebAudio: Fire complete event with OfflineAudioCompletionEvent
This commit is contained in:
parent
556699d601
commit
47b512ec56
Notes:
github-actions[bot]
2025-11-19 16:27:18 +00:00
Author: https://github.com/Lubrsi
Commit: 47b512ec56
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6860
9 changed files with 120 additions and 14 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/WebAudio/AudioBuffer.h>
|
||||
#include <LibWeb/WebAudio/AudioDestinationNode.h>
|
||||
#include <LibWeb/WebAudio/OfflineAudioCompletionEvent.h>
|
||||
#include <LibWeb/WebAudio/OfflineAudioContext.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
|
@ -138,9 +139,17 @@ void OfflineAudioContext::begin_offline_rendering(GC::Ref<WebIDL::Promise> promi
|
|||
|
||||
// 4.2: Queue a media element task to fire an event named complete at the OfflineAudioContext using OfflineAudioCompletionEvent
|
||||
// whose renderedBuffer property is set to [[rendered buffer]].
|
||||
// FIXME: Need to implement OfflineAudioCompletionEvent.
|
||||
queue_a_media_element_task(GC::create_function(heap(), [&realm, this]() {
|
||||
this->dispatch_event(DOM::Event::create(realm, HTML::EventNames::complete));
|
||||
auto event_init = OfflineAudioCompletionEventInit {
|
||||
{
|
||||
.bubbles = false,
|
||||
.cancelable = false,
|
||||
.composed = false,
|
||||
},
|
||||
this->m_rendered_buffer,
|
||||
};
|
||||
auto event = MUST(OfflineAudioCompletionEvent::construct_impl(realm, HTML::EventNames::complete, event_init));
|
||||
this->dispatch_event(event);
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue