我已经开始使用一个视图基础应用程序,只是将MPMoviePlayerController添加到Xcode默认生成的默认视图控制器中。请参阅下面的代码
videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
videoPlayer.view.frame = CGRectMake(0, 0, 320, 250);
[self.view addSubview:videoPlayer.view];
[videoPlayer play]
我几乎尝试过所有事情,但不确定我缺少什么。看看我已经尝试过了。
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskAll;
}
- >在plist我提供了所有方向 - >还添加了方向方法在托管Player的视图控制器中。
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
注意:一旦我从控件点击全屏按钮,首先默认视频将采用默认控件样式(嵌入)。而且我会尝试颠倒旋转它不起作用。