Elleo / cutespotify

A QT5 Spotify client, based on MeeSpot with support for Ubuntu Touch and SailfishOS.
BSD 3-Clause "New" or "Revised" License
55 stars 25 forks source link

Play in background #16

Open boge90 opened 9 years ago

boge90 commented 9 years ago

Hi,

I haven't developed apps for UP before, but it would be great if we could play music while the app is in the background !

And btw, love that you guys have implemented "Offline Mode"

Elleo commented 9 years ago

Hi Boge,

This is actually caused by a limitation of Ubuntu Touch, as it doesn't currently allow apps distributed through the official store to run in the background. You can work around this by installing TweakGeek from the Open Store (https://open.uappexplorer.com/apps), then going to the "Applications" section in TweakGeek, selecting CuteSpotify and ticking the "Prevent Suspending" option.

Cheers, Mike.

boge90 commented 9 years ago

Wow, must say I find that quite a strange limitation, but guess it will be changed in the future. And thanks for the workaround, really appreciate it.

Regards Øivind Boge

kaimast commented 9 years ago

They still haven't implemented that feature? :/

jmc-figueira commented 9 years ago

I have one small question regarding this issue, how does the Canonical-developed Music app get around this issue? It gets cut off when changing apps but works just fine when the screen is turned off (suspended).

Elleo commented 9 years ago

The music app doesn't actually play any music itself, it sends it all to the media-hub to play which runs as a continuous service. However libspotify doesn't provide music in a way that can be handed off to the media-hub, so it all has to be handled directly within CuteSpotify (and so be subject to the life cycle restrictions).

jmc-figueira commented 9 years ago

Noted. It's quite a shame that this combination of factors leads to this. Spotify is currently the only thing preventing me from going full time Ubuntu Phone. Let's hope Canonical comes forth with a solution soon (a simple checkbox in the settings allowing you to turn off app suspension would suffice).

Bladtman242 commented 8 years ago

Can this not be done with powerd?

larsahl1 commented 8 years ago

I have installed the TweakGeek app, and tick in the prevent option for cutespotify but that does not work. When I pull my screen of on the phone it stops playing music.

Bladtman242 commented 8 years ago

@larsahl1 By "pull my screen" what exactly do you mean? If you "flick the app" upwards, you essentially close it yourself.

larsahl1 commented 8 years ago

sorry, I mean. When I turn my screen off by one click on the power button. The music stop play after 1-3 seconds. If I leave my screen on the music plays. If switch to another app in the phone or scope the music stops. When I try with the tweak from the TweakGeak app to allow the application to run in background, this does not help. The application still stop playing music. What I have read is that this is a policy in the Ubuntu Touch OS that application cannot be operating in the background. This is weird to have this policy. Because this is why you use an android compared to an iphone. Wheres for example on the iphone a IRC application cannot run in the background and will be suspended after 3-10 minutes. Wheres in android it can run in the background. There should be an option in the OS wheres the operator of the phone could choose if a application is allowed or not, to run in the background. For example such as on sony android phones have with the STAMINA mode where I could select which application that can be active in the background.

Bladtman242 commented 8 years ago

It's in the pipeline, but not presently a feature. They say they want to get it right, and not release a half-baked solution. They don't trust developers to figure it out. At any rate, it's odd that tweakgeek doesn't do the trick for you. You may want to clear the cutespotify cache from tweakgeek (trust me, this has taken care of many weird cutespotify bugs for me) But essentially, it sounds like your problem might be with tweakgeek, rather than with cutespotify.

ghost commented 8 years ago

Thank you so much for explaining the problem and providing a solution! That OpenStore thing reminded me of when you had to jailbreak an iPhone to do anything useful, except this was much easier. Hopefully the Ubuntu Touch team gets some sort of Background App Refresh or Keep Awake support in the near future.