Browse Source

WebVR: Support exclusive and immersive webxr sessions.

Mr.doob 7 years ago
parent
commit
2941033a27
1 changed files with 10 additions and 3 deletions
  1. 10 3
      examples/js/vr/WebVR.js

+ 10 - 3
examples/js/vr/WebVR.js

@@ -78,7 +78,10 @@ var WEBVR = {
 
 				if ( currentSession === null ) {
 
+					// TODO Remove exclusive
+
 					device.requestSession( { exclusive: true } ).then( onSessionStarted );
+					device.requestSession( { immersive: true } ).then( onSessionStarted );
 
 				} else {
 
@@ -137,11 +140,15 @@ var WEBVR = {
 
 			navigator.xr.requestDevice().then( function ( device ) {
 
-				device.supportsSession( { exclusive: true } ).then( function () {
+				// TODO Remove exclusive
 
-					showEnterXR( device );
+				device.supportsSession( { exclusive: true } )
+					.then( function () { showEnterXR( device ); } )
+					.catch( showVRNotFound );
 
-				} ).catch( showVRNotFound );
+				device.supportsSession( { immersive: true } )
+					.then( function () { showEnterXR( device ); } )
+					.catch( showVRNotFound );
 
 			} ).catch( showVRNotFound );