开发者

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


@interface MyMovieViewController : MPMoviePlayerViewController
@end

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

@end

Then just instantiate MyMovieViewController instead of MPMoviePlayerViewController.


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜