Closed joshmcarthur closed 12 years ago
+1
I've nearly finished this, over at https://github.com/joshmcarthur/on-the-spot/tree/feature/7-controls. The clearing queue works, but the web app keeps saying the player is 'stopped' even when it isn't. Regardless, it should be done soon.
I think I'm going to need to park this for now. I'll try and explain why below:
Right now, I define a Hallon::Player instance as global variable $player
, in a setup method. This works fine - I can access a $player
from both the web app and the daemon, and can play tracks, etc. on each of those. The problem is that while I can access two player instances, I'm pretty sure they're different. I can play a track with one, and try to play and pause the other one, but nothing happens. In terms of the status, it changes as it should - if I hit 'Play', it changes to :playing
and so on, but it doesn't actually do anything.
There's a couple of alternative to how we could do this, but all are a bit complicated. Here's why:
pause
during a blocking call play!
- which I use to play the track, but I know that the daemon will be harder to control without that blocking call (since it would start trying to play the next track), and that I can't put pause in that daemon either, because it would not try and pause until the blocking call finishes.So, @dnl (since you've weighed in on this).....any ideas?
Closed by 339bd754301d71b704c180f4ac21fde2ffada456. I've done the best I can with this so that the player can be muted/unmuted. I think anything more is going to be prohibitively difficult at this point.
Sometimes, even when the queue isn't empty, we want to be able to pause and play. We need controls on the page to allow us to Play and Pause the Spotify player from the web interface.
The code for this should be quite easy:
...but I'm not sure how this will affect the daemon (which blocks while it calls
play!
on a track). More research needed, but it should be pretty simple.