I have an app that is supposed to work only in landscape mode. The app needs to play a video. Before iOS 13, I used an MPMediaPlayerViewController
by subclassing it and overriding shouldAutorotate
. Now I see that the replacement class AVPlayerViewController
doesn't support subclassing (see https://developer.apple.com/documentation/avkit/avplayerviewcontroller). How do I enable autorotation without subclassing?
Asked
Active
Viewed 69 times
0

Wolfy
- 1,445
- 1
- 14
- 28
-
check this https://stackoverflow.com/questions/45110393/rotate-video-90-degrees-in-avplayerviewcontroller-possible/45110445#45110445 maybe can help you some way – Reinier Melian Nov 15 '19 at 14:20
-
Reiner, thanks. It is indeed a workaround that works if the device is in LandscapeLeft orientation. However, if I rotate the device while the video is playing, the video automatically rotates to the wrong orientation. I can't understand why auto rotations are not officially supported anymore... – Wolfy Nov 15 '19 at 15:13