Skip to content

Instantly share code, notes, and snippets.

@mchelem
Last active July 7, 2023 21:58
Show Gist options
  • Select an option

  • Save mchelem/b6d1f03a064fadd47fda0c7c271bf442 to your computer and use it in GitHub Desktop.

Select an option

Save mchelem/b6d1f03a064fadd47fda0c7c271bf442 to your computer and use it in GitHub Desktop.
Bookmarklet to cycle through playback rates in HTML videos
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