From 23f5c9735e647d89065cd3d74f891cfaff054a1c Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Wed, 3 Jan 2018 18:00:53 +0000 Subject: [PATCH 1/5] document Shift+S workaround for Vimeo Fixes #304. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5a8106f..af256d7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Once the extension is installed simply navigate to any page that offers HTML5 vi * **X** - advance video by 10 seconds. * **V** - show/hide the controller. +_Note: Vimeo's allocation of **S** as a keyboard shortcut for sharing videos clashes with this, however you can still decrease playback speed via **Shift+S**._ + _Note: you can customize these shortcut keys in the extension settings page and even make the extension remember your current playback speed._ ### FAQ From 7079bbf718f4546d68258d4753cd513eb296db58 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Sun, 1 Apr 2018 13:36:36 -0700 Subject: [PATCH 2/5] document upper & lowercase use of shortcuts --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af256d7..ec54845 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Once the extension is installed simply navigate to any page that offers HTML5 vi * **X** - advance video by 10 seconds. * **V** - show/hide the controller. -_Note: Vimeo's allocation of **S** as a keyboard shortcut for sharing videos clashes with this, however you can still decrease playback speed via **Shift+S**._ +Some sites may assign other functionality to same shortcut keys — these collisions are inevitable, unfortunately. As a workaround, we listen both for lower and upper case values (i.e. you can use `Shift-`) if there is other functionality assigned to the lowercase key. This is not a perfect solution, as some sites may listen to both, but works most of the time. _Note: you can customize these shortcut keys in the extension settings page and even make the extension remember your current playback speed._ From b5426ef21b0fca657b020bf2ad3e6747bda263fe Mon Sep 17 00:00:00 2001 From: Can Arslan Date: Sun, 1 Apr 2018 23:58:00 +0200 Subject: [PATCH 3/5] Fix for #296 new version of chrome gives error when 0.06 speed given. 0.0625.toFixed() gives 0.06 so we should give at least 0.07 to it. --- inject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inject.js b/inject.js index 6826ddd..0bcefc5 100644 --- a/inject.js +++ b/inject.js @@ -340,7 +340,7 @@ chrome.runtime.sendMessage({}, function(response) { } else if (action === 'slower') { // Video min rate is 0.0625: // https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp?l=167 - var s = Math.max(v.playbackRate - tc.settings.speedStep, 0.0625); + var s = Math.max(v.playbackRate - tc.settings.speedStep, 0.07); v.playbackRate = Number(s.toFixed(2)); } else if (action === 'reset') { resetSpeed(v, 1.0); From 70a055156e2a35945acb8b05234c91a35d38b96c Mon Sep 17 00:00:00 2001 From: Can Arslan Date: Mon, 2 Apr 2018 05:51:24 +0200 Subject: [PATCH 4/5] resetSpeed and fastSpeed conflict #221 (#222) * resetSpeed and fastSpeed conflict #221 --- inject.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/inject.js b/inject.js index 0bcefc5..abdade5 100644 --- a/inject.js +++ b/inject.js @@ -358,7 +358,18 @@ chrome.runtime.sendMessage({}, function(response) { function resetSpeed(v, target) { if (v.playbackRate === target) { - v.playbackRate = tc.settings.resetSpeed; + if(v.playbackRate === tc.settings.resetSpeed) + { + if (target !== 1.0) { + v.playbackRate = 1.0; + } else { + v.playbackRate = tc.settings.fastSpeed; + } + } + else + { + v.playbackRate = tc.settings.resetSpeed; + } } else { tc.settings.resetSpeed = v.playbackRate; chrome.storage.sync.set({'resetSpeed': v.playbackRate}); From 0999acc7fccb3d63a829e83477a6224310ef90fa Mon Sep 17 00:00:00 2001 From: Can Arslan Date: Fri, 13 Apr 2018 07:52:41 +0200 Subject: [PATCH 5/5] Fix for #326 (#327) * Fix for #326, #269, #309 - previous approach disabled controller for local playback --- inject.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inject.js b/inject.js index abdade5..b85b23b 100644 --- a/inject.js +++ b/inject.js @@ -191,7 +191,7 @@ chrome.runtime.sendMessage({}, function(response) { window.onload = () => { initializeNow(window.document) }; - if (document && document.doctype && document.doctype.name == "html") { + if (document) { if (document.readyState === "complete") { initializeNow(document); } else { @@ -206,7 +206,7 @@ chrome.runtime.sendMessage({}, function(response) { function initializeNow(document) { // enforce init-once due to redundant callers - if (document.body.classList.contains('vsc-initialized')) { + if (!document.body || document.body.classList.contains('vsc-initialized')) { return; } document.body.classList.add('vsc-initialized');