Skip to content

Commit

Permalink
fix: Prevent switching to lowest resolution HLS resolution, due to no…
Browse files Browse the repository at this point in the history
…n-displayed video (#177)
  • Loading branch information
gjanblaszczyk authored and brandonocasey committed Aug 21, 2019
1 parent 67fe78b commit 7338726
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,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');
Expand Down Expand Up @@ -641,7 +645,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_;
Expand Down

0 comments on commit 7338726

Please sign in to comment.