diff --git a/js/modules/ArDetect.js b/js/modules/ArDetect.js index 2c5d60e..6ed8d53 100644 --- a/js/modules/ArDetect.js +++ b/js/modules/ArDetect.js @@ -160,6 +160,7 @@ class ArDetector { start(){ console.log("%c[ArDetect::setup] Starting automatic aspect ratio detection.", _ard_console_start); this._halted = false; + this.conf.resizer.resetLastAr(); this.scheduleFrameCheck(0, true); } @@ -171,6 +172,7 @@ class ArDetector { this._halted = true; clearTimeout(this.setupTimer); clearTimeout(this.timer); + this.conf.resizer.resetLastAr(); } isRunning(){ diff --git a/js/modules/Resizer.js b/js/modules/Resizer.js index 40a19d8..dbb3d9f 100644 --- a/js/modules/Resizer.js +++ b/js/modules/Resizer.js @@ -85,7 +85,6 @@ class Resizer { } else if (this.stretcher.mode === StretchMode.HYBRID) { var stretchFactors = this.stretcher.calculateStretch(ar); } else if (this.stretcher.mode === StretchMode.BASIC) { - console.log("basic stretch mode") var stretchFactors = this.stretcher.calculateBasicStretch(); } @@ -95,10 +94,10 @@ class Resizer { var translate = this.computeOffsets(stretchFactors); this.applyCss(stretchFactors, translate); - console.log("applied css") + } - // if(! this.destroyed) - // this.startCssWatcher(); + resetLastAr() { + this.lastAr = {type: 'original'}; } setLastAr(override){ @@ -110,7 +109,6 @@ class Resizer { } setStretchMode(stretchMode){ - console.log("setting stretch mode:", stretchMode) this.stretcher.mode = stretchMode; this.restore(); } diff --git a/js/modules/Stretcher.js b/js/modules/Stretcher.js index b0793cd..1c27e94 100644 --- a/js/modules/Stretcher.js +++ b/js/modules/Stretcher.js @@ -51,15 +51,37 @@ class Stretcher { } calculateBasicStretch() { - console.log("calculating basic stretch - -- stretcher") - // var videoAr = this.conf.video.videoWidth / this.conf.video.videoHeight; - // var playerAr = this.conf.player.dimensions.width / this.conf.player.dimensions.height; + // video.videoWidth in video.videoHeight predstavljata velikost datoteke. + // velikost video datoteke je lahko drugačna kot velikost