0

In my app, While playing video user can play in full screen in both orientation landscape and portrait. But while move back to original position from full screen, i want to change my controller's orientation to portrait if its running in landscape.

Its working fine if i push that controller, but i have to present it. So its not working with presented controller.

I m using code as below to make it portrait.

  [appdel.navigationController.presentedViewController.view removeFromSuperview];

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
[[UIApplication sharedApplication].self.delegate.window addSubview:[appdel.navigationController.presentedViewController.view];
self.navigationController.navigationBar.hidden=NO;

Thanks for any help

Nikunj
  • 987
  • 11
  • 25
  • Hi you can refer this link : http://stackoverflow.com/questions/10847652/portrait-mode-app-return-to-portrait-mode-after-landscape-fullscreen-movieplaye/10848655#10848655 this works fine for me but someone says apple reject app but i have uploaded more then two app with this... so Wish you best of luck for this... – Nilesh Kikani Jun 13 '12 at 13:45

1 Answers1

0

see in case of presenting the controller when u come in previous controller the
viewWillApear: of previous method will call so change your orientation in viewWillApear: mthod

James Webster
  • 31,873
  • 11
  • 70
  • 114
Abhishek
  • 2,255
  • 1
  • 13
  • 21
  • ok.But, I have to change orientation in same controller, not while go to previous controller. – Nikunj Jun 13 '12 at 13:59
  • previous means that controller from where you have presented another controller.... – Abhishek Jun 13 '12 at 13:59
  • yes got, but my issue is that eg., I have presented playerVC from tempVC. Now in playerVC while playing video in full screen i have rotate device to landscape. Now if i move back to normal view from full screen i want to change it portrait. Still I m in playerVC. got? – Nikunj Jun 13 '12 at 14:12
  • while moving to normal view your video is continuing then it will handle automatically and if its finished then try to rotate when your video playing finished call will call – Abhishek Jun 13 '12 at 14:19