W3cubDocs

/Web APIs

XRSessionEvent: XRSessionEvent() constructor

The WebXR Device API's XRSessionEvent() constructor creates and returns a new XRSessionEvent object. These objects represent events announcing state changes in an XRSession representing an augmented or virtual reality session.

Syntax

js

new XRSessionEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers set it to end or visibilitychange.

options

An object that, in addition of the properties defined in Event(), can have the following properties:

session

The XRSession to which the event is to be delivered.

Return value

A new XRSessionEvent object representing an object of the specified type and configured as described by the options parameter.

Examples

See XRSessionEvent for example code.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
XRSessionEvent 79 79 No No 66 No No 79 No 57 No 11.2

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRSessionEvent/XRSessionEvent