views:

406

answers:

1

I've got an iPhone app with a short intro video. If a user launches the app while their iPod is playing music, the music will stop while the video plays (whether or not the video has sound), and the audio stays permanently stopped after video playback. Apple seems to indicate that you can solve this with AudioSession tricks: http://www.devworld.apple.com/iphone/library/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/WorkingWithOpenALiPodMusicandMovies/WorkingWithOpenALiPodMusicandMovies.html

But their suggestions here just don't seem to work; it seems like MPMoviePlayerController overrides the audio session configuration for its own purposes. Ideally I'd mix the movie audio over the iPod audio or maybe use ducking, but even restarting the music might be a passable fix. Any ideas?

A: 

You can only have a single music-providing app at any time and multiple sources of (brief) sounds. If a background app is playing music, your app can overlay brief sounds. If you want to play music, the background app has to be stopped.

So I don't think that what you're trying to achieve is possible using MPMoviePlayerController (or any of the high-level audio frameworks). You might be able to overlay an audio track of a movie, if it's sufficiently short but MPMoviePlayerController is probably not good for this.

Nick Toumpelis
Not true, it's possible according to the documentation, and possible in a new fixed version that I can't talk about and basically confirmed now myself with Apple that it's a bug on their side.
Jason Coco
Can you post an example? Thanks.
Nick Toumpelis