diff --git a/inject.js b/inject.js index 79f4e583..eac7ad6d 100644 --- a/inject.js +++ b/inject.js @@ -12,6 +12,8 @@ var tc = { audioBoolean: false, // default: false startHidden: false, // default: false controllerOpacity: 0.3, // default: 0.3 + controllerLocationX: 0, // default: 0 + controllerLocationY: 0, // default: 0 keyBindings: [], blacklist: `\ www.instagram.com @@ -116,6 +118,8 @@ chrome.storage.sync.get(tc.settings, function (storage) { startHidden: tc.settings.startHidden, enabled: tc.settings.enabled, controllerOpacity: tc.settings.controllerOpacity, + controllerLocationX: tc.settings.controllerLocationX, + controllerLocationY: tc.settings.controllerLocationY, blacklist: tc.settings.blacklist.replace(regStrip, "") }); } @@ -127,6 +131,8 @@ chrome.storage.sync.get(tc.settings, function (storage) { tc.settings.enabled = Boolean(storage.enabled); tc.settings.startHidden = Boolean(storage.startHidden); tc.settings.controllerOpacity = Number(storage.controllerOpacity); + tc.settings.controllerLocationX = Number(storage.controllerLocationX); + tc.settings.controllerLocationY = Number(storage.controllerLocationY); tc.settings.blacklist = String(storage.blacklist); // ensure that there is a "display" binding (for upgrades from versions that had it as a separate binding) @@ -273,8 +279,11 @@ function defineVideoController() { log("initializeControls Begin", 5); const document = this.video.ownerDocument; const speed = this.video.playbackRate.toFixed(2); - var top = Math.max(this.video.offsetTop, 0) + "px", - left = Math.max(this.video.offsetLeft, 0) + "px"; + var curTransform = new WebKitCSSMatrix(window.getComputedStyle(this.video).webkitTransform); + var videoLeft = this.video.offsetLeft + curTransform.m41; //real offset left + var videoTop = this.video.offsetTop + curTransform.m42; //real offset top + var top = (Math.max(videoTop, 0)+tc.settings.controllerLocationY) + "px", + left = (Math.max(videoLeft, 0)+tc.settings.controllerLocationX) + "px"; log("Speed variable set to: " + speed, 5); @@ -871,6 +880,11 @@ function handleDrag(video, e) { let style = shadowController.style; let dx = e.clientX - initialMouseXY[0]; let dy = e.clientY - initialMouseXY[1]; + chrome.storage.sync.set( + { + controllerLocationX: initialControllerXY[0] + dx, + controllerLocationY: initialControllerXY[1] + dy + }); style.left = initialControllerXY[0] + dx + "px"; style.top = initialControllerXY[1] + dy + "px"; }; diff --git a/manifest.json b/manifest.json index 2987782f..b85c9295 100644 --- a/manifest.json +++ b/manifest.json @@ -1,13 +1,12 @@ { - "name": "Video Speed Controller", + "name": "Video Speed Controller(2022)", "short_name": "videospeed", - "version": "0.6.3.3", + "version": "0.6.9.4", "manifest_version": 2, "description": "Speed up, slow down, advance and rewind HTML5 audio/video with shortcuts", - "homepage_url": "https://github.com/codebicycle/videospeed", "browser_specific_settings": { "gecko": { - "id": "{7be2ba16-0f1e-4d93-9ebc-5164397477a9}" + "id": "{24b7d099-2101-42d3-9b6f-a6a7688d683f}" } }, "icons": { diff --git a/options.html b/options.html index 242c326f..a8a39583 100644 --- a/options.html +++ b/options.html @@ -160,6 +160,11 @@