iPhone 4.0 problem.. MPMoviePlayerViewController , AVAudio APIs - iphone

I'm making iphone program. The main function is playing video files, and recording sound.
OS 3.1.3 version is fine. But iPhone 4.0 makes problem!!
When I executed playing video (MPMoviePlayerController) and continuously recording sound (AVAudioRecorder), AVAudioRecorder doesn't work....
No recording..! ;o;
Somebody help!!

Check the useApplicationAudioSession property on MPMoviePlayerController. In iOS 3.1.x, the movie player was always getting its own system provided audio session. In iOS 4.0, it can now share the application session, and that's the default value as well. Try switching that property to NO before starting to play your movie.

Related

iOS SystemSoundID does not work on iPod 4, but works on iPhone 4

Why SystemSoundID work on iPhone and not on iPod?
I've searched the Apple docs. and googled but have found nothing.
My app plays .m4a sound files using SystemSoundID on iPhone gen 4 (iOS 5.1) OK, but not on iPod gen 4 (iOS 5.1) nor iPod gen 2 (iOS 4.2). Sounds don't play, and completion callback fails.
AVAudioPlayer works fine on on all, which I use for continually playing background music, but I need the SystemSoundID AudioServicesAddSystemSoundCompletion in order to queue up back to back sounds.
I would use AVAudioPlayer to play the back to back sound files but I cannot find a completion callback function for it.
Settings->Sounds->Ringer&Alerts open it ,and set to max volume. I just forget to open it, so the SoundID can't play.

MPMoviePlayerController playback problem

I'm having trouble with playing audio stream using MPMoviePlayerController in the background. On the foreground it's playing the audio just fine, but when the application goes to the background, sound disappears and the time keeps going. I have initialized the AVAudioSession with AVAudioSessionCategoryPlayback and have put the required background modes to audio in info.plist file. Also I have set player.useApplicationAudioSession = YES;. What could be the possible problem here? Thanks in advance :)
This ios background link indicates that the useApplicationAudioSession property value should be set to NO for iOS 3.2 and newer. (I have an app that does this and it works fine in background mode.

MPMoviePlayerController wont play movie on iPhone 3G when in release mode but will in debug mode

OK, I've got a weird one here...
I have an issue with MPMoviePlayerController and playing a m4v movie on an old iphone 3g.
When I connect the device to my mac, and run it through Xcode with the build set to Device|Debug - the movie plays fine.
When I change the build to Device|Release, the MPMoviePlayerPlaybackDidFinishNotification is called immediately with an error of "This movie format is not supported" and the movie is not shown.
Running 4.1 on the device, and have 4.1 set as the base SDK.
Do you have any ideas?
Thanks
Chris
Maybe the problem is really with your video encoding. Try example video provided in this tutorial:
http://mobiledevelopertips.com/video/getting-mpmovieplayercontroller-to-cooperate-with-ios4-3-2-ipad-and-earlier-versions-of-iphone-sdk.html
If problem still occurs, let me know.

IPad videos don't play after multiple runs

I'm working on an IPad application (iOS 3.2) that plays a couple of videos using the MediaPlayer framework. After running the app for a while videos don't play anymore. The video is loaded, meaning i can buffer through it but it's started in pause mode and cannot be set to played. Each time i press play it pauses again. After restarting the device videos behave normal again.
Does anyone have any idea why this strange behavior happens?
Found the solution that worked for me. If i set the MPMoviePlayerController's useApplicationAudioSession to NO then videos play normally.

iOS4 and audio playback during backgrounding

When my app is backgrounded, the audioplayer continues to play, but i cant hear any sound. When i open my app again, it plays from the point where it would have been had the app not been backgrounded at all. This shows that the app is playing in the background though it is not audible. Why could this be happening?
I have set the audio key in the info.plist for the UIBackgroundModes array. Also my audioplayer is set to the "AVAudioSessionCategoryPlayback" category with an override to allow for audio mixing. So what am i doing wrong that im unable to hear the audio even though it is playing in the background?
Could this be an issue with the simulator alone as i have not been able to test this on a device with iOS4 so iv only been testing it on the simulator.
It's an issue with the simulator most likely. I implemented what you stated and it works just fine on the device: Entering background on iOS4 to play audio