Skip to main content

AFrame Events

This section describes events emitted by the xrweb, xrface and xrhand A-Frame components.

You can listen for these events in your web application to call a function that handles the event.

Events Emitted by xrconfig

The following events are emitted by xrconfig (which is automatically added if you only use xrweb, xrface, xrhand or xrlayers):

Event EmittedDescription
camerastatuschangeThis event is emitted when the status of the camera changes. See onCameraStatusChange from XR8.addCameraPipelineModule() for more information on the possible status.
realityerrorThis event is emitted when an error has occured when initializing 8th Wall Web. This is the recommended time at which any error messages should be displayed. The XR8.XrDevice() API can help with determining what type of error messaging should be displayed.
realityreadyThis event is emitted when 8th Wall Web has initialized and at least one frame has been successfully processed. This is the recommended time at which any loading elements should be hidden.
screenshoterrorThis event is emitted in response to the screenshotrequest event resulting in an error.
screenshotreadyThis event is emitted in response to the screenshotrequest event being being completed successfully. The JPEG compressed image of the AFrame canvas will be provided.

Events Emitted by xrweb

Event EmittedDescription
xrimageloadingThis event is emitted when detection image loading begins.
xrimagescanningThis event is emitted when all detection images have been loaded and scanning has begun.
xrimagefoundThis event is emitted when an image target is first found.
xrimageupdatedThis event is emitted when an image target changes position, rotation or scale.
xrimagelostThis event is emitted when an image target is no longer being tracked.
xrmeshfoundThis event is emitted when a mesh is first found either after start or after a recenter().
xrmeshupdatedThis event is emitted when the first mesh found changes position or rotation.
xrmeshlostThis event is emitted when recenter() is called.
xrprojectwayspotscanningThis event is emitted when all Project Wayspots have been loaded for scanning.
xrprojectwayspotfoundThis event is emitted when a Project Wayspot is first found.
xrprojectwayspotupdatedThis event is emitted when a Project Wayspot changes position or rotation.
xrprojectwayspotlostThis event is emitted when a Project Wayspot is no longer being tracked.
xrtrackingstatusThis event is emitted when XR8.XrController starts and any time tracking status or reason changes.

Events Emitted by xrface

Event EmittedDescription
xrfaceloadingThis event is emitted when loading begins for additional face AR resources.
xrfacescanningThis event is emitted when AR resources have been loaded and scanning has begun.
xrfacefoundThis event is emitted when a face is first found.
xrfaceupdatedThis event is emitted when face is subsequently found.
xrfacelostThis event is emitted when a face is no longer being tracked.
xrmouthopenedThis event is emitted when a tracked face's mouth opens.
xrmouthclosedThis event is emitted when a tracked face's mouth closes.
xrlefteyeopenedThis event is emitted when a tracked face's left eye opens.
xrlefteyeclosedThis event is emitted when a tracked face's left eye closes.
xrrighteyeopenedThis event is emitted when a tracked face's right eye opens.
xrrighteyeclosedThis event is emitted when a tracked face's right eye closes.
xrlefteyebrowraisedThis event is emitted when a tracked face's left eyebrow is raised from its initial position when the face was found.
xrlefteyebrowloweredThis event is emitted when a tracked face's left eyebrow is lowered to its initial position when the face was found.
xrrighteyebrowraisedThis event is emitted when a tracked face's right eyebrow is raised from its initial position when the face was found.
xrrighteyebrowloweredThis event is emitted when a tracked face's right eyebrow is lowered to its initial position when the face was found.
xrlefteyewinkedThis event is emitted when a tracked face's left eye closes and opens within 750ms while the right eye remains open.
xrrighteyewinkedThis event is emitted when a tracked face's right eye closes and opens within 750ms while the left eye remains open.
xrblinkedThis event is emitted when a tracked face's eyes blink.
xrinterpupillarydistanceThis event is emitted when a tracked face's distance in millimeters between the centers of each pupil is first detected.

Events Emitted by xrhand

Event EmittedDescription
xrhandloadingThis event is emitted when loading begins for additional hand AR resources.
xrhandscanningThis event is emitted when AR resources have been loaded and scanning has begun.
xrhandfoundThis event is emitted when a hand is first found.
xrhandupdatedThis event is emitted when hand is subsequently found.
xrhandlostThis event is emitted when a hand is no longer being tracked.