We are developing an app (with lots of videos) that we want to render in Portrait mode, except when playing a video. We would like the orientation to be on Autorotate, or at least LandscapeLeft, when a video is playing but can’t get this to work at all.
I’ve searched a lot for answers on this but can’t find anything that will work for us. Setting “Screen.orientation = ScreenOrientation.LandscapeLeft” in code before playing a video doesn’t work. Neither does changing the orientation setting in “Player Settings” in Unity; it just messes up the UI when not playing a video.
Any help would be very much appreciated! Our release date is very very soon and being forced to play videos in Portrait mode is a major drawback for our app, considering videos is one of the biggest features in it.
There is code in AppController.mm that handles the movie viewer, search for video view controller. It’s possible that changing some of the logic there for handling the orientation of the UnityVideoViewController will achieve what you want. Alternatively, rotate the video before you render it out, so the video is portrait and not landscape. When you play a portrait video back in a portrait game, it’ll look landscape, if you get what I mean.
(Have you checked that playing back landscape video when the game is portrait is acceptable to Apple?)