Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPMoviePlayerController fullscreen in landscape mode in a portrait project

in my app i have selected only the portrait mode in the project setting:

enter image description here

and i use it in this way:

player = [[MPMoviePlayerController alloc] init];
[player setContentURL:videoURL];
[player play];

but when i display a video using MPMoviePlayerController in full screen and i try to rotate it, doens't rotate, and stay in portrait, there is a simple way without enable the landscape mode in the project setting, to active the landscape in fullscreen?

like image 946
Piero Avatar asked Jan 25 '26 16:01

Piero


1 Answers

You have 2 options:

  1. Enable landscape mode in the project settings and override supportedInterfaceOrientations for your view controllers.
  2. In your app delegate, add the application:supportedInterfaceOrientationsForWindow: method and, when playing a movie, make sure that this returns UIInterfaceOrientationMaskAllButUpsideDown.
like image 195
Guy Kogus Avatar answered Jan 28 '26 07:01

Guy Kogus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!