x_ite icon indicating copy to clipboard operation
x_ite copied to clipboard

How to start X_ITE in a browser window in fullscreen mode

Open olafgithub opened this issue 1 year ago • 2 comments
trafficstars

I embedded X_ITE on an HTML page and like the page to start with the X_ITE window in fullscreen mode. Just like when selecting fullscreen from the right-click context menu.

Is there an attribute for the x3d-canvas element to do this? Or do you do this in the CSS style? Or can I do it using the browser in JavaScript code? Like after browser = X3D.getBrowser ( ... ); browser.fullscreen = "true"?

I searched for quite a long while in the documentation, but could not find anything,

Thanks,

Olaf

olafgithub avatar Apr 18 '24 11:04 olafgithub

X_ITE used the jquery-fullscreen-plugin and according to its documentation:

This only works when the code was triggered by a user interaction (For example a onclick event on a button). Browsers don't allow entering fullscreen mode without user interaction.

Nevertheless you could trigger a fullscreen (by a user interaction) if you do:

<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-fullscreen-plugin/jquery.fullscreen.min.js"></script>
<x3d-canvas src="some/world.x3d"></x3d-canvas>
<script>
$("x3d-canvas") .fullScreen (true);
</script>

See: https://github.com/code-lts/jquery-fullscreen-plugin

Nevertheless it is always possible to trigger fullscreen (by a user interaction) with pure JavaScript.

create3000 avatar Apr 18 '24 11:04 create3000

Thanks!

I can see the problem. (On the console) When I have time I will find a workaround.

Olaf

olafgithub avatar Apr 18 '24 12:04 olafgithub

I will close this issue now, but feel free to reopen again, or a new issue.

create3000 avatar May 05 '24 15:05 create3000