views:

274

answers:

1

Hi everyone,

I have an AVAudioSession under a AVAudioSessionCategoryPlayback category. I need to be able to stop or pause playback when the screen is locked. Is there any way to achieve this?

So far the only thing that produces an interruption to my audio session is an incoming call.

Thanks in advance!

A: 

AVAudioSessionCategoryPlayback is designed to not suspend audio when the screen is locked. The only categories that are silenced by a screen-lock are AVAudioSessionCategoryAmbient and AVAudioSessionCategorySoloAmbient.

Check-out the AVAudioSession categories' table in the Audio Session Programming Guide.

Laurent Etiemble
I guess another option is using the app Delegate methods and stop the payback manually. This also happens when recording.
sunshineDev