Change how small player windows are checked

This commit is contained in:
Tamius Han 2025-10-08 19:40:28 +02:00
parent bf7f707ab7
commit 4b0571e123

View File

@ -206,7 +206,7 @@ class PlayerData {
// do the rest // do the rest
this.invalid = false; this.invalid = false;
this.updatePlayer(); this.updatePlayer();
this.isTooSmall = (this.element.clientWidth < 1208 || this.element.clientHeight < 720); this.isTooSmall = this.checkIfTooSmall();;
this.initEventBus(); this.initEventBus();
this.dimensions = undefined; this.dimensions = undefined;
@ -236,6 +236,20 @@ class PlayerData {
} }
} }
/**
* Checks if player dimensions are too small for autodetection to run.
* Full screen is never too small, even if it's
* @param playerDimensions
* @returns
*/
private checkIfTooSmall(playerDimensions?: PlayerDimensions) {
if (playerDimensions) {
return !playerDimensions.fullscreen && (playerDimensions.width < 1208 || playerDimensions.height < 720);
} else {
return !document.fullscreenElement && (this.element.clientWidth < 1208 || this.element.clientHeight < 720);
}
}
private reloadPlayerDataConfig(siteConfUpdate) { private reloadPlayerDataConfig(siteConfUpdate) {
// this.siteSettings = siteConfUpdate; // this.siteSettings = siteConfUpdate;
this.updatePlayer(); this.updatePlayer();
@ -489,7 +503,7 @@ class PlayerData {
}); });
this.isTooSmall = !newDimensions.fullscreen && (newDimensions.width < 1208 || newDimensions.height < 720); this.isTooSmall = this.checkIfTooSmall(newDimensions);
} }
} }