MPMoviePlayerViewController doesn't auto-rotate
ios, iphone, objective-c
Solution
Solution:
For anyone that might encounter this, the reason the video wasn't rotating was that I was accidentally adding the RootViewController has the window's rootViewController, rather than the UINavigationController.
self.window.rootViewController = navController;
is correct
`self.window.rootViewController = rootViewController; `
is not
Thank you guys for your help and input along the way.
Problem
I'm having some strange behavior where my `MPMoviePlayerViewController` isn't `auto`-rotating when the `orientation` changes. However, I recreated the same view hierarchy in a fresh project and when the `MPMoviePlayerViewController` player was up, it rotated to every orientation. I've scoured the project looking for anything that might be setting the orientation explicitly, but there is nothing. I'll lay out all the relevant information here and the things that I've tried so far. The view hierarchy currently looks like this: - Navigation Controller - "Root" View Controller <- navigation controller's 'rootViewController' - "Feed" View Controller <- Pushed on the navigation stack by the Root VC - "Preview" View Controller <- Presented as a modal VC from the Feed - MPMoviePlayerViewController Subclass <- presented by the Feed VC via 'presentMoviePlayerViewControllerAnimated' Every class in the view hierarchy responds to shouldAutorotateToInterfaceOrientation with YES only for UIInterfaceOrientationPortrait. Things I've tried: - Manually sending the `shouldAutorotateToInterfaceOrientation` up stack from the "Root" VC up to the `MPMoviePlayerViewController` - Overriding the `MPMoviePlayerViewController` subclass' implementation of `shouldAutorotateToInterfaceOrientation` to return YES for both landscape orientations and YES for all orientations. - Setting 'Supported Device Orientation' in the project's summary tab. - Calling the `presentMoviePlayerViewControllerAnimated` from other VCs like the Feed VC If the movie player properly rotates in a fresh project with same view hierarchy, what could possible be getting in the way here. Any ideas as to where the orientation might be getting stuck?