0

I want to display the video in landscape mode only when video is playing in fullscreen using MPMoviePlayerController in ios6. My application supports only portrait mode.

Can anybody please suggest me, how can i do this?

Thanks.

Meenakshi
  • 259
  • 5
  • 19

2 Answers2

1

I got the answer from below link

iOS 6 MPMoviePlayerViewController and presentMoviePlayerViewControllerAnimated Rotation

Make changes in application delegate file as fllows and its working:

Only change the UIview name as MPSwipableView in ios6

- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
   if ([[self.window.subviews.lastObject class].description isEqualToString:@"MPSwipableView"]) {
      return UIInterfaceOrientationMaskAllButUpsideDown;
   }
   else {
      return UIInterfaceOrientationMaskPortrait;
   }
}
Community
  • 1
  • 1
Meenakshi
  • 259
  • 5
  • 19
0

In your viewController, implement this method,

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape
}
karthika
  • 4,085
  • 3
  • 21
  • 23
  • Hi, Thanks for the reply, But it causes application crash. My whole app only support portrait mode and I want to set the landscape mode for video in full screen. *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES' – Meenakshi Sep 16 '13 at 07:03
  • implement this method, - (BOOL)shouldAutorotate { return (!UIInterfaceOrientationPortraitUpsideDown); } – karthika Sep 16 '13 at 07:16
  • I have tried this method also, but not change the orientation. – Meenakshi Sep 16 '13 at 07:47
  • Hi, Thanks for reply, but got the answer from below link http://stackoverflow.com/questions/12593542/ios-6-mpmovieplayerviewcontroller-and-presentmovieplayerviewcontrolleranimated-r – Meenakshi Sep 16 '13 at 08:01