okay guys Same question as everyone else. I got it to work if i edited the .plist to support all orientation, but i only need to support rotation at my MPMoviePlayerControl
When reading your question: " I got it to work if i edited the .plist to support all orientation, but i only need to support rotation at my MPMoviePlayerController (and maybe at my MWPhotoBrwoser images)", the first remark would be that you should allow all orientations in the .plist. The allowed orientations in your plist should be the union of all orientations the different view controllers in your application must support.
Whatever you do in a specific view controller, you will never be able to allow rotation to an orientation that is not allowed in your plist.
It is then up to all individual view controllers to say what orientations that particular view controller allows. So in steps:
shouldAutorotateToInterfaceOrientation
(iOS5) and
shouldAutorotate
/ supportedInterfaceOrientations
(iOS6)Add following method in AppDelegate.h
-(NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if(!ISIPAD)){
if ([[self.window.rootViewController presentedViewController] isKindOfClass:[MPMoviePlayerViewController class]] && ![[self.window.rootViewController presentedViewController] isBeingDismissed])
{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
else
{
return UIInterfaceOrientationMaskPortrait;
}
}
return UIInterfaceOrientationMaskAllButUpsideDown ;
}