Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to play a playlist or a favorite #100

Closed
dgmltn opened this issue Jun 10, 2020 · 6 comments
Closed

How to play a playlist or a favorite #100

dgmltn opened this issue Jun 10, 2020 · 6 comments

Comments

@dgmltn
Copy link

dgmltn commented Jun 10, 2020

How's the best way to play a playlist or a favorite (with sonos2mqtt)? Is it setAVTransportURI? But then how's the best way to list URI's of favorites/playlists?

Thanks!

@svrooij
Copy link
Owner

svrooij commented Jun 10, 2020

You can only play streams with SetAVTransportURI so that would work for radio stations (or Spotify artist radio). All other stuff has to be added to a queue.

The above issue was already in my head, but I'm not sure about the best solution. Looking for input.

That would give you an option to retrieve the Favorites or the queue. Then you can play those.

@dgmltn
Copy link
Author

dgmltn commented Jun 10, 2020

I'm coming from node-sonos-http-api and found that listing favorites is a specific "browse" command, but I guess that's not the problem.

https://github.com/jishi/node-sonos-discovery/blob/e114cb1267561307405f76a3d7ec106880cb7274/lib/prototypes/SonosSystem/getFavorites.js

But on there you can also tell it to play a favorite based on the name of the favorite. That's nice. In that case you might not even have to give output anywhere, since a user would know the name of his favorite.

This is how it plays a favorite. It handles radio stations as a special case. Makes sense.

https://github.com/jishi/node-sonos-discovery/blob/e114cb1267561307405f76a3d7ec106880cb7274/lib/prototypes/Player/replaceWithFavorite.js

@svrooij
Copy link
Owner

svrooij commented Jun 10, 2020

Screenshot 2020-06-10 at 21 50 04

This is the first try.

@dgmltn
Copy link
Author

dgmltn commented Jun 11, 2020

But once you've "GetFavoriteRadioStations" or (how do you enumerate Sonos playlists?), can you give an example of how to replace the queue with one of the playlists you've found?

@svrooij
Copy link
Owner

svrooij commented Jun 11, 2020

The documentation of this library wasn't up-to-par. I've made some big improvements to it, see #102

And the resulting documentation on https://svrooij.github.io/sonos2mqtt/
Your question should be answered here

@svrooij svrooij closed this as completed Jun 11, 2020
@dgmltn
Copy link
Author

dgmltn commented Jun 11, 2020

Great update, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants