When you\'re watching a video with MPMoviePlayerController
and the user presses the top button to lock the screen, the app goes to sleep and so does the sound from
Sounds like you haven't set your audio session category. Set the AVAudioSession
's category
property to AVAudioSessionCategoryPlayback
to indicate that the app's major purpose is to play back audio, and it therefore should ignore the screen lock button and ring/silent switch. If you're working with the lower-level C API, you'll be using AudioSessionSetProperty(kAudioSessionCategory_MediaPlayback)
, but it's the same concept.