Fix 'fit height' a little

This commit is contained in:
Tamius Han 2020-12-20 01:00:06 +01:00
parent a9f99d93be
commit 609247cbf0
2 changed files with 12 additions and 7 deletions

View File

@ -91,10 +91,15 @@ class Scaler {
const compensatedStreamAr = streamAr * heightCompensationFactor;
let arCorrectionFactor = 1;
if (playerAr < compensatedStreamAr) {
arCorrectionFactor = this.conf.player.dimensions.width / this.conf.video.offsetWidth;
} else if (ar.type !== AspectRatio.Reset) {
arCorrectionFactor /= heightCompensationFactor;
if (ar.type !== AspectRatio.FitHeight) {
if (playerAr < compensatedStreamAr) {
console.warn('AR CORRECT FACTOR')
arCorrectionFactor = this.conf.player.dimensions.width / this.conf.video.offsetWidth;
} else if (ar.type !== AspectRatio.Reset) {
console.warn('ANTI-HEIGHTCOMPENSATION')
arCorrectionFactor /= heightCompensationFactor;
}
}
if(!this.conf.video){

View File

@ -221,10 +221,10 @@ squeezeFactor: ${squeezeFactor}`, '\nvideo', this.conf.video);
}
}
const arCorrectionFactor = this.getArCorrectionFactor();
// const arCorrectionFactor = this.getArCorrectionFactor();
// correct factors, unless we're trying to reset
stretchFactors.xFactor *= arCorrectionFactor;
stretchFactors.yFactor *= arCorrectionFactor;
// stretchFactors.xFactor *= arCorrectionFactor;
// stretchFactors.yFactor *= arCorrectionFactor;
stretchFactors.arCorrectionFactor = this.getArCorrectionFactor();
return stretchFactors;