iOS - 视频不能仅在iOS7上通过iPhone旋转?

Qua*_*Ali 15 mpmovieplayercontroller media-player mpmovieplayer ios ios7

我做了什么?

我正在MPMoviePlayerViewController的扩展类中播放视频,并实现了如下的方向功能

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

    if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
        return FALSE;
    }
    else{
        return TRUE;
    }
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [self setControlsPositions:toInterfaceOrientation];
}
-(BOOL)shouldAutorotate
{
    return YES;
}
Run Code Online (Sandbox Code Playgroud)

我面临的问题是什么?

该应用程序可以在iPhone和iPad上使用iPad(iOS7)上的iOS6上运行良好,但视频不会在安装了iOS7的iPhone上旋转.

这个问题的原因是什么以及如何解决?

更新

我发现,在影片结束的旋转,如果setMovieSourceType设置为MPMovieSourceTypeUnknown,但是当设置为'MPMovieSourceTypeStreaming不旋转

Qua*_*Ali 2

在苹果希望我向他们提供我在 iOS-7 中报告的错误的示例后,我发现我没有推送视图控制器,而是将视图添加到窗口。在这种情况下,其他视图控制器确实获得了方向事件,但子MPMoviePlayerViewController类没有,所以我只是呈现视图控制器,而不是添加其视图,它就工作了。