When navigator.mediaSession.metadata is reassigned, dispatch a mediametadatachange event on the document.
Motivation
I'm developing a browser extension which will relay media metadata to another service. Current approaches for knowing when metadata changes includes:
- Monkeypatch
navigator.mediaSession with an object containing a setter for the metadata property
- Poll the
metadata property checking for reference changes
When
navigator.mediaSession.metadatais reassigned, dispatch amediametadatachangeevent on the document.Motivation
I'm developing a browser extension which will relay media metadata to another service. Current approaches for knowing when metadata changes includes:
navigator.mediaSessionwith an object containing a setter for themetadatapropertymetadataproperty checking for reference changes