diff --git a/src/big-vr-play-button.js b/src/big-vr-play-button.js index c9d78d2..f6bb8a5 100644 --- a/src/big-vr-play-button.js +++ b/src/big-vr-play-button.js @@ -28,7 +28,15 @@ class BigVrPlayButton extends BigPlayButton { const sessionInit = {optionalFeatures: ['local-floor', 'bounded-floor', 'hand-tracking']}; const self = this; - window.navigator.xr.requestSession('immersive-vr', sessionInit).then(self.onSessionStarted).catch(); + window.navigator.xr.isSessionSupported('immersive-vr').then((supportsImmersiveVR) => { + if (supportsImmersiveVR) { + window.navigator.xr.requestSession('immersive-vr', sessionInit) + .then(self.onSessionStarted) + .catch((e) => { + this.log('Failed to start immersive session'); + }); + } + }); } super.handleClick(event);