Letting mobile users set orientation on itch.io

I have my IFComp beta up on itch.io (with a password) for beta-testing, and overall it’s been working great. I upload a zip file with an index.html file in it, set it to “click to launch in fullscreen”, and everything works…on desktop.

On mobile, though, it always forces my device into landscape orientation, despite all my attempts to prevent that. I can change the settings on itch to force portrait orientation instead, but really I’d like it to just respect users’ device settings, so people can use whichever works best for them.

Is there any way to make this happen?

I’ve found it’s best to force portrait.

Is it weird that I think it’s weird that websites forcing an orientation on mobile phones is a thing?

Oh, I think it’s absolutely stupid. Users should be able to change things like the device orientation without the site thinking it knows better.

This might lead you to an answer… not sure though. I’ve never hosted a game on itch before.

https://github.com/itchio/itch.io/issues/936

Unfortunately, that just lets me force it to be either portrait or landscape; I can’t leave it in the user’s hands.

1 Like

Orientation locking seems to be a JavaScript thing. If the itch page serves the game in it’s own web page when fullscreen is enabled, it might be possible to undo it from the game’s HTML code.

https://stackoverflow.com/questions/55564148/web-app-screen-orientation-lock-orientation-lock-failed

https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation

If you can return the orientation value, you might be able to change it.

If you’re not handy with JS, we might have to wait until someone else chimes in. Surely, it’s possible though. Seems like a huge oversight by the itch team.