LibWeb: Store the ID of all media elements on a page

This will be used to inform the media elements when the user has muted
the page.
This commit is contained in:
Timothy Flynn 2024-03-30 09:38:00 -04:00 committed by Andreas Kling
commit 7c31343df0
Notes: sideshowbarker 2024-07-17 00:53:02 +09:00
4 changed files with 24 additions and 0 deletions

View file

@ -65,6 +65,13 @@ void HTMLMediaElement::initialize(JS::Realm& realm)
// the document is active again.
pause_element().release_value_but_fixme_should_propagate_errors();
});
document().page().register_media_element({}, unique_id());
}
void HTMLMediaElement::finalize()
{
document().page().unregister_media_element({}, unique_id());
}
// https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task