【发布时间】:2012-03-20 13:52:32
【问题描述】:
我有一个仅在纵向模式下运行的 iPhone 应用程序。但我想让 mpmovieplayer 只在横向模式下播放视频。
我怎样才能做到这一点?
这里是代码。
NSString *path = [[NSBundle mainBundle] pathForResource:lblVideoName.text ofType:@"mp4" inDirectory:nil];
NSURL *url = [[NSURL alloc] initFileURLWithPath:path];
NSLog(@"URL== %@",url);
moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:url];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
【问题讨论】:
-
您无需在 MPMovieController 中进行任何设置,而是管理视图方向。
标签: iphone objective-c ios4 mpmovieplayercontroller