Skip to content

Commit

Permalink
HelioWebXRPolyfill clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Nov 20, 2019
1 parent c60e388 commit ad47577
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions examples/js/vr/HelioWebXRPolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
* @author mvilledieu / http://github.com/mvilledieu
*/

if ( /(Helio)/g.test( navigator.userAgent ) && "xr" in navigator) {
if ( /(Helio)/g.test( navigator.userAgent ) && 'xr' in navigator ) {

console.log( "Helio WebXR Polyfill (Lumin 0.98.0)" );

if ('isSessionSupported' in navigator.xr) {
if ( 'isSessionSupported' in navigator.xr ) {

const tempIsSessionSupported = navigator.xr.isSessionSupported.bind( navigator.xr );

Expand All @@ -18,7 +19,7 @@ if ( /(Helio)/g.test( navigator.userAgent ) && "xr" in navigator) {

}

if ('isSessionSupported' in navigator.xr && "requestSession" in navigator.xr) {
if ( 'isSessionSupported' in navigator.xr && 'requestSession' in navigator.xr ) {

const tempRequestSession = navigator.xr.requestSession.bind( navigator.xr );

Expand All @@ -28,19 +29,19 @@ if ( /(Helio)/g.test( navigator.userAgent ) && "xr" in navigator) {

var sessionInit = { optionalFeatures: [ 'local-floor', 'bounded-floor' ] };

tempRequestSession( 'immersive-ar', sessionInit).then(function ( session ) {
tempRequestSession( 'immersive-ar', sessionInit ).then( function ( session ) {

resolve( session );

}).catch( function ( error ) {
} ).catch( function ( error ) {

return reject( error );

});
} );

});
} );

}
};

}

Expand Down

0 comments on commit ad47577

Please sign in to comment.