繁体   English   中英

MPMoviePlayerViewController方向

[英]MPMoviePlayerViewController orientation

我正在使用cocos2d,我想看电影。 为此,我创建了MPMoviePlayerViewController并将其作为[[CCDirector sharedDirector] openGLView]的子视图。 问题在于它以垂直方向出现。

在应用程序中将方向设置为横向:

[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];

如何更改播放器的方向?

看看有关自动旋转的cocos2d手册页: http : //www.cocos2d-iphone.org/wiki/doku.php/prog_guide :autorotation

基本上,您必须在两种解决方案之间做出选择:

  1. Cocos2D处理方向更改,您需要手动旋转MPMoviePlayerViewController的视图(例如,使用CGAffineTransformMakeRotation)。

  2. Cocos2D的opengl-view无法处理方向更改,并且位于UIViewController中,该UIViewController覆盖了shouldAutorotateToInterfaceOrientation并因此自动为您旋转视图。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM