Understanding the 'presentchange' event

Hi! In the WebVR lab project I there’s a line (in look-camera.js) like this:

appVrDisplay.on("presentchange", this._onVrPresentChange, this);

I looked at the documentation on pc.VrDisplay, but I don’t see any descriptions of what exactly ‘present’ means. I suspect that presentchange is fired whenever the VrDisplay goes from ‘presenting’ to ‘not presenting’, but I’m just wondering what exactly ‘presenting’ refers to.

Is presentchange fired when (and only when) the user clicks the glasses in the bottom right corner, to enter VR mode? Or are there other situation in which that event would be fired? Does the ‘present’ variable simply represent whether VR mode is enabled?

Thanks!

Hi Pete,

presentchange is fired by the engine at the same time as the browser fires vrdisplaypresentchange as per the WebVR spec.

Presenting is when the browser is rendering to the VR display. For example, in Oculus and Vive, presenting is when the browser switches from displaying on the monitor to displaying on the headset. For Daydream and Gear VR this refers to the change from display mono to displaying stereo.