Made extgension remember default stretch mode
This commit is contained in:
parent
5b9080c1c7
commit
4eba239da9
@ -5,8 +5,8 @@ const _prod = false;
|
|||||||
var Debug = {
|
var Debug = {
|
||||||
performanceMetrics: true, // should not be affected by debug.debug in order to allow benchmarking of the impact logging in console has
|
performanceMetrics: true, // should not be affected by debug.debug in order to allow benchmarking of the impact logging in console has
|
||||||
init: true,
|
init: true,
|
||||||
debug: true,
|
// debug: true,
|
||||||
// debug: false,
|
debug: false,
|
||||||
// keyboard: true,
|
// keyboard: true,
|
||||||
debugResizer: true,
|
debugResizer: true,
|
||||||
debugArDetect: true,
|
debugArDetect: true,
|
||||||
|
@ -18,7 +18,6 @@ class ArDetector {
|
|||||||
|
|
||||||
this.sampleCols = [];
|
this.sampleCols = [];
|
||||||
|
|
||||||
// todo: dynamically detect the following two
|
|
||||||
this.canFallback = true;
|
this.canFallback = true;
|
||||||
this.fallbackMode = false;
|
this.fallbackMode = false;
|
||||||
|
|
||||||
@ -60,7 +59,7 @@ class ArDetector {
|
|||||||
throw "Settings prevent autoar from starting"
|
throw "Settings prevent autoar from starting"
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("[ArDetect::init] INITIALIZATION FAILED!\n", e);
|
console.log("%c[ArDetect::init] INITIALIZATION FAILED!\n", _ard_console_stop, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +71,7 @@ class ArDetector {
|
|||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
setup(cwidth, cheight, forceStart){
|
setup(cwidth, cheight){
|
||||||
if(Debug.debug || Debug.init) {
|
if(Debug.debug || Debug.init) {
|
||||||
console.log("[ArDetect::setup] Starting autodetection setup. arid:", this.arid);
|
console.log("[ArDetect::setup] Starting autodetection setup. arid:", this.arid);
|
||||||
}
|
}
|
||||||
@ -237,7 +236,6 @@ class ArDetector {
|
|||||||
// (we are running when _halted is neither true nor undefined)
|
// (we are running when _halted is neither true nor undefined)
|
||||||
if (this._halted === false) {
|
if (this._halted === false) {
|
||||||
this._paused = true;
|
this._paused = true;
|
||||||
// this.conf.resizer.resetLastAr();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,13 @@ class VideoData {
|
|||||||
// player dimensions need to be in:
|
// player dimensions need to be in:
|
||||||
// this.player.dimensions
|
// this.player.dimensions
|
||||||
|
|
||||||
|
// apply default align and stretch
|
||||||
|
if (Debug.init) {
|
||||||
|
console.log("%c[VideoData::ctor] Initial resizer reset!", {background: '#afd', color: '#132'});
|
||||||
|
}
|
||||||
|
this.resizer.reset();
|
||||||
|
|
||||||
|
|
||||||
this.vdid = (Math.random()*100).toFixed();
|
this.vdid = (Math.random()*100).toFixed();
|
||||||
if (Debug.init) {
|
if (Debug.init) {
|
||||||
console.log("[VideoData::ctor] Created videoData with vdid", this.vdid,"\nextension mode:", this.extensionMode);
|
console.log("[VideoData::ctor] Created videoData with vdid", this.vdid,"\nextension mode:", this.extensionMode);
|
||||||
|
@ -37,7 +37,8 @@ class Resizer {
|
|||||||
this.cssWatcherIncreasedFrequencyCounter = 0;
|
this.cssWatcherIncreasedFrequencyCounter = 0;
|
||||||
|
|
||||||
|
|
||||||
this.lastAr = this.settings.getDefaultAr(); // this is the aspect ratio we start with
|
// this.lastAr = this.settings.getDefaultAr(); // this is the aspect ratio we start with
|
||||||
|
this.lastAr = {type: 'original'};
|
||||||
this.videoAlignment = this.settings.getDefaultVideoAlignment(); // this is initial video alignment
|
this.videoAlignment = this.settings.getDefaultVideoAlignment(); // this is initial video alignment
|
||||||
this.destroyed = false;
|
this.destroyed = false;
|
||||||
|
|
||||||
@ -107,12 +108,16 @@ class Resizer {
|
|||||||
|
|
||||||
// // pause AR on basic stretch, unpause when using other mdoes
|
// // pause AR on basic stretch, unpause when using other mdoes
|
||||||
// fir sine reason unpause doesn't unpause. investigate that later
|
// fir sine reason unpause doesn't unpause. investigate that later
|
||||||
if (this.stretcher.mode === StretchMode.Basic) {
|
try {
|
||||||
this.conf.arDetector.pause();
|
if (this.stretcher.mode === StretchMode.Basic) {
|
||||||
} else {
|
this.conf.arDetector.pause();
|
||||||
if (this.lastAr.type === 'auto') {
|
} else {
|
||||||
this.conf.arDetector.unpause();
|
if (this.lastAr.type === 'auto') {
|
||||||
|
this.conf.arDetector.unpause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) { // resizer starts before arDetector. this will do nothing but fail if arDetector isn't setup
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// do stretch thingy
|
// do stretch thingy
|
||||||
@ -294,7 +299,7 @@ class Resizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reset(){
|
reset(){
|
||||||
this.setStretchMode(StretchMode.NoStretch);
|
this.setStretchMode(this.settings.active.sites[window.location.hostname] ? this.settings.active.sites[window.location.hostname].stretch : this.settings.active.sites['@global'].stretch);
|
||||||
this.zoom.setZoom(1);
|
this.zoom.setZoom(1);
|
||||||
this.resetPan();
|
this.resetPan();
|
||||||
this.setAr('reset');
|
this.setAr('reset');
|
||||||
|
Loading…
Reference in New Issue
Block a user