Browse Source

Updated WebVR.js

Mr.doob 7 years ago
parent
commit
1f1b6cb360
1 changed files with 5 additions and 7 deletions
  1. 5 7
      examples/js/vr/WebVR.js

+ 5 - 7
examples/js/vr/WebVR.js

@@ -78,7 +78,7 @@ var WEBVR = {
 
 
 				if ( currentSession === null ) {
 				if ( currentSession === null ) {
 
 
-					device.requestSession( { exclusive: true } ).then( onSessionStarted );
+					device.requestSession( { immersive: true, exclusive: true /* DEPRECATED */ } ).then( onSessionStarted );
 
 
 				} else {
 				} else {
 
 
@@ -137,11 +137,9 @@ var WEBVR = {
 
 
 			navigator.xr.requestDevice().then( function ( device ) {
 			navigator.xr.requestDevice().then( function ( device ) {
 
 
-				device.supportsSession( { exclusive: true } ).then( function () {
-
-					showEnterXR( device );
-
-				} ).catch( showVRNotFound );
+				device.supportsSession( { immersive: true, exclusive: true /* DEPRECATED */ } )
+					.then( function () { showEnterXR( device ); } )
+					.catch( showVRNotFound );
 
 
 			} ).catch( showVRNotFound );
 			} ).catch( showVRNotFound );
 
 
@@ -191,7 +189,7 @@ var WEBVR = {
 
 
 					}
 					}
 
 
-				} );
+				} ).catch( showVRNotFound );
 
 
 			return button;
 			return button;