diff --git a/src/ext/lib/video-data/VideoData.js b/src/ext/lib/video-data/VideoData.js index 19f6e40..f0252c9 100644 --- a/src/ext/lib/video-data/VideoData.js +++ b/src/ext/lib/video-data/VideoData.js @@ -33,6 +33,9 @@ class VideoData { async onVideoLoaded() { if (!this.videoLoaded) { + if (this.video.videoWidth && this.video.videoHeight) { + return; // onVideoLoaded is a lie in this case + } this.logger.log('info', 'init', '%c[VideoData::onVideoLoaded] ——————————— Initiating phase two of videoData setup ———————————', 'color: #0f9'); this.videoLoaded = true; @@ -52,6 +55,10 @@ class VideoData { } } + videoUnloaded() { + this.videoLoaded = false; + } + async injectBaseCss() { try { await this.pageInfo.injectCss(` diff --git a/src/ext/lib/video-transform/Resizer.js b/src/ext/lib/video-transform/Resizer.js index 7a5ec8f..6b056eb 100644 --- a/src/ext/lib/video-transform/Resizer.js +++ b/src/ext/lib/video-transform/Resizer.js @@ -146,7 +146,8 @@ class Resizer { } if (!this.video.videoWidth || !this.video.videoHeight) { - this.logger.log('warning', 'debug', '[Resizer::setAr] Video has no width or no height. This is not allowed. Aspect ratio will not be set.'); + this.logger.log('warning', 'debug', '[Resizer::setAr] Video has no width or no height. This is not allowed. Aspect ratio will not be set, and videoData will be uninitialized.'); + this.conf.videoUnloaded(); } this.logger.log('info', 'debug', '[Resizer::setAr] trying to set ar. New ar:', ar)