Reputation: 50
I have an issue with MPMoviePlayerController. I use to play shoutcast. t is designed to play when the app goes to background, and everything is working OK. The problem is when it is in the background and I get an incoming call. In that case, the stream pauses, but doesn't come back after call ends.
Upvotes: 1
Views: 255
Reputation: 8256
I had used MPMoviePlayerviewController in one of my App for streaming live audio playing.
Its working fine for me. And my stream also pause & also come back after call ends. I had
no issue. I was doing some changes like declare session property like
below in my code where I play video:
NSError *setCategoryErr = nil;
NSError *activationErr = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryErr];
[[AVAudioSession sharedInstance] setActive: YES error: &activationErr];
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
UIBackgroundTaskIdentifier newTaskId = UIBackgroundTaskInvalid;
newTaskId = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:NULL];
Upvotes: 2