I’m new to iPhone Development and writing my first App. The whole App only needs portrait mode, except for playing movies. I am using MPMoviePlayerController to start the movie and it plays in protrait mode. How can I force MPMoviePlayerController to play all movies in Landscape.
I am using Xcode 4 and building for iOS 4.0+. Do I need to enter some settings in the info.plist to allow MPMoviePlayerController to play in landscape?
Here is the code I use to initialize MPMoviePlayerController:
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL: url];
[self.view addSubview:theMovie.view];
theMovie.allowsAirPlay=YES;
[theMovie setFullscreen:YES animated:YES];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
[theMovie play];
Embed the player in it’s own view controller and implement
shouldAutorotateToInterfaceOrientationas follows: