I'm working on a music app for Ubuntu Touch
I don't know how to keep playing music when my app is in the background or the screen is turned off. Apparently, media-hub is a platform service introduced to allow this.
However, I couldn't find any docs about media-hub. Right now I just use the QtMultimedia.MediaPlayer to start/stop/… playback, and that automagically allows my app to keep playing the current song, even after switching to a different app.
Now I still need to fix switching to a different song after playback of the current song has finished. My implementation for this feature currently appears to be identical to the one used in the official music-app: Connect a slot to MediaPlayer's "statusChanged"-Signal to check if the status is "EndOfMedia". Then update .source and play() the next track. This works on the desktop and when the app is active on the phone. If the app is not active or the screen is turned off, I must switch back to my app in order for the playback to continue tough.
See this for the music-app implementation, line 222: http://bazaar.launchpad.net/~music-app-dev/music-app/remix/view/head:/Player.qml#L222
Now I wonder why this appears to work for music-app but fails in my app. Maybe music-app still has the lifecycle exception introduced in 2013? Or is there anything I missed?