Update : One thing to add if you notice that your status bar is interrupted after you return to the controller from the landscape video, you need to set the status bar as not hidden in false in viewWillLayoutSubviews .
override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: .None) }
For those in Swift, a few extra notes. This method ( application:supportedInterfaceOrientationsForWindow ) should be in your AppDelegate class or in what you set in @UIApplicationMain . To access the MPMoviePlayerViewController class, you must remember import MoviePlayer .
Secondly, the UIInterfaceOrientationMask value UIInterfaceOrientationMask incompatible with the Swift delegate version, so you need to access rawValue and convert the resulting Uint to Int . Here is a Swift solution for those who need it.
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow) -> Int { var orientation = UIInterfaceOrientationMask.Portrait if let presentedController = window.rootViewController?.presentedViewController { //check for the controllers if presentedController is MPMoviePlayerViewController || presentedController.isKindOfClass( NSClassFromString("AVFullScreenViewController").self ) || presentedController.isKindOfClass( NSClassFromString("MPInlineVideoFullscreenViewController").self ) { orientation = .AllButUpsideDown } //otherwise, we may be inside a Nav. //safely get the nav controller otherwise ignore this block else if let navController = presentedController as? UINavigationController { if navController.topViewController is MPMoviePlayerViewController || navController.topViewController.isKindOfClass( NSClassFromString("AVFullScreenViewController").self ) || navController.topViewController.isKindOfClass( NSClassFromString("MPInlineVideoFullscreenViewController").self ) { orientation = .AllButUpsideDown } } } return Int(orientation.rawValue) }
source share