mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 15:35:07 +00:00
LibWeb: Dispatch an addtrack event for newly created audio tracks
This commit is contained in:
parent
6520a9a849
commit
0c4b28faf3
1 changed files with 6 additions and 1 deletions
|
@ -990,7 +990,12 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::process_media_data(Function<void(Str
|
|||
if (enable == TriState::True)
|
||||
audio_track->set_enabled(true);
|
||||
|
||||
// FIXME: 7. Fire an event named addtrack at this AudioTrackList object, using TrackEvent, with the track attribute initialized to the new AudioTrack object.
|
||||
// 7. Fire an event named addtrack at this AudioTrackList object, using TrackEvent, with the track attribute initialized to the new AudioTrack object.
|
||||
TrackEventInit event_init {};
|
||||
event_init.track = JS::make_handle(audio_track);
|
||||
|
||||
auto event = TRY(TrackEvent::create(realm, HTML::EventNames::addtrack, move(event_init)));
|
||||
m_audio_tracks->dispatch_event(event);
|
||||
}
|
||||
|
||||
// -> If the media resource is found to have a video track
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue