Need help with HTML5 screen Orientation

Hi, I’m new to GDevelop (I previously used MultiMedia Fusion Dev 2 - MMF), but I’m really impress with GDevelop ease of use.
But one thing that I’m really stuck on is, how do I lock the HTML5 screen (running on mobile) in a portrait orientation. I got this working (after a lot of hassle) in MMF, via editing the index.html text file. But I have tried the same and similar methods, but nothing worked.

Are there any tutorials or simple examples of how to do this. Either with editing the index.html or simply doing it in the GDevelop engine.
It seems such a simple and important thing to do, but even with ‘adding’ multiple conditions and actions, I just can’t get it to work.

I really hope someone can help.

I think you can just set the orientation in the game properties. This will force the orientation when installing as a Cordova app or PWA.

On the web, just tilt your phone in landscape mode. The canvas will rotate to be in landscape automatically. If the canvas width is too small in proportion to the height, you can overly a black sprite and a message “Please put your phone in landscape mode” to force the player to do so.

Hi @arthuro555 thank you very much for the reply. Yes I have tried something similar to your suggestion.
But I just could not get it to work, do you know of an tutorials on how to detect/compare the canvas size???
But thank you for the help.

Just use “Compare two numbers” with the expression to get camera height and width

OK, thank you @arthuro555 I will give that a try. This is really appreciated…I have been trying to get this to work for ages…fingers crossed.