From f798b689a4bf139cbca0cde8c66cfc60c3eea71f Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Sun, 14 Nov 2021 15:29:31 -0600 Subject: [PATCH] Add keyboard shortcut for setting playback speed to 1x --- thrimbletrimmer/edit.html | 1 + thrimbletrimmer/index.html | 1 + thrimbletrimmer/scripts/keyboard-shortcuts.js | 11 +++++------ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/thrimbletrimmer/edit.html b/thrimbletrimmer/edit.html index 30926f6..5a05fa2 100644 --- a/thrimbletrimmer/edit.html +++ b/thrimbletrimmer/edit.html @@ -100,6 +100,7 @@
  • Period (.): Forward 1 frame
  • Equals (=): Increase playback speed one step
  • Hyphen (-): Decrease playback speed one step
  • +
  • Backspace: Reset playback speed to 1x
  • Left bracket ([): Set start point for active range (indicated by arrow) to active video time diff --git a/thrimbletrimmer/index.html b/thrimbletrimmer/index.html index 4d243c0..badbc81 100644 --- a/thrimbletrimmer/index.html +++ b/thrimbletrimmer/index.html @@ -112,6 +112,7 @@
  • Period (.): Forward 1 frame
  • Equals (=): Increase playback speed one step
  • Hyphen (-): Decrease playback speed one step
  • +
  • Backspace: Reset playback speed to 1x
  • diff --git a/thrimbletrimmer/scripts/keyboard-shortcuts.js b/thrimbletrimmer/scripts/keyboard-shortcuts.js index c084926..10de403 100644 --- a/thrimbletrimmer/scripts/keyboard-shortcuts.js +++ b/thrimbletrimmer/scripts/keyboard-shortcuts.js @@ -73,12 +73,6 @@ document.addEventListener("keypress", (event) => { case "l": videoElement.currentTime += 10; break; - case "ArrowLeft": - videoElement.currentTime -= 5; - break; - case "ArrowRight": - videoElement.currentTime += 5; - break; case ",": videoElement.currentTime -= 1 / VIDEO_FRAMES_PER_SECOND; break; @@ -130,6 +124,11 @@ document.addEventListener("keydown", (event) => { case "ArrowRight": videoElement.currentTime += 5; break; + case "Backspace": + event.preventDefault(); + videoElement.playbackRate = 1; + document.getElementById("video-controls-playback-speed").value = 1; + break; default: break; }