Is there a way to get the "playing" state from a web browser?

Hi Everyone my first post here, Tried searching by couldn’t find anything, I wanted to know if it was possible to get the current playing state of my Firefox browser (any window/tab) from my main PC, I’d like to setup some lighting automations based on if media is playing and the URL of said page/tab.

Following because I’m also interested in this. My main TV watching device is just a browser on an HTPC, I’m looking to set up some lighting automatons based on what url and whether or not media is playing.

Take a look at Hass.Agent, it’s come on a lot since I last looked at it.

It looks like its Windows only which sadly won’t work for me.
I’m looking at writing a really basic browser extension that will fire a request based on play/pause state, trying to integrate it with HA via webhooks but CORS is hard lol.