diff --git a/js/modules/Resizer.js b/js/modules/Resizer.js index d071590..b707d23 100644 --- a/js/modules/Resizer.js +++ b/js/modules/Resizer.js @@ -58,7 +58,7 @@ class Resizer { this.videoData.destroy(); } - var dimensions = this.scaler.calculateCrop(ar, this.video, this.conf.player.dimensions); + var dimensions = this.scaler.calculateCrop(ar); if(! dimensions || dimensions.error){ if(Debug.debug){ diff --git a/js/modules/Scaler.js b/js/modules/Scaler.js index 978e1bd..80a0eb3 100644 --- a/js/modules/Scaler.js +++ b/js/modules/Scaler.js @@ -10,7 +10,7 @@ class Scaler { this.conf = videoData; } - modeToAr(mode, video, playerDimensions){ + modeToAr(mode){ // Skrbi za "stare" možnosti, kot na primer "na širino zaslona", "na višino zaslona" in "ponastavi". // Približevanje opuščeno. // handles "legacy" options, such as 'fit to widht', 'fit to height' and 'reset'. No zoom tho @@ -25,11 +25,11 @@ class Scaler { } - if(! playerDimensions ){ + if(! this.conf.player.dimensions ){ ar = screen.width / screen.height; } else { - ar = playerDimensions.width / playerDimensions.height; + ar = this.conf.player.dimensions.width / this.conf.player.dimensions.height; } // POMEMBNO: GlobalVars.lastAr je potrebno nastaviti šele po tem, ko kličemo _res_setAr(). _res_setAr() predvideva, @@ -57,7 +57,7 @@ class Scaler { return null; } - calculateCrop(mode, video, playerDimensions) { + calculateCrop(mode) { if(!this.conf.video || this.conf.video.videoWidth == 0 || this.conf.video.videoHeight == 0){ @@ -85,12 +85,12 @@ class Scaler { } if(Debug.debug) - console.log("[Scaler::calculateCrop] trying to set ar. args are: ar->",ar,"; playerDimensions->",playerDimensions.width, "×", playerDimensions.height, "| obj:", playerDimensions); + console.log("[Scaler::calculateCrop] trying to set ar. args are: ar->",ar,"; this.conf.player.dimensions->",this.conf.player.dimensions.width, "×", this.conf.player.dimensions.height, "| obj:", this.conf.player.dimensions); - if( (! playerDimensions) || playerDimensions.width === 0 || playerDimensions.height === 0 ){ + if( (! this.conf.player.dimensions) || this.conf.player.dimensions.width === 0 || this.conf.player.dimensions.height === 0 ){ if(Debug.debug) - console.log("[Scaler::calculateCrop] ERROR — no (or invalid) playerDimensions:",playerDimensions); - return {error: "playerDimensions_error"}; + console.log("[Scaler::calculateCrop] ERROR — no (or invalid) this.conf.player.dimensions:",this.conf.player.dimensions); + return {error: "this.conf.player.dimensions_error"}; } // zdaj lahko končno začnemo računati novo velikost videa @@ -100,14 +100,14 @@ class Scaler { // Dejansko razmerje stranic datoteke/