Event for enter and exit WebAR?

I saw the onBegin event for WebAR in the docs here but wasn’t sure where and how to subscribe to start of WebAR in my own scripts https://engine.needle.tools/docs/api/classes/WebAR.html#onbegin

Original Post on Discord

by user 103054507105067008

The WebXR component has events and exports an enum (WebXREvent.XRStarted for example)

Related to this issue https://github.com/needle-tools/needle-engine-support/issues/118 trying to see if starting WebAR in Mozilla WebXR viewer somehow kills the window/document/DOM events I have subscribed for touchstart

by user 103054507105067008

Looks like this:

    start() {
        WebXR.addEventListener(WebXREvent.XRStarted, this.onXRStarted.bind(this));
        WebXR.addEventListener(WebXREvent.XRStopped, this.onXRStopped.bind(this));

Just found that too, thanks

by user 103054507105067008