2

I have a UIViewController which basically only runs in a landscape mode. This UIViewController has a UIView that inherits YTPlayerView to play YouTube videos in it.

As described, the UIViewController never goes to portrait mode. However, when the device in portrait mode, the YouTube video iFrame rotate to portrait mode while the UIViewController is in landscape mode.

To better visualize this, see the screenshot below:

enter image description here

My question is: How should I prevent the video from rotating in non-landscape mode?

Note: The only time the video goes portrait mode is when the video is playing.

Community
  • 1
  • 1
Ennabah
  • 2,303
  • 2
  • 20
  • 39

0 Answers0