Additional anti-recursing measures, pt 2

This commit is contained in:
Tamius Han 2021-02-07 12:54:20 +01:00
parent 870384f83b
commit 5efa8c88c1

View File

@ -88,10 +88,18 @@ class PlayerData {
// player size observer may not be strictly necessary here
// note that this function is called manually as well — whenever aspect ratio changes.
// this can result in recursive calls. We don't want recusrive calls.
onPlayerDimensionsChanged_recursing = false;
onPlayerDimensionsChanged(mutationList, observer, context) {
if (this.onPlayerDimensionsChanged_recursing) {
return;
}
this.onPlayerDimensionsChanged_recursing = true;
if (this?.checkPlayerSizeChange()) {
this.videoData.resizer.restore();
}
this.onPlayerDimensionsChanged_recursing = false;
}