I am building a game application where I need to play animation videos and their corresponding sounds(may be different depending on situation). I have all videos and sounds file are ready but I am not able to play them simultaneously. I am using MPMoviePlayer for video and AVFoundation framework to play audio. Is there anyway to run these both simultaneously?
For Video:
MPMoviePlayerViewController *videoController = [[[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:[cellDetails objectForKey:@"AVFile"]]] autorelease];
[self presentMoviePlayerViewControllerAnimated:videoController];
For Sound:
// Instantiates the AVAudioPlayer object, initializing it with the sound
AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: soundFileURL error: nil];
self.appSoundPlayer = newPlayer;
[newPlayer release];
[appSoundPlayer prepareToPlay];
appSoundPlayer.numberOfLoops = -1;
[appSoundPlayer setVolume: self.soundLevel];
[appSoundPlayer setDelegate: self];
[appSoundPlayer play];
Thanks.