Sid
Sid

Reputation: 9536

How do I continue playing a video's audio track after a screen lock in iOS5?

iOS5 pushes your app to the background when the screen is locked.

In my UIBackgroundModes in the plist file, I can set audio, location and voip to continue in the background.

How about video? I'm using MPMoviePlayerController to play a video file but I do not want the video to pause on a screen lock. It's fine if the user cannot see the video, but I still want the audio to continue playing.

Is there any way to do this?

Upvotes: 2

Views: 1385

Answers (2)

Sid
Sid

Reputation: 9536

No solution to this problem yet. The only one that might work is:

Have a separate audio and video track that start simultaneously. Continue audio on screen lock and on screen unlock, jump the video to the audio file's progress.

Upvotes: 1

Till
Till

Reputation: 27597

Disable using the app-audio-session by adding the following to your MPMoviePlayerController initialization (assuming your instance of that class is called player);

player.useApplicationAudioSession = NO;

Upvotes: 1

Related Questions