window.addEventListener("vrdisplaypresentchange", () => {
info.textContent = vrDisplay.isPresenting
? "Display has started presenting."
: "Display has stopped presenting.";
reportDisplays();
});Window: vrdisplaypresentchange event / notebook
Window: vrdisplaypresentchange event
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
window.onvrdisplaypresentchange = () => {
info.textContent = vrDisplay.isPresenting
? "Display has started presenting."
: "Display has stopped presenting.";
reportDisplays();
};