Last active
July 7, 2023 21:58
-
-
Save mchelem/b6d1f03a064fadd47fda0c7c271bf442 to your computer and use it in GitHub Desktop.
Bookmarklet to cycle through playback rates in HTML videos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript: (function() { | |
| let maxSpeed = 2.0; | |
| let stepSize = 0.25; | |
| let videos = document.querySelectorAll('video'); | |
| for (video of videos) { | |
| if (video.playbackRate >= maxSpeed) { | |
| video.playbackRate = 1.0; | |
| } else { | |
| video.playbackRate = video.playbackRate + stepSize; | |
| } | |
| console.log("Current playback speed " + video.playbackRate); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment