diff --git a/js/conf/ExtensionConf.js b/js/conf/ExtensionConf.js index 4b67f3a..0a48248 100644 --- a/js/conf/ExtensionConf.js +++ b/js/conf/ExtensionConf.js @@ -88,6 +88,11 @@ var ExtensionConf = { miscFullscreenSettings: { videoFloat: "center" }, + stretch: { + initialMode: 0, // 0 - no stretch, 1 - conditional, 2 - full + conditionalDifferencePercent: 0.05 // black bars less than this wide will trigger stretch + // if mode is set to '1'. 1.0=100% + }, colors:{ // criticalFail: "background: #fa2; color: #000" } diff --git a/js/lib/VideoData.js b/js/lib/VideoData.js index 0dcc199..ae4103f 100644 --- a/js/lib/VideoData.js +++ b/js/lib/VideoData.js @@ -4,7 +4,18 @@ class VideoData { this.video = video; // todo: add ArDetect instance this.arDetector = new ArDetector(video); - this.resizer = new Resizer(); + this.resizer = new Resizer(this); + + // player dimensions need to be in: + // this.player.dimensions + } + + initAr() { + this.arDetector.init(); + } + + startAr() { + this.arDetector.start(); } destroy() { diff --git a/js/modules/ArDetect.js b/js/modules/ArDetect.js index cc8880d..e8d2295 100644 --- a/js/modules/ArDetect.js +++ b/js/modules/ArDetect.js @@ -10,6 +10,8 @@ class ArDetector { // todo: dynamically detect the following two this.canFallback = true; this.fallbackMode = false; + + this.init(); } init(){ diff --git a/js/modules/Resizer.js b/js/modules/Resizer.js index 31b0beb..425af88 100644 --- a/js/modules/Resizer.js +++ b/js/modules/Resizer.js @@ -1,116 +1,70 @@ if(Debug.debug) console.log("Loading: Resizer.js"); -// restore watchdog. While true, _res_applyCss() tries to re-apply new css until this value becomes false again -// value becomes false when width and height of