XRSessionEvent()
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
new XRSessionEvent(type, eventInitDict)
Parameters
type-
A
DOMStringindicating which of the events represented by objects of typeXRSessionEventthis particular object represents. SeeXRSessionEvent > Session event typesfor a list of the permitted values. eventInitDict-
An object with the following values:
session: TheXRSessionto which the event is to be delivered.
Return value
A newly-created XRSessionEvent object representing an object of the
specified type and configured as described by the eventInitDict parameter.
Examples
See XRSessionEvent for example code.
Specifications
| Specification |
|---|
| WebXR Device API # dom-xrsessionevent-xrsessionevent |
Browser compatibility
BCD tables only load in the browser