Closed rako77 closed 2 years ago
Hi!
sounds interesting. Can you point to some docs on that API?
@rako77 can you elaborate?
This would rock !
Hi!
sounds interesting. Can you point to some docs on that API?
I dont think theres an api for media browser Media browser is part of HA Not sure if @rako77 is willing to elaborate, since theres no reply here
Since new people are joining further development here, is this on the road, i think many people wants this. I find it still strange this hasnt been on developemnt ages ago (no offence meaning you guys dont progress hard enough. All respect in what you guys are doing. Take your needed time !
@rako77 You could probably prototype this using "universal media player" and an input_select helper.
@rako77, @gmcmicken
I was thinking about this request and i think a good place to start would be the xbox integration. It does have a media source browser xbox integration dir.
Home assistant does have a library in media_player that can be accessed with
from homeassistant.components.media_player import BrowseMedia
I'll start exploreing the possibilities. I think we must try to get our hand on the documentation for BrowseMedia first
The official Spotify integration now has media browsing support: https://github.com/home-assistant/core/pull/64921
This is essentially what's needed in the cast media_player to add support there: https://github.com/home-assistant/core/commit/deb196af36e3bba012a5becca764e2ac6bda7252
Would it make sense to allow spotcast to add some hooks in the cast media player to enable spotify support there, for example allow registering a root node for media browsing + support for playback to achieve the same things as what's added by the linked commit?
thank you @emontnemery, good thing that it was added upstream. I was working on a proof of concept on my side to add it to spotcast, but will probably be simpler that way.
I'm going to read on the documentation and check how the media player request could be sent to Spotcast instead of directly to the media_player itself.
thank you @emontnemery, good thing that it was added upstream. I was working on a proof of concept on my side to add it to spotcast, but will probably be simpler that way.
I'm going to read on the documentation and check how the media player request could be sent to Spotcast instead of directly to the media_player itself.
Like I mentioned, I think you can combine two media players with the universal media player component and possibly do this right out of the box already.
Media browsing as well as support for the cast media player entity to play spotify content with help of spotcast is implemented by #294
@emontnemery is there any way to try this now? I copied the new cast.py from your PR to my spotcast directory, but I can't see anything new as media source in Media:
@adrianmihalko You need Home Assistant Core 2022.2, and both spotify and spotcast integrations setup.
@adrianmihalko , the cast module only permits you to browse media from a specific device. You can check #294 which documents how to access it (you need to open the media browser from the media player directly). We would need to implement a media_source browser, but the spotify integration doesn't seem to permit that for the moment. We are still evaluating the feasibility of that part.
@fcusson Oh, now I think I finally understand what you mean, you want it to be possible to browse the Spotify library also directly via the "Media" view in the frontend?
This is already possible, Home Assistant populates the media browser root depending on which player is selected 👍 Home Assistant will even add a root node for each Spotify account once this PR is merged: https://github.com/home-assistant/core/pull/66256
Note that the screenshots below is with latest dev version of Home Assistant + #294.
This is with the default in-browser player selected, only local media + cameras can be browsed:
This is with the spotify player selected, only spotify can be browsed:
This is with a Google Chromecast Audio player selected, everything can be browsed:
oh wow, thank you @emontnemery I really missed that part completely. So, I'm just waiting for fondberg to provide its review and we'll be able to merge the PR. There will be a 3.6.25 release but that will be a bug fix release to ensure compatibility with python 3.8 for certain users.
I can confirm, it works great now.
The only thing I didn't really like in this Media player that seek is not working here (jump on the timeline where I want)?
@fcusson Oh, now I think I finally understand what you mean, you want it to be possible to browse the Spotify library also directly via the "Media" view in the frontend?
This is already possible, Home Assistant populates the media browser root depending on which player is selected 👍 Home Assistant will even add a root node for each Spotify account once this PR is merged: home-assistant/core#66256
Note that the screenshots below is with latest dev version of Home Assistant + #294.
This is with the default in-browser player selected, only local media + cameras can be browsed:
This is with the spotify player selected, only spotify can be browsed:
This is with a Google Chromecast Audio player selected, everything can be browsed:
Huh how do you do that? I can only browse my selected spotify media player, and then browse that media. If i select a cast device, it says de media is empty
What i want to be able to do is: select a mediaplayer; then chose the spotify account and then browse that media... but i cant
Also... the cameras aren there either
Hi @skank01, to get the casting ability, you would need to manually add a file cast.py
. This file is currently under review in #294 and should be available as a release soon.
For your other questions:
I want to make a feature to allow Spotify to cast to Chromecast devices from the media browser.
I'm willing to do the brunt of the dev work on this. I think the best place for a feature like this is in the official Spotify integration but as an unofficial Spotify API like the token you need to cast to a Chromecast device is unlikely to make it into home assistant core, I think this plugin is the best place to do the work.
I am unfamilia with the media browser API but as this plugin can call the official plugin I hope this as easy registering spotcast as a media source for Chromecast devices and then just using a shim and have official Spotify plugin to show the media browser. I realise it might be a lot more complicated then this but I think I would like to give it a try anyway.
Firstly I would like your blessing that you would accept a PR that does this.
Secondly I would like to use this thread to discuss implementation details.