artemanufrij / playmymusic

An elementary OS app
http://anufrij.org/melody
97 stars 26 forks source link

Resume streamed playback after screen lock #123

Open riker09 opened 6 years ago

riker09 commented 6 years ago

I'm using Elementary OS at work and company policy requires to lock your work station when you leave your desk. So throughout the day I frequently lock my desktop (Super + L) and return shortly after.

The playback stops once the screen is locked (which I think is nice because it saves bandwidth). When I unlock it the playback resumes for a short while but then stops. I'm taking a wild guess here but it feels as if upon locking the screen the streaming is stopped and after unlocking the screen again the remaining buffer is played back. After that the playback stops completely as the streaming is not resumed.

tl;dr After unlocking the screen playback does not resume as expected.

riker09 commented 6 years ago

I've also just noticed that I cannot click on play to resume playback. I have to open the program, click on a different station to start playback and then I can switch back to the station I was originally listening to.

Maccer1 commented 6 years ago

I can't reproduce this issue. The music continues playing when I unlock my laptop. I've also tried going to sleep but it still works normally. I'm using the latest build from the master branch so maybe your issue has been fixed recently.

Can you try again? If the issue persists then install the master branch on your pc following the steps listed on the readme and check if it works.

riker09 commented 6 years ago

I've installed the latest version but the issue still exists. I want to make clear that I have no local music files whatsoever. I was entirely referring to streamed music (internet radio). Maybe I should have made that clearer on the original issue title.

As far as I see it there are two ways to go here:

a) cache the stream during locked screen time and resume from cache b) stop the stream and when the screen is unlocked reconnect

Solution a would require some disk space and possibly a setting for the maximum amount of disk space to use for buffering. Once the buffer is full it would just fall back to solution b. My take on this would be implementing solution b. :grin: