Intro video sometimes plays in portrait

I have added a short intro video (a company logo) for my game. My project specifies landscape mode only. About 70% of the time when I launch the app, the video shows in portrait mode, even if I have rotated the device to landscape. Then, when the video is done and goes to the next scene, it switches (correctly) to landscape. I am showing the video (media.playVideo) in the scene:show when the event.phase is “did”, to be sure that everything has loaded for the opening scene first.

Is there anything else I can try to ‘force’ that initial screen/scene into landscape mode? Or some other event I need to wait for before starting the video?

There are ways to programmatically set the orientation (via plugin, for instance).

Based on the fact that you’re saying it does work some of the time, I’m thinking if it’s the case that Solar2D and/or apps in general always start in portrait mode and then get switched to whatever the intended mode is?

You could try including a timer with 1ms delay in your main.lua to ensure that the game makes it to the 2nd frame before it starts loading anything else. Perhaps that might be enough to fix your issue?

Something like:

timer.performWithDelay( 1, function()
    -- start playing your video or move to other scenes after delay, etc.
end )

Thanks. I actually tried that (with a timer) and it did not help. I also tried placing a couple of graphics (just black images on the black background) thinking that perhaps it needed some object painted first, and that might trigger the switch to landscape.
I’ll keep experimenting. :slightly_smiling_face: