Flexoid
Flexoid

Reputation: 50

MPMoviePlayerController and incoming call

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

Answers (1)

Vishal
Vishal

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

Related Questions