From e4c5e75085f4d9878b431c51c2870832c9100b50 Mon Sep 17 00:00:00 2001 From: yakyouk Date: Wed, 20 Jul 2022 00:30:33 +0800 Subject: [PATCH] allow catching enterVR error --- src/core/scene/a-scene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/scene/a-scene.js b/src/core/scene/a-scene.js index 4c9e99aaeba..38907aa3957 100644 --- a/src/core/scene/a-scene.js +++ b/src/core/scene/a-scene.js @@ -229,7 +229,7 @@ module.exports.AScene = registerElement('a-scene', { if (this.xrSession) { this.xrSession.removeEventListener('end', this.exitVRBound); } - navigator.xr.requestSession(useAR ? 'immersive-ar' : 'immersive-vr', { + return navigator.xr.requestSession(useAR ? 'immersive-ar' : 'immersive-vr', { requiredFeatures: ['local-floor'], optionalFeatures: ['bounded-floor'] }).then(function requestSuccess (xrSession) { @@ -261,7 +261,7 @@ module.exports.AScene = registerElement('a-scene', { attributes: presentationAttributes }]).then(enterVRSuccess, enterVRFailure); } - return Promise.resolve(); + // return Promise.resolve(); } // No VR.