diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index b132e15330..2e9e5b3534 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -990,7 +990,12 @@ WebIDL::ExceptionOr HTMLMediaElement::process_media_data(Functionset_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