ghiboz
ghiboz

Reputation: 7993

MPMoviePlayerViewController on iPad view Landscape

I have a view and a MPMoviePlayerViewController.. the iPad is oriented in landscape left mode, but when I play the video, the video is good to see in portrait mode... is there a way to force movieplayer to rotate in landscape mode? thanks in advance

Upvotes: 1

Views: 4519

Answers (2)

tc.
tc.

Reputation: 33592

@interface MyMovieViewController : MPMoviePlayerViewController
@end

@implementation MyMovieViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}

@end

Then just instantiate MyMovieViewController instead of MPMoviePlayerViewController.

Upvotes: 4

Saurabh
Saurabh

Reputation: 22873

you can force a MPMoviePlayerViewcontroller to work in landscapce mode by

[player setOrientation:UIDeviceOrientationPortrait animated:NO];

You can read my blog entry for sample code http://www.makebetterthings.com/blogs/iphone/play-video-on-iphone-and-ipad/

Upvotes: 3

Related Questions