← All posts

Tutorials

HTML5 video speed control — beyond 2x, with keyboard shortcuts

The built-in video player gives you up to 2x speed and that is it. Sometimes you want a lecture at 2.75x, or a webcam recording at 0.5x. One JustZix rule adds keyboard speed control to every HTML5 player — YouTube, Vimeo, online courses, anything.

Why 2x is not the limit

The <video> element has a playbackRate property and it has no upper bound on the HTML side — it is the player's UI that artificially caps the slider at 2x. By setting playbackRate from code, you bypass that slider entirely.

The rule

URL pattern: a video site (e.g. *://*.youtube.com/*) or * globally. The rule's JavaScript:

document.addEventListener('keydown', (e) => {
  if (/input|textarea/i.test(e.target.tagName)) return;
  const v = document.querySelector('video');
  if (!v) return;
  if (e.key === 'd') v.playbackRate += 0.25;
  if (e.key === 's') v.playbackRate = Math.max(0.25, v.playbackRate - 0.25);
  if (e.key === 'r') v.playbackRate = 1;
});

Keys: D speeds up by 0.25x, S slows down, R resets to 1x.

How it works

Extensions — seek and Picture-in-Picture

It is easy to add arrow-key seeking and picture-in-picture:

if (e.key === 'ArrowRight') v.currentTime += 10;
if (e.key === 'ArrowLeft')  v.currentTime -= 10;
if (e.key === 'p') {
  document.pictureInPictureElement
    ? document.exitPictureInPicture()
    : v.requestPictureInPicture();
}

A slider variant — the SLIDER action

Prefer a slider to keys? Make a SLIDER action in the JustZix action bar — you drag it, and the action code sets document.querySelector('video').playbackRate to the slider value. Speed under your thumb, no keys to memorize.

Pitfalls

See also

Install JustZix — and watch at your pace, not the player's.

Rate this post

No ratings yet — be the first.

Try it yourself

Install JustZix and paste any snippet from this article. Two minutes from zero to a working rule across all your devices.

Get JustZix

Features · How it works · Examples · Use cases