Beiträge von popprdc
-
-
I experience a similair issue with my vimeo videos, any news on this?
Kind regards -
Hi Klaus
Thank you for the response. I was able to figure something out thanks to your hint!
I can now restart my video in VR when the headset is put on again. (So far, my test only shows this working in native Quest 2 browser)For any future developers looking for this functionality:
I added this to my webvr_onentervr-action which allows me to catch this changed visibility event for VR mode in my javascript.Codejscall(calc(' if(krpano.webVR.xrSession) { krpano.webVR.xrSession.onvisibilitychange = function(event) { window.onVrSessionVisibilityChange(event) }; } '));
Then in my javascript I did this:
Code
Alles anzeigenwindow.onVrSessionVisibilityChange = (event) => { console.log(event); if (krpano.get("xml.scene") == "scene_video") { if (event.session.visibilityState == "visible") { console.log("Headset was put on in VR mode"); krpano.call("plugin[video].play();"); } else if (event.session.visibilityState == "hidden") { console.log("Headset was removed in VR mode"); krpano.call("plugin[video].stop();"); } } };
Kind regards
Arnout -
Hi all
What I'm trying to do is to have my tour restart a 360° video whenever a VR headset gets put on the head again.Is there a way for me to access the XRsession that the WebVR plugin creates?In order for me to catch it's visibility state changes.
Or am I totally off here?I need something similair like this capability, but then in the VR session:
Codedocument.addEventListener("visibilitychange", () => { console.log(document.hidden); if (document.hidden) { console.log("Took off headset"); } else { console.log("Put on headset"); }});
Kind regardsArnout