0

So, i'm fix interface Iphone is portrait and i wanna show landscapte when i playing video(using MPMoviePlayerController), i have read in ios6 sdk,ShouldAutorotateToInterfaceOrientation is deprecated. How to rotate only this player view? I can only rotate whole app, but don't want to do this.

i tryed with

(BOOL)shouldAutorotate
{
    return [[self.viewControllers lastObject] shouldAutorotate];
}

-(NSUInteger)supportedInterfaceOrientations
{
    return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}

in this link or link but video still doesn't change.. Can you help me

Community
  • 1
  • 1
BlueSky
  • 139
  • 3
  • 9

1 Answers1

0

First of all, in your app settings, do you allow any other orientation besides portrait?

Second, is your view controller embedded in an UINavigationController/UITabBarController/UISplitViewController?

The code you posted is supposed to work as a category or by subclassing an UINavigationController. If your container is not a UINavigationController, it won't work.(at least not for UITabBarController).

Can you also post the code where you enable to rotation for your view controller?

Also, it could be helpful to also show the whole code for your category/subclass.

Andrei Filip
  • 1,145
  • 15
  • 33