【发布时间】:2011-05-03 20:51:21
【问题描述】:
我有一个非常简单的移动视图,加载后会直接跳转到视频中。电影控件显示得很好,一切都很好。但是当我旋转到横向时,我遇到了一个问题,电影播放器的宽度不会随视图调整,所以它仍然太窄。
如果我处于全屏模式,我的导航栏消失了,我可以旋转,它工作没问题。
那么当我切换到横向时如何调整查看器的宽度,或者只是以全屏模式启动视图?
注意:[mpPlay setFullscreen:YES];不是为我做的。
这是我的其余代码:
- (void)viewDidLoad
{
NSBundle * bundle = [NSBundle mainBundle];
NSString * moviePath = [bundle pathForResource:@"movie" ofType:@"mp4"];
NSURL * movieURL = [[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController * mpPlay = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[mpPlay.view setFrame: self.view.bounds]; // player's frame must match parent's
[self.view addSubview: mpPlay.view];
[mpPlay play];
}
【问题讨论】:
标签: iphone orientation mpmovieplayercontroller fullscreen landscape