Make the distribution application landscape

hai! I want to ask why this line of code can’t be executed in initialization? But firing in an event works fine, so is there any way to make this string of code execute at initialization? thank you
FullScreen.prototype.initialize = function()
{

 this.app.enableFullscreen(null);
 var mayScreenOrientation=window.screen.orientation;
    mayScreenOrientation.lock("landscape");
    console.log("Test");

};

Hi @11128,

That’s due to browser security, you can only fire that code as a response of user input.

You can put in place a Start button that the player presses to start your application, and as a response you execute that.

1 Like