JavaScripture
Contribute via GitHub Feedback

XRSystem : EventTarget

The entry point for using Augmented Reality (AR) or Virtual Reality (VR) in the browser. Used to create an XRSession. Available through navigator.xr.

Instance Methods

isSessionSupported(mode : String) : Promise<Boolean>

mode must be one of 'inline', 'immersive-vr', or 'immersive-ar'.

Example:

Run

Results:

 

requestSession(mode : String, [options : Object]) : Promise<XRSession>
options : {
requiredFeatures :Iterator
optionalFeatures :Iterator
}

mode must be one of 'inline', 'immersive-vr', or 'immersive-ar'.

Example:

Run

Results:

 

Instance Events

ondevicechange / 'devicechange'  
listener(event : Event) : undefined

Example:

Run

Results: