HTML5 Doesen't build

Hi there! Thank you in advance for helping me.
I created my first folded game by downloading and modifying a free existing game. But…
thought the build works on macOS and on “debug” it doesn’t work under HTML5
It’s just freeze on the splash screen, but no sound, no movement if i use command keys (Everything works perfect on other no-html5 bulds).

If i Open console i see these messages.

Can someone help me?
I really don’t know what is happening here.
Thank you,
bandian

:warning: Failed to execute ‘requestFullscreen’ on ‘Element’: API can only be initiated by a user gesture.


I can’t say for sure without seeing any code, but it sounds like a script in your game is trying to force the game into fullscreen with defos.set_fullscreen() or defos.toggle_fullscreen(). As it says in the DefOS readme:

On HTML5, this only works from defos.on_click() or defos.on_interaction().

1 Like

Mmmm, actually not. Btw
i downloaded the game from here

and the game is TimeLooper (if you’d like to check the code).
Even if i didn’t modify any code, i have this html5 issue.
Thank you so much,

Francesco

I was sort of right, the game calls data.fullscreen(self) which in turn calls defos.toggle_fullscreen(), and that throws a warning in the console. But the game also has a domain lock built-in that disables input if the game is run in a browser, unless it’s on one of the websites listed here. Everything should work if you change:

if domaincheck() then msg.post(".", "acquire_input_focus") end

to:

msg.post(".", "acquire_input_focus")

in handler.script.

3 Likes

Thank you so much!
You have been so much helpful!
I really appreciate this.

bandian

1 Like