views:

410

answers:

1

Hi

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 ...

The 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?

A: 

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..

Raspu