Takahiro пре 6 година
родитељ
комит
645c66d517
1 измењених фајлова са 14 додато и 2 уклоњено
  1. 14 2
      examples/jsm/vr/WebVR.js

+ 14 - 2
examples/jsm/vr/WebVR.js

@@ -171,14 +171,26 @@ var WEBVR = {
 
 		}
 
-		if ( 'xr' in navigator && 'supportsSession' in navigator.xr ) {
+		if ( 'xr' in navigator && 'isSessionSupported' in navigator.xr ) {
 
 			var button = document.createElement( 'button' );
 			button.style.display = 'none';
 
 			stylizeElement( button );
 
-			navigator.xr.supportsSession( 'immersive-vr' ).then( showEnterXR ).catch( showXRNotFound );
+			navigator.xr.isSessionSupported( 'immersive-vr' ).then( funciton ( supported ) {
+
+				if ( supported ) {
+
+					showEnterXR();
+
+				} else {
+
+					showXRNotFound();
+
+				}
+
+			} );
 
 			return button;