diff --git a/src/hub.js b/src/hub.js index 5964531a240c304773db438755140f9c4ddac38d..2d56387dd211fdb5bd4c83f12f69be8795edd920 100644 --- a/src/hub.js +++ b/src/hub.js @@ -7,6 +7,7 @@ import "./utils/logging"; import { patchWebGLRenderingContext } from "./utils/webgl"; patchWebGLRenderingContext(); +import screenfull from "screenfull"; import "three/examples/js/loaders/GLTFLoader"; import "networked-aframe/src/index"; import "naf-janus-adapter"; @@ -244,6 +245,10 @@ const onReady = async () => { if (enterInVR) { scene.enterVR(); + } else if (AFRAME.utils.device.isMobile()) { + document.body.addEventListener("touchend", () => { + if (screenfull.enabled && !screenfull.isFullscreen) screenfull.request(); + }); } AFRAME.registerInputActions(inGameActions, "default");