Merge pull request #5 from jordn/master

Limit minimum speed to 0.00 and reduce the '10s rewind' to only slow the video down 0.10
This commit is contained in:
Ilya Grigorik
2014-05-31 19:03:09 -07:00
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ HTML5 video provides a native API to accelerate playback of any video. The probl
Once the extension is installed simply navigate to any page that offers HTML5 video ([example](http://www.youtube.com/watch?v=E9FxNzv1Tr8)), and you'll see a speed indicator in top left corner. Hover over the indicator to reveal the controls to accelerate, slowdown, or rewind the video (10 seconds + lowers playback speed). Or, even better, simply use your keyboard: Once the extension is installed simply navigate to any page that offers HTML5 video ([example](http://www.youtube.com/watch?v=E9FxNzv1Tr8)), and you'll see a speed indicator in top left corner. Hover over the indicator to reveal the controls to accelerate, slowdown, or rewind the video (10 seconds + lowers playback speed). Or, even better, simply use your keyboard:
* **a** - will rewind video 10s and lower playback speed. * **a** - will rewind video 10s and lower playback speed **by 10 points**.
* **s** - will lower playback speed. * **s** - will lower playback speed.
* **d** - will accelerate playback speed. * **d** - will accelerate playback speed.

View File

@@ -85,10 +85,10 @@ chrome.extension.sendMessage({}, function(response) {
videoTags.forEach(function(v) { videoTags.forEach(function(v) {
if (!v.paused && !v.classList.contains("vc-cancelled")) { if (!v.paused && !v.classList.contains("vc-cancelled")) {
if (action === 'rewind') { if (action === 'rewind') {
v.playbackRate -= 0.20; v.playbackRate -= 0.10;
v.currentTime -= 10; v.currentTime -= 10;
} else if (action === 'faster') { v.playbackRate += 0.10 } } else if (action === 'faster') { v.playbackRate += 0.10 }
else if (action === 'slower') { v.playbackRate -= 0.10 } else if (action === 'slower') { v.playbackRate = Math.max(v.playbackRate - 0.10, 0.00) }
} }
}); });
} }