Since Spotify can’t use Sonos as a media player for its content (see e.g. this forum post: Media browser, Spotify, select output device?), the awesome Spotify media browser has limited value to Sonos owners. The same probably applies to other media players as well.
My question is, can we use the Spotify media browser, hijack the event when content is selected (what is currently set to “play”), grab the Spotify URI from that content and let Home Assistant call a play_media service with the extracted URI? That way, it doesn’t matter that Spotify doesn’t support the player natively. I think it would provide a lot of value for many users.
I don’t speak the front end language natively, but my studies into the front end repo has led me to hope that one can hijack the on
media-picked-event (e.g. through the action param here: https://github.com/home-assistant/frontend/blob/0ec58007c960e19f0c8fc46a0f1efd1d714e9f5e/src/components/media-player/dialog-media-player-browse.ts#L41). But I don’t know if the Spotify URI is actually there for hass to grab when browsing the media.
Does anyone think this is doable? Does anyone see a way to achieve it?