From 3c9efb88a2fbdbc784df37deecb298f071939f9d Mon Sep 17 00:00:00 2001 From: Kevin Staunton-Lambert Date: Tue, 13 Aug 2024 13:13:30 +1000 Subject: [PATCH] Resize timing bug around webxr-polyfill (getEyeParameters) --- src/plugin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugin.js b/src/plugin.js index a5c2c97..04d0d9d 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -675,7 +675,13 @@ void main() { let height = this.player_.currentHeight(); if (this.webVREffect) { - this.webVREffect.setSize(width, height, false); + try { + if (this.webVREffect.getVRDisplay()) { + this.webVREffect.setSize(width, height, false); + } + } catch (error) { + videojs.log.error('videojs-vr: resize: ' + error); + } } else if (this.currentSession) { width = window.innerWidth / 2; height = window.innerHeight;