I'm using a MPMoviePlayerController to play some video, I get image, but as soon as I try to play a sound without the earphones, the volume control disappears with an animation. If I plug the earphones, or some external speakers, the volume control returns with an animation.
The app has been tested with an iPad iOS 3.2 and works fine, also with an iPod touch 2G iOS 3.0 and works fine too, but the problem comes with the iPhone 4, and iOS 4.1.
I found out it's because I hadn't set the Session category:
NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryError];
if (setCategoryError) { //handle error }
http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Cookbook/Cookbook.html#//apple_ref/doc/uid/TP40007875-CH6-SW6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With