Add keyboard shortcut for setting playback speed to 1x

pull/255/head
ElementalAlchemist 3 years ago committed by Mike Lang
parent 481b934eb8
commit f798b689a4

@ -100,6 +100,7 @@
<li>Period (.): Forward 1 frame</li> <li>Period (.): Forward 1 frame</li>
<li>Equals (=): Increase playback speed one step</li> <li>Equals (=): Increase playback speed one step</li>
<li>Hyphen (-): Decrease playback speed one step</li> <li>Hyphen (-): Decrease playback speed one step</li>
<li>Backspace: Reset playback speed to 1x</li>
<li> <li>
Left bracket ([): Set start point for active range (indicated by arrow) to active video Left bracket ([): Set start point for active range (indicated by arrow) to active video
time time

@ -112,6 +112,7 @@
<li>Period (.): Forward 1 frame</li> <li>Period (.): Forward 1 frame</li>
<li>Equals (=): Increase playback speed one step</li> <li>Equals (=): Increase playback speed one step</li>
<li>Hyphen (-): Decrease playback speed one step</li> <li>Hyphen (-): Decrease playback speed one step</li>
<li>Backspace: Reset playback speed to 1x</li>
</ul> </ul>
</div> </div>
</div> </div>

@ -73,12 +73,6 @@ document.addEventListener("keypress", (event) => {
case "l": case "l":
videoElement.currentTime += 10; videoElement.currentTime += 10;
break; break;
case "ArrowLeft":
videoElement.currentTime -= 5;
break;
case "ArrowRight":
videoElement.currentTime += 5;
break;
case ",": case ",":
videoElement.currentTime -= 1 / VIDEO_FRAMES_PER_SECOND; videoElement.currentTime -= 1 / VIDEO_FRAMES_PER_SECOND;
break; break;
@ -130,6 +124,11 @@ document.addEventListener("keydown", (event) => {
case "ArrowRight": case "ArrowRight":
videoElement.currentTime += 5; videoElement.currentTime += 5;
break; break;
case "Backspace":
event.preventDefault();
videoElement.playbackRate = 1;
document.getElementById("video-controls-playback-speed").value = 1;
break;
default: default:
break; break;
} }

Loading…
Cancel
Save