iOS 6 MPMoviePlayerViewController and presentMoviePlayerViewControllerAnimated Rotation

前端 未结 3 1535
轮回少年
轮回少年 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:15

    In appdelegate.m :

    - (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
        if ([[self.window.subviews.lastObject class].description isEqualToString:@"MPMovieView"]) {
            return UIInterfaceOrientationMaskAllButUpsideDown;
        }
        else {
            return UIInterfaceOrientationMaskPortrait;
        }
    }
    

    Kinda a hack, but works well...

提交回复
热议问题