Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: VR switches to the lowest resolution after loading 1 HLS chunk on HLS 360 video #177

Merged
merged 2 commits into from
Aug 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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_;
Expand Down