diff --git a/src/plugin.js b/src/plugin.js index 77622a20..5076e22c 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -483,8 +483,12 @@ class VR extends Plugin { this.renderedCanvas = this.renderer.domElement; this.renderedCanvas.setAttribute('style', 'width: 100%; height: 100%; position: absolute; top:0;'); + + const videoElStyle = this.getVideoEl_().style; + this.player_.el().insertBefore(this.renderedCanvas, this.player_.el().firstChild); - this.getVideoEl_().style.display = 'none'; + videoElStyle.zIndex = '-1'; + videoElStyle.opacity = '0'; if (window.navigator.getVRDisplays) { this.log('is supported, getting vr displays'); @@ -594,7 +598,10 @@ class VR extends Plugin { } // reset the video element style so that it will be displayed - this.getVideoEl_().style.display = ''; + const videoElStyle = this.getVideoEl_().style; + + videoElStyle.zIndex = ''; + videoElStyle.opacity = ''; // set the current projection to the default this.currentProjection_ = this.defaultProjection_;