My app's supported interface orientations are Portrait and Upside down. However, when a video is played, I want it to play full screen landscape. Currently with this code, it only plays portrait, even when the device is rotated:
[player.moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
player.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[self presentMoviePlayerViewControllerAnimated:player];
How can I force it into landscape mode?
Here is how I do it:
In the project file, make sure you are supporting the Landscape Orientations
Now in all of your ViewControllers that should still be Portrait Only, add this code
I have put in both the iOS5 and iOS6 calls so that my code will run on both.
When your MPMoviePlayerController view becomes fullscreen, it will be a new ViewController layered on top of everything else. So, it will be allowed to rotate according to the Supported Interface Orientations of the Project. It will not see where you forced the other ViewControllers into Portrait.