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.
XRSessionEvent()
Syntax
new XRSessionEvent(type, eventInitDict)
Parameters
-
type
-
A
DOMString
indicating which of the events represented by objects of typeXRSessionEvent
this particular object represents. SeeXRSessionEvent > Session event types
for a list of the permitted values. -
eventInitDict
-
An object with the following values:
-
session
: TheXRSession
to 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
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
|
No
|
No
|
No
|
79
|
No
|
No
|
No
|
11.2
|
© 2005–2021 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