Fix crashing when checking player size

This commit is contained in:
Tamius Han 2020-10-21 21:26:00 +02:00
parent ec83830e78
commit 43b136ca46
2 changed files with 5 additions and 4 deletions

View File

@ -394,7 +394,7 @@ class PlayerData {
this.getPlayer();
}
checkPlayerSizeChange(){
checkPlayerSizeChange() {
// this 'if' is just here for debugging — real code starts later. It's safe to collapse and
// ignore the contents of this if (unless we need to change how logging works)
if (this.logger.canLog('debug')){

View File

@ -303,10 +303,8 @@ class Resizer {
this.zoom.applyZoom(stretchFactors);
//TODO: correct these two
var translate = this.computeOffsets(stretchFactors);
this.applyCss(stretchFactors, translate);
}
@ -581,8 +579,11 @@ class Resizer {
`Video seems to be both wider and taller (or shorter and narrower) than player element at the same time. This is super duper not supposed to happen.\n\n`,
`Player element needs to be checked.`
)
this.player.checkPlayerSizeChange();
if (this.conf.player.checkPlayerSizeChange()) {
this.conf.player.onPlayerDimensionsChanged();
}
}
return translate;
}