iOS 6 MPMoviePlayerViewController and presentMoviePlayerViewControllerAnimated Rotation

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

    I just ran into the same problem. James Chen's solution is correct, but I ended up doing something a little simpler that also works - overriding application:supportedInterfaceOrientationsForWindow in my app delegate and returning allButUpsideDown if my rootView controller was modally presenting an MPMoviePlayerViewController. Admittedly a hack, and may not be appropriate to all situations, but saved me having to change all my view controllers:

    - (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
        return [rootViewController.modalViewController isKindOfClass:MPMoviePlayerViewController.class ] ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskAllButUpsideDown;
    }
    

提交回复
热议问题