【发布时间】:2011-11-03 00:49:58
【问题描述】:
我正在使用 MPMoviePlayerViewController。当视频加载并开始播放时,它不会填满整个屏幕。我必须按下右上角的全屏按钮才能做到这一点。如果我使用 MPMoviePlayerController,我根本无法让它填满屏幕。
我可以通过任何方式使用 MPMoviePlayerViewController 让我的视频全屏显示,而无需按下全屏按钮?
我知道我在这里使用的是私有 API,但没关系,它是用于演示的。
代码:
- (void)viewDidLoad
{
[super viewDidLoad];
[[UIDevice currentDevice] setOrientation:UIDeviceOrientationPortrait];
NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"phatpad" ofType:@"mov"];
if (moviePath)
{
NSURL *url = [NSURL fileURLWithPath:moviePath];
player = [[MPMoviePlayerViewController alloc]initWithContentURL:url];
}
player.view.frame = self.view.frame;
[self.view addSubview: player.view];
}
这是一个屏幕。第一种是不按全屏键,第二种是按下后。
【问题讨论】:
标签: iphone ios ipad mpmovieplayercontroller