From 5695534a9a6514bfcd910d0382c606a6556cc612 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Sep 2020 16:26:01 +0000 Subject: [PATCH 01/15] Bump bl from 3.0.0 to 3.0.1 Bumps [bl](https://github.com/rvagg/bl) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v3.0.0...v3.0.1) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8e02e4b..cbce842 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1863,9 +1863,9 @@ "optional": true }, "bl": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", - "integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.1.tgz", + "integrity": "sha512-jrCW5ZhfQ/Vt07WX1Ngs+yn9BDqPL/gw28S7s9H6QK/gupnizNzJAss5akW20ISgOrbLTlXOOCTJeNUQqruAWQ==", "dev": true, "requires": { "readable-stream": "^3.0.1" From 02fa4e2fe880524659a269adb3276f1f0e6e3b9a Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 20 Sep 2020 12:26:03 +0200 Subject: [PATCH 02/15] style fixes --- src/ext/lib/video-transform/Scaler.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ext/lib/video-transform/Scaler.js b/src/ext/lib/video-transform/Scaler.js index 577eccf..d846274 100644 --- a/src/ext/lib/video-transform/Scaler.js +++ b/src/ext/lib/video-transform/Scaler.js @@ -32,10 +32,9 @@ class Scaler { } - if(! this.conf.player.dimensions ){ + if (!this.conf.player.dimensions) { ratioOut = screen.width / screen.height; - } - else { + } else { ratioOut = this.conf.player.dimensions.width / this.conf.player.dimensions.height; } @@ -47,17 +46,17 @@ class Scaler { var fileAr = this.conf.video.videoWidth / this.conf.video.videoHeight; - if (ar.type === AspectRatio.FitWidth){ + if (ar.type === AspectRatio.FitWidth) { ratioOut > fileAr ? ratioOut : fileAr ar.ratio = ratioOut; return ratioOut; } - else if(ar.type === AspectRatio.FitHeight){ + else if (ar.type === AspectRatio.FitHeight) { ratioOut < fileAr ? ratioOut : fileAr ar.ratio = ratioOut; return ratioOut; } - else if(ar.type === AspectRatio.Reset){ + else if (ar.type === AspectRatio.Reset) { this.logger.log('info', 'debug', "[Scaler.js::modeToAr] Using original aspect ratio -", fileAr) ar.ar = fileAr; return fileAr; From b55d9dd7b957c3a952b8ec5edc8d1d2091b61896 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 23 Sep 2020 00:19:42 +0200 Subject: [PATCH 03/15] fix? --- src/ext/lib/video-transform/Resizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext/lib/video-transform/Resizer.js b/src/ext/lib/video-transform/Resizer.js index f8c5223..183e4b8 100644 --- a/src/ext/lib/video-transform/Resizer.js +++ b/src/ext/lib/video-transform/Resizer.js @@ -449,7 +449,7 @@ class Resizer { const hdiff = this.conf.player.dimensions.height - this.conf.video.offsetHeight; if (wdiff < 0 && hdiff < 0 && this.zoom.scale > 1) { - this.conf.player.re + this.conf.player.restore(); } const wdiffAfterZoom = this.conf.video.offsetWidth * stretchFactors.xFactor - this.conf.player.dimensions.width; From 4f478a4667a930c86b28c7fbfa1be0aa0cf88ec6 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 23 Sep 2020 00:23:24 +0200 Subject: [PATCH 04/15] Calculate "real" displayed side of video instead of relying on offsetWidth --- src/ext/lib/video-transform/Resizer.js | 76 ++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/src/ext/lib/video-transform/Resizer.js b/src/ext/lib/video-transform/Resizer.js index 183e4b8..12e31d7 100644 --- a/src/ext/lib/video-transform/Resizer.js +++ b/src/ext/lib/video-transform/Resizer.js @@ -442,18 +442,85 @@ class Resizer { // mostly internal stuff + /** + * Returns the size of the video file _as displayed_ on the screen. + * Consider the following example: + * + * * player dimensions are 2560x1080 + * *