views:

233

answers:

1

Hi all. When I use the MPMoviePlayerViewController, I don't seem to be able to change the modalTransitionStyle to anything other than the default slide up animation.

Has anyone else managed to get this to work?

MPMoviePlayerViewController* theMoviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:videoURL]];
theMoviePlayer.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; // doesn't work
[self presentMoviePlayerViewControllerAnimated:theMoviePlayer];

Thanks

+1  A: 

Looking at

http://www.drobnik.com/touch/2010/07/the-3-2-hurdle-of-mpmovieplayercontroller/

It seems the code there also sets the modalTransitionStyle of the view controller presenting the MPMoviePlayerViewController instance to the same value. Does that work?

Shaggy Frog
Thanks shaggy. Actually it didn't quite work - but the secret was there in the code you pointed me at. If you use the new [self presentMoviePlayerViewControllerAnimated:theMoviePlayer]; then the transition style is ignored. If however you use the standard [self presentModalViewController:animated:] then it works for the transition INTO the movie, but still uses the default slide animation when the movie ends. Odd!
Ben Clayton
.. oh and that link has some really good tips for making 3.1/2 and 4.0 compatible movie playback. Cheers!
Ben Clayton