Fix 'fit height' a little
This commit is contained in:
parent
a9f99d93be
commit
609247cbf0
@ -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){
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user