V1ru8
V1ru8

Reputation: 6147

iOS 4 background HTTP Live Stream

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 :-(

Upvotes: 1

Views: 2935

Answers (3)

jabley
jabley

Reputation: 2222

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.

Upvotes: 1

tc.
tc.

Reputation: 33592

Setting your audio session category to kAudioSessionCategory_MediaPlayback might work.

Upvotes: 0

V1ru8
V1ru8

Reputation: 6147

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;

Upvotes: 0

Related Questions