iOS4 mp3 issues

Hi I’m trying to port my game from 3.2 to 4.0 sdk. Upon making builds most everything is working fine, however the mp3’s aren’t playing like they should be. What’s worst is that it’s not consistent either, one moment our mp3’s are playing and the next moment the mp3s aren’t playing. Is anyone else having this problem or is it something in my code I’ll probably have to fix.

Also I know this has been mentioned millions of times before however our .m4v movies aren’t playing in the right orientation. So I created code in Xcode to use the new MPMoviePlayerController to rotate the movie 90 degrees to Landscape Right. The movie runs fine and all, however it seems the movies crash the game every once in awhile. I’m pretty sure I’m releasing the memory correctly, is anyone else having this problem?

iOS 4 and mp3s do not play well together in Unity, correct. There is no solution yet that I’ve seen.

Fixed my problem, apparently my movie player was preventing my mp3s from playing.

I had to use a movie playback did finish notification and explicitly tell the movie player to stop using:

[movieVC stop];

Pain in my rear end. Also the crashing issue isn’t being caused by my movie player, I’m suspecting it’s the mp3s so I’ll try taking it out and see what happens.

Also I’ve noticed there are very many people having trouble rotating their movies into the correct orientation, instead of making a another copy of the movie with a flipped orientation you could use this code:

movieView = [movieVC view];

// size of the view window
[movieView setFrame: CGRectMake(0, 0, 480, 320)];

CGAffineTransform landscapeTransform;

// rotate the view window 90 degrees to landscape left
landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(90));

// translate the view so that the origin of the view is at 0,0/
landscapeTransform = CGAffineTransformTranslate(landscapeTransform, 80, 80);

// set transformations to the view
[movieView setTransform: landscapeTransform];
movieVC.scalingMode = MPMovieScalingModeAspectFit;
movieVC.fullscreen = TRUE;
movieVC.controlStyle = MPMovieControlStyleFullscreen;
movieVC.shouldAutoplay = TRUE;
[[[UIApplication sharedApplication] keyWindow] addSubview: movieView];
UnitySetAudioSessionActive(false);
UnityPause(YES);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];

Keep in mind this only works with devices with OS 4.0, if it’s under 4.0 the app will crash and it will crash hard.