views:

371

answers:

3

I'd like to play an audio HTTP Live Stream in background. But how do I do that?

I tried to add the key (an Array) "UIBackgroundModes" with value "audio" to the info.plist. Now I try to play audio with the MPMoviePlayerController. But as soon as the app goes into background, the audio Playback stops! I don't know of any other API to play a HTTP Live Stream on the iPhone. So is there an other or am I doing something wrong? I searched all over the apple documentation but couldn't find anything useful. There isn't much about background audio in the docs :-(

A: 

Found a soluton: setting useApplicationAudioSession to NO on the MPMoviePlayerController does the job. But it works only on audio only streams. Video streams still stop.

player.useApplicationAudioSession = NO;
V1ru8
A: 

Setting your audio session category to kAudioSessionCategory_MediaPlayback might work.

tc.
A: 

See http://developer.apple.com/iphone/library/qa/qa2010/qa1668.html for a description of what changed in iOS4 and how to implement the functionality you want.

This works for me in one of my apps.

jabley