I'm playing music using an instance of AVAudioPlayer. Once one song finishes, the next song in the "playlist" is downloaded using NSURLConnection.
Where I'm stuck: I want to be able to download the next audio file in the playlist AND begin playback in the background while the phone is locked, or while the user is using another app. How do I do this?
I have stumbled across this post: Play music in the background using AVAudioplayer which suggests using [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
, but this only seems to allow audio to play in the background, not initiate a download.
Surely this is possible, as Pandora, Spotify, and others can do it...help!