how do I play fullscreen landscape movie on iOS4 in a portrait application?
The problem is the following:
I have an application in which all viewcontrollers are portrait only 9typical tabbar/navigation app), but I would like to play a move in fullscreen landscape mode. This seems impossible in iOS4 ...
T开发者_如何学运维he best I could come up with was to add the mpmoviecontroller view to my parent view and rotate it by hand, but then there are 2 issues, the first being that i dont have the "Done" button, and that the user still has the possibility to press the "fullscreen" button making the view go portrait and completely wrong.
When using the [moviePlayer setFullscreen:YES animated:YES]; method it automatically sets the view in portrait and there is no way of rotating it.
any suggestions?
I don't remember where I found this, but you can subclass MPMoviePlayerViewController so its only support landscape orientations:
@interface CustomMPMovie : MPMoviePlayerViewController
@end
@implementation CustomMPMovie
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
@end
Hope it helps..
For full screen playback use MPMoviePlayerViewController and then to make it launch and play in landscape format use the "shouldAutorotateToInterfaceOrientation" method on the MPMoviePlayerViewController class.
It looks like this:
[yourInstanceOfMPMoviePlayerViewController shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeRight];
精彩评论