I present an MPMovieViewController with the following code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"Tutorial" ofType:@"m4v"];
// If path is NULL (the resource does not exist) return to avoid crash
if (path == NULL)
return;
NSURL *url = [NSURL fileURLWithPath:path];
MPMoviePlayerViewController *mpViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
mpViewController.moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
mpViewController.moviePlayer.shouldAutoplay = YES;
// NOTE: This can crash the app in the Simulator. This is a known bug
// in xcode: http://stackoverflow.com/a/8317546/472344
[self presentMoviePlayerViewControllerAnimated:mpViewController];
This works fine in iOS 4.3 and up, but I've had someone test it on a device running iOS 4.2.1 and the movie player view controller presents, but immediately dismisses itself. I can't find anything in the docs that would explain this. Does anyone have any ideas?