Class XRSystem
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalXRSystem provides methods which let you get access to an XRSession object representing a WebXR session. With that XRSession in hand, you can use it to interact with the Augmented Reality (AR) or Virtual Reality (VR) device.
[Value("XRSystem")]
public class XRSystem : EventTarget
- Inheritance
-
XRSystem
- Inherited Members
Remarks
Constructors
XRSystem()
public XRSystem()
Properties
Ondevicechange
[Value("ondevicechange")]
public EventHandlerNonNull Ondevicechange { get; set; }
Property Value
Methods
IsSessionSupported(XRSessionMode)
NOTE
ExperimentalisSessionSupported() returns a promise which resolves totrue if the specified WebXR session mode is supported by the user's WebXRdevice. Otherwise, the promise resolves with
false.
[Value("isSessionSupported")]
public Task<bool> IsSessionSupported(XRSessionMode mode)
Parameters
modeXRSessionMode
Returns
- Task<bool>
A Promise that resolves to
trueif the specified session
mode is supported; otherwise the promise resolves tofalse.
Remarks
If no devices are available or the browser doesn't have permission
to use the XR device, the promise is rejected with an appropriate
DOMException.
RequestSession(XRSessionMode, XRSessionInit)
NOTE
ExperimentalrequestSession() method returns a Promisewhich resolves to an XRSession object through which you can manage the
requested type of WebXR session.
[Value("requestSession")]
public Task<XRSession> RequestSession(XRSessionMode mode, XRSessionInit options = null)
Parameters
modeXRSessionModeoptionsXRSessionInit
Returns
- Task<XRSession>
A {{jsxref("Promise")}} that resolves with an XRSession object if the
device and user agent support the requested mode and features.
Remarks
While only one immersive VR session can be active at a time, multiple
inline sessions can be in progress at once.