Control HTML Video Playback Speed with the Console
Ryan Palo

Ryan Palo @rpalo

About: Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!

Location:
Elk Grove, CA
Joined:
Mar 15, 2017

Control HTML Video Playback Speed with the Console

Publish Date: Oct 22 '20
22 1

Quick tip!

My university online class videos don't have a playback speed option. This is doubly a bummer because the professor talks slowly, and I usually listen to podcasts at 2x speed. Between that and I don't have time to watch 4 hours of lecture a week at regular 1x speed, I needed a way to speed up the video. With no playback speed controls built into the UI, I thought I was sunk.

But then I realized: wait a minute! I know things about computers! And JavaScript!

I popped open an Inspect window, did some digging into the HTML to make sure I could do what I wanted to do, and then switched over to the Console. It only took two lines:

video = document.querySelector("video")
video.playbackRate = 2
Enter fullscreen mode Exit fullscreen mode

And like that, my professor sounded like a chipmunk, and I had 2 extra hours of time to look forward to. I'm considering putting together a browser plugin to make some of my own video control buttons for the site!

Comments 1 total

Add comment