diff --git a/src/ext/lib/video-transform/Resizer.js b/src/ext/lib/video-transform/Resizer.js index 1176df6..024b46e 100644 --- a/src/ext/lib/video-transform/Resizer.js +++ b/src/ext/lib/video-transform/Resizer.js @@ -269,6 +269,8 @@ class Resizer { this.zoom.applyZoom(stretchFactors); + this.stretcher.chromeBugMitigation(stretchFactors); + var translate = this.computeOffsets(stretchFactors); this.applyCss(stretchFactors, translate); } diff --git a/src/ext/lib/video-transform/Scaler.js b/src/ext/lib/video-transform/Scaler.js index b625ac2..e972646 100644 --- a/src/ext/lib/video-transform/Scaler.js +++ b/src/ext/lib/video-transform/Scaler.js @@ -180,6 +180,30 @@ class Scaler { this.logger.log('info', 'scaler', "[Scaler::calculateCrop] Crop factor calculated — ", videoDimensions.xFactor); + // Workaround for Chrome/Edge issue where zooming too much results in video being stretched incorrectly + /** + * Bug description — if the following are true: + * * user is using Chrome or Edge (but surprisingly not Opera) + * * user is using hardware acceleration + * * user is using a noVideo card + * * user is in full screen mode + * Then the video will do Stretch.Basic no matter what you put in `transform: scale(x,y)`. + * + * Because this issue happens regardless of how you upscale the video (doesn't matter if you use transform:scale + * or width+height or anything else), the aspect ratio needs to be limited _before_ applying arCorrectionFactor + * (note that arCorrectionFactor is usually <= 1, as it conpensates for zooming that height=[>100%] on