Control Chrome audio play/pause button

Hello guys,
Would anyone here know if it would be possible to control the chrome audio play/pause button right next to the cast button on the broswer? Are there any available APIs?
I think it could be a create feature for software optimisationand using it in automations:

  • I’m thinking for example when I get a phone call, all the media playing in chrome (youtube videos, spotify, others) would automatically pause?

  • Another example would be to pause all media when I start playing some songs on spotify since I don’t want to listen to multiple audio sources at the same time.

Thanks a lot for your help :slightly_smiling_face:

It’s a media player, so if you’ve added it to home assistant it has these services available:

Hello, thanks a lot for your feedback.
Do you have examples for the configuration, how to I make my chrome browser become a media player?
And to be very clear, I’m not talking about chromecast or google homes, I’m talking about the chrome browser of my laptop on windows 10.
I’m a bit new to those type of integrations!
Thanks :slight_smile:

Ok, I missed the browser bit. Sorry.

Good news though, you can do it with this:

If you cant get it working from the examples on the page ask for advice here ( I’ve never used the audio player feature):

Oh great I found out by myself the same custom component :slight_smile:
This is a great one! Unfortunately it doesn’t seem to be able to control other medias playing for example spotify or youtube.
Maybe some update/ new features could unable that fonctionnality?

Your best bet would be to play your PC sound through a device that Home Assistant can control. e.g. a second hand networked receiver/amplifier.

Yes I already have two speakers on a relay switch so I can cut them off when needed but I’m also using them to stream my phone call :slightly_smiling_face:
i would like to control this chrome browser button, just like I can do manually