hack to enter vr until resolve aframe vrdisplayactivate issues

This commit is contained in:
Kevin Ngo
2018-12-11 00:59:38 -08:00
parent 88c0a19ab7
commit 0c8c0b299e

View File

@@ -1,10 +1,10 @@
AFRAME.registerComponent('hack', { AFRAME.registerComponent('hack', {
play: function () { play: function () {
setTimeout(() => { const interval = setInterval(() => {
this.el.sceneEl.exitVR(); if (!this.el.sceneEl.is('vr-mode')) {
setTimeout(() => {
this.el.sceneEl.enterVR(); this.el.sceneEl.enterVR();
}, 100); clearInterval(interval);
}, 250); }
}, 1000);
} }
}); });