MPMoviePlayerController fullscreen in landscape mode in a portrait project

六眼飞鱼酱① 提交于 2019-12-07 14:35:47

问题


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

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?


回答1:


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.


来源:https://stackoverflow.com/questions/19424693/mpmovieplayercontroller-fullscreen-in-landscape-mode-in-a-portrait-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!