肖像项目中横向模式下的MPMoviePlayerController全屏显示 [英] MPMoviePlayerController fullscreen in landscape mode in a portrait project

查看:97
本文介绍了肖像项目中横向模式下的MPMoviePlayerController全屏显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我仅在项目设置中选择了肖像模式:

in my app i have selected only the portrait mode in the project setting:

我以这种方式使用它:

player = [[MPMoviePlayerController alloc] init];
[player setContentURL:videoURL];
[player play];

但是当我在全屏中使用MPMoviePlayerController显示视频并且尝试旋转它,不旋转并停留在portrait时,有一种简单的方法无需在项目中启用landscape模式设置,以全屏激活landscape?

but when i display a video using MPMoviePlayerController in full screen and i try to rotate it, doens't rotate, and stay in portrait, there is a simple way without enable the landscape mode in the project setting, to active the landscape in fullscreen?

推荐答案

您有2个选项:

  1. 在项目设置中启用横向模式,并为视图控制器覆盖supportedInterfaceOrientations.
  2. 在您的应用程序委托中,添加application:supportedInterfaceOrientationsForWindow:方法,并在播放电影时确保其返回UIInterfaceOrientationMaskAllButUpsideDown.
  1. Enable landscape mode in the project settings and override supportedInterfaceOrientations for your view controllers.
  2. In your app delegate, add the application:supportedInterfaceOrientationsForWindow: method and, when playing a movie, make sure that this returns UIInterfaceOrientationMaskAllButUpsideDown.

这篇关于肖像项目中横向模式下的MPMoviePlayerController全屏显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆