diff --git a/js/modules/PageInfo.js b/js/modules/PageInfo.js index 647c461..c1fa4ef 100644 --- a/js/modules/PageInfo.js +++ b/js/modules/PageInfo.js @@ -201,7 +201,7 @@ class PageInfo { } } - setZoom(step){ + zoomStep(step){ for(var vd of this.videos){ vd.zoomStep(step); } diff --git a/js/modules/Resizer.js b/js/modules/Resizer.js index f68c840..98b4736 100644 --- a/js/modules/Resizer.js +++ b/js/modules/Resizer.js @@ -66,11 +66,11 @@ class Resizer { this.videoData.destroy(); } - var dimensions = this.scaler.calculateCrop(ar); + var zoomFactors = this.scaler.calculateCrop(ar); - if(! dimensions || dimensions.error){ + if(! zoomFactors || zoomFactors.error){ if(Debug.debug){ - console.log("[Resizer::setAr] failed to set AR due to problem with calculating crop. Error:", (dimensions ? dimensions.error : dimensions)); + console.log("[Resizer::setAr] failed to set AR due to problem with calculating crop. Error:", (zoomFactors ? zoomFactors.error : zoomFactors)); } if(dimensions.error === 'no_video'){ this.conf.destroy(); @@ -82,11 +82,11 @@ class Resizer { // if we set stretching, we apply stretching if (this.stretch.mode == StretchMode.FULL){ - stretchFactors = Stretcher.calculateStretch(dimensions); + this.stretcher.calculateStretch(ar); } else if (this.stretch.mode == StretchMode.CONDITIONAL) { - stretchFactors = Stretcher.conditionalStretch(dimensions, ExtensionConf.stretch.conditionalDifferencePercent); + this.stretcher.conditionalStretch(zoomFactors, ar); } - this.zoom.applyZoom(dimensions); + // this.zoom.applyZoom(dimensions); var cssOffsets = this.computeOffsets(dimensions); this.applyCss(cssOffsets, stretchFactors); @@ -121,10 +121,10 @@ class Resizer { startCssWatcher(){ // this.haltCssWatcher = false; if(!this.cssWatcherTimeout){ - if(Debug.debug) - console.log("[Resizer.js] STARTING CSS WATCHER") + // if(Debug.debug) + // console.log("[Resizer.js] STARTING CSS WATCHER") - this.cssWatcherTimeout = setInterval(this.cssWatcher, 200, this); + // this.cssWatcherTimeout = setInterval(this.cssWatcher, 200, this); } } diff --git a/js/modules/Scaler.js b/js/modules/Scaler.js index 80a0eb3..6a3b1e9 100644 --- a/js/modules/Scaler.js +++ b/js/modules/Scaler.js @@ -110,45 +110,30 @@ class Scaler { console.log("[Scaler::calculateCrop] ar is " ,ar, ", file ar is", fileAr, ", this.conf.player.dimensions are ", this.conf.player.dimensions.width, "×", this.conf.player.dimensions.height, "| obj:", this.conf.player.dimensions); var videoDimensions = { - width: 0, - height: 0, + xFactor: 1, + yFactor: 1, actualWidth: 0, // width of the video (excluding pillarbox) when