iOS 6 MPMoviePlayerViewController and presentMoviePlayerViewControllerAnimated Rotation

前端 未结 3 1499
轮回少年
轮回少年 2021-01-01 04:00

In previous iOS versions, our video would rotate automatically but in iOS 6 this is no longer the case. I know that the presentMoviePlayerViewControllerAnimated was designed

3条回答
  •  迷失自我
    2021-01-01 04:29

    This is not limited to MPMoviePlayerViewController. From iOS 6 the autorotation has been changed. see Autorotate in iOS 6 has strange behaviour .

    To make your app behave as pre-iOS 6, you have to make the app support all orientations (edit UISupportedInterfaceOrientations in plist), then for all other view controllers which don't support rotation, override this method to return NO:

    - (BOOL)shouldAutorotate {
        return NO;
    }
    

    By default MPMoviePlayerViewController supports all orientations so this should be enough to make it work.

提交回复
热议问题