Jordan Smith
Jordan Smith

Reputation: 10378

iPhone: iPod controls grayed out when app runs

My app produces some sound, but I want normal iPod music to be able to play at the same time. I have set up my sound by using:

UInt32  sessionCategory = kAudioSessionCategory_AmbientSound;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);    

This should allow the sound my app produces to be mixed with iPod audio.

-

What actually happens:

If iPod music is playing before the app is started, everything works exactly as expected.

But, if iPod music is not playing, and the user tries to play music by double tapping the home button and using the iPod controls, the iPod controls are grayed out.

In fact, backgrounding the app still leaves the iPod controls grayed out (although quitting the app results in the controls being accessible again.

-

What things could I be missing/what else do I need to do to enable these controls? What methods could be disabling these controls that I might have overlooked in checking my code?

Thanks :)

Upvotes: 1

Views: 324

Answers (1)

russbishop
russbishop

Reputation: 17239

I believe this is a bug in iOS, see iPod mini controls disabled when certain audio session parameters are set

You should still be able to go into the Music/iPod app itself and start playback.

In willResignActive you can stop playback and deactivate your audio session but that may not help enable those controls. There is a similar issue if you use the Playback category and set allow mixing... even if no other app is playing audio, your app icon no longer appears in the multitasking bar with the playback controls and there isn't any way around it.

Upvotes: 1

Related Questions