|
@@ -93,7 +93,7 @@ var WEBVR = {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function showVRNotFound() {
|
|
|
|
|
|
+ function disableButton() {
|
|
|
|
|
|
button.style.display = '';
|
|
button.style.display = '';
|
|
|
|
|
|
@@ -101,17 +101,31 @@ var WEBVR = {
|
|
button.style.left = 'calc(50% - 75px)';
|
|
button.style.left = 'calc(50% - 75px)';
|
|
button.style.width = '150px';
|
|
button.style.width = '150px';
|
|
|
|
|
|
- button.textContent = 'VR NOT FOUND';
|
|
|
|
-
|
|
|
|
button.onmouseenter = null;
|
|
button.onmouseenter = null;
|
|
button.onmouseleave = null;
|
|
button.onmouseleave = null;
|
|
|
|
|
|
button.onclick = null;
|
|
button.onclick = null;
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function showVRNotFound() {
|
|
|
|
+
|
|
|
|
+ disableButton();
|
|
|
|
+
|
|
|
|
+ button.textContent = 'VR NOT FOUND';
|
|
|
|
+
|
|
renderer.vr.setDevice( null );
|
|
renderer.vr.setDevice( null );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function showXRNotFound() {
|
|
|
|
+
|
|
|
|
+ disableButton();
|
|
|
|
+
|
|
|
|
+ button.textContent = 'XR NOT FOUND';
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
function stylizeElement( element ) {
|
|
function stylizeElement( element ) {
|
|
|
|
|
|
element.style.position = 'absolute';
|
|
element.style.position = 'absolute';
|
|
@@ -136,7 +150,7 @@ var WEBVR = {
|
|
|
|
|
|
stylizeElement( button );
|
|
stylizeElement( button );
|
|
|
|
|
|
- navigator.xr.supportsSession( 'immersive-vr' ).then( showEnterXR ).catch( showVRNotFound );
|
|
|
|
|
|
+ navigator.xr.supportsSession( 'immersive-vr' ).then( showEnterXR ).catch( showXRNotFound );
|
|
|
|
|
|
return button;
|
|
return button;
|
|
|
|
|