我正在开发一个 iPad/iPhone 应用程序,该应用程序在按下按钮时显示视频。我的视频可以正常工作,但是我的应用程序被锁定为纵向模式,我希望我的视频仅以横向显示。这是一些与我的问题相关的代码,如果可能的话,我想要最简单和最简单的方法。
-(void) view_intro:(UIButton *)introButton {
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"Introduction" ofType:@".m4v"]];
moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:url];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];}