sailfish-spotify / hutspot

Spotify Controller for SailfishOS. Documentation: https://sailfish-spotify.github.io/hutspot.
MIT License
18 stars 12 forks source link

Idea: Make Hutspot also a standalone player #47

Open BonoNL opened 5 years ago

BonoNL commented 5 years ago

In future, make Hutspot not only a controller, but also a standalone player on the device it is running at.

That would make the app more useful and complete and eventually makes it a replacement for other not native SailfishOS apps.

wdehoog commented 5 years ago

For that I guess you need Web Playback working on Sailfish. If that works then you are probably better off using spotify's webplayer.

ksiazkowicz commented 5 years ago

Theoretically we could probably try to make Librespot more tightly integrated. Currently we're simply using an example Spotify Connect client IIRC. Not sure if there is any point spending time on this.

abranson commented 5 years ago

Would it be possible to get librespot more robust against connection changes, say by using it through localhost or a socket? As you can already start and stop it with the UI app, that would qualify as a standalone player to me.

BonoNL commented 5 years ago

Make it not the top prio, let us first polish the goods we have.

raketti commented 5 years ago

I've noticed that when I launch Hutspot, it doesn't respect the setting "Start Librespot when launched and stop it on exit", at least not so that one can start playing. However, if I have the Devices page open on startup and refresh the token, it activates Librespot and I can start playing. So a (bit dirty) workaround would be to refresh the token when Hutspot is opened, that way we're quite close to a standalone player in my opinion (after the initial installation and setting things up).

wdehoog commented 5 years ago

It really does respect the setting and the token is refreshed at startup. However connecting with the new instance of librespot takes quit some time. Somehow the Spotify servers do not 'see' librespot immediately and the web-api can only use the device once it has been 'seen'. Having the devices page shown at startup is indeed the best way to detect librespot is available for playing.

raketti commented 5 years ago

You're right, the setting is respected. Could a timer be implemented for refreshing the token? It seems that Librespot fails to register/refresh the token upon startup. I waited a couple of minutes but nothing, And I get the following error message in console:

[C] :94 - _performRequest: 401: No token provided

If I manually refresh I get Librespot active on the Device list instantly.

wdehoog commented 5 years ago

There is already a timer doing just that (reloadDevicesTimer in Devices.qml). Looks like something makes it stop for ever.

raketti commented 5 years ago

Is there a way I could debug that? I can't load Hutspot to the emulator, because there are a lot of QML plugins missing and other warnings. Haven't checked too much how to solve those, though.

wdehoog commented 5 years ago

I don't use the emulator and always debug on the device (deploy as rpm package).