Table of Contents

Class XRSystem

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The WebXR Device API interface XRSystem 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

EventHandlerNonNull

Methods

IsSessionSupported(XRSessionMode)

NOTE
Experimental
The XRSystem method
isSessionSupported() returns a promise which resolves to
true if the specified WebXR session mode is supported by the user's WebXR
device. Otherwise, the promise resolves with false.
[Value("isSessionSupported")]
public Task<bool> IsSessionSupported(XRSessionMode mode)

Parameters

mode XRSessionMode

Returns

Task<bool>

A Promise that resolves to true if the specified session
mode is supported; otherwise the promise resolves to false.

Remarks

If no devices are available or the browser doesn&apos;t have permission
to use the XR device, the promise is rejected with an appropriate
DOMException.

See also on MDN

RequestSession(XRSessionMode, XRSessionInit)

NOTE
Experimental
The XRSystem interface&apos;s
requestSession() method returns a Promise
which 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

mode XRSessionMode
options XRSessionInit

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.

See also on MDN