godot icon indicating copy to clipboard operation
godot copied to clipboard

HTML iOS wont enter fullsceen

Open PeterMarques opened this issue 1 year ago • 2 comments

Tested versions

3.x

System information

iOS

Issue description

On ipadOS and on macOS, the same export works.

But, on iOS, iphone 15 at least (store tested), it wont enter fullscreen.

If needed, i shall made a test link but the code is provided, maybe there is something wrong, but it works on all platforms.

Steps to reproduce

Make a singleton with:

func _input(event): if OS.get_name() == "HTML5" and !OS.window_fullscreen and event is InputEventMouseMotion == false: yield(get_tree().create_timer(0.5), "timeout") OS.window_fullscreen = true

acess the export on a iOS device.

Minimal reproduction project (MRP)

will provide link later if in need.

PeterMarques avatar Mar 06 '24 18:03 PeterMarques

For security reasons, web browsers only allow entering fullscreen upon user input. If you wait half a second before entering fullscreen, the time spent between the last user input and the fullscreen toggle may be too large and the browser will block the attempt to go fullscreen.

Please upload a minimal reproduction project[^1] to make this easier to troubleshoot.

[^1]: A small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the .godot folder in the archive (but keep project.godot).

Drag and drop a ZIP archive to upload it. Do not select another field until the project is done uploading.

Note for C# users: If your issue is not Mono-specific, please upload a minimal reproduction project written in GDScript or VisualScript. This will make it easier for contributors to reproduce the issue locally as not everyone has a Mono setup available.

PS: This part of the code:

and event is InputEventMouseMotion == false

can be replaced with:

and not event is InputEventMouseMotion

Calinou avatar Mar 06 '24 22:03 Calinou

. If you wait half a second before entering fullscreen [...] browser will block the attempt to go fullscreen.

Every platform and browser works(Linux, windows, Android, ipadOS, macOS). Only iphone wont.

I will try with no delay, maybe it works.

Please upload a minimal reproduction project

Will provide a link and files.


This is the online export of a project with a single button and script:

extends Button
func _input(event):
	if OS.get_name() == "HTML5" and !OS.window_fullscreen and event is InputEventMouseMotion == false:
		OS.window_fullscreen = true
func _pressed():
	if OS.get_name() == "HTML5" and !OS.window_fullscreen:
		OS.window_fullscreen = true

Still, it DOES NOT work on iOS devices, so the delay was not the issue.

Tested on iPhone 15 pro max.

Safari incognito and regular.

(Tested on another project, but will test this link too soon)


Looking for more info, i found :

https://forums.developer.apple.com/forums/thread/133248?page=2

This issue then seens to be widespread.

I will try to rotate the device next text, as this seens to be a solution.

But, the issue istill persist. Maybe if godot run inside a video container??


Indeed, the link does not works. Neither cliking on outside or in the button itself.

PeterMarques avatar Mar 07 '24 00:03 PeterMarques