Ough! A half of a day spent, and the problem solved! He he.
As the documentation above says, this is really it! The core points are:
More responsibility is moving to the app and the app delegate.
Now, iOS containers (such as UINavigationController) do not consult
their children to determine whether they should autorotate. By
default, an app and a view controller’s supported interface
orientations are set to UIInterfaceOrientationMaskAll for the iPad
idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone
idiom.
So, any time something with root controller changes, the system asks app delegate "So, what are we? Rotating or not?"
If "rotating":
the supported orientations are retrieved only if this view controller returns YES from its shouldAutorotate method
then system asks our app delegate for
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return ...;
}
That's really pretty simple.
How to determine when should we allow Portrait or Landscape etc - is up to you. Testing for root controller didn't work for me because of some points, but this works:
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return self.fullScreenVideoIsPlaying ?
UIInterfaceOrientationMaskAllButUpsideDown :
UIInterfaceOrientationMaskPortrait;
}
The property "fullScreenVideoIsPlaying" is set up by me manually whenever I need that.
The only other important thing to be careful is the enum. As it says in docs ... (read carefully above iPad/iPhone thing). So, you can play with those as you need.
Another tiny thing was some buggy behaviour after closing the player controller. There was one time when it did not change the orientation, but that happened once and in some strange way, and only in simulator (iOS 6 only, of course). So I even could not react, as it happened unexpectedly and after clicking fast on some other elements of my app, it rotated to normal orientation. So, not sure - might be some delay in simulator work or something (or, really a bug :) ).
Good luck!