Iphone 为什么可以';在MPMoviePlayerController中播放电影时,我不能正确检索UIDeviceOrientation吗?

Iphone 为什么可以';在MPMoviePlayerController中播放电影时,我不能正确检索UIDeviceOrientation吗?,iphone,mpmovieplayercontroller,mpmovieplayer,uidevice,uiinterfaceorientation,Iphone,Mpmovieplayercontroller,Mpmovieplayer,Uidevice,Uiinterfaceorientation,当我不玩任何东西时,一切都正常(我正在调用beginnotifications等,并使用方向旋转我的视图)。但在我每次尝试玩MPMoviePlayerController之后 UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 方向获取UIDeviceOrientationUnknown 有线索吗? 当电影停止时,一切又恢复正常了。 我需要这个方向来旋转播放器的窗口,因为我使用的是Iphone OS

当我不玩任何东西时,一切都正常(我正在调用beginnotifications等,并使用方向旋转我的视图)。但在我每次尝试玩
MPMoviePlayerController
之后

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
方向
获取
UIDeviceOrientationUnknown

有线索吗? 当电影停止时,一切又恢复正常了。 我需要这个方向来旋转播放器的窗口,因为我使用的是Iphone OS 3.1,所以我不能直接使用MPMovie player控制器中的view属性

至少在低于3.2的iPhone操作系统版本中,我还没有找到一种方法来做到这一点。我放弃了

但是,嘿,我不得不在Ipad上为我的应用程序编写一个版本,我发现对于iPhoneOS3.2,有一种方法可以做到这一点

您需要做的唯一一件事是使用自定义类,该类必须是
mpmovieplayervicewcontroller
的子类,并重写方法
shoulldautorotateTointerFaceOrientation
,以便在需要执行自动旋转时返回yes。这都在
mpmovieplayervewcontroller
类参考中

–泽尔德韦勒