YSK: How to get any youtube playback-speed you want! Using a little JS.

I often set the playback-rate of youtube videos to something like 1.25 or 1.5 to get through a video a little faster without getting bored.

But sometimes 1.25 is a little to fast for my taste.

So i just went and had a look into the html and found that i can easily get any playback speed i want by running this snippet:

document.getElementsByClassName('video-stream html5-main-video')[0].playbackRate=1.125;

This sets the speed to 1.125. But any rate will do: 0.69, 4.20, 6.666. Doesn't matter.

It's kinda obvious that it will throw an error if there is not at least one element on the page with the classnames 'video-stream html5-main-video', but nevermind.

I then added this snippet into a browser-bookmark i can click anytime i'm watching a yt video and want to set the speed.

javascript:{document.getElementsByClassName('video-stream html5-main-video')[0].playbackRate=1.125;}

195 points · 25 comments · view on lemmy.world

25 Comments

baseless_discourse@mander.xyz · 28 pts · 3y (1 reply)

PSA, do not copy any JS code on the web to your browser unless you understand it or it has been validated by many others.

in general, well-established browser extension are unlikely to be malicious, but random JS code on the internet can.

(in this specific case, the code seems fine to me.

jcg@halubilo.social · 13 pts · 3y

I was actually surprised that you could still bookmark javascript: URLs since you can't paste them into the address bar anymore.

breadsmasher@lemmy.world · 15 pts · 3y (3 replies)

Doesnt youtube have a playback speed option built into the player?

Sorry, I get it. This allows any playback speed whereas youtube has specific options

catharso@discuss.tchncs.de · 5 pts · 3y

Yes, but it goes in steps of 0.25 and that sometimes is too coarse/rough.

E.g. 0.50, 0.75, 1.00, 1.25, 1.5

This snippet is just to get a little more fine-grained control.

MysteriousSophon21@lemmy.world · 5 pts · 3y (1 reply)

I think what they're trying to tell you is that you can have ANY playback speed instead of the 4 options given by the built in player.

breadsmasher@lemmy.world · 4 pts · 3y

Ah yes I get it! Thanks

person4268@lemm.ee · 9 pts · 3y

If you replace the speed number with Number(prompt(“New speed:”, 1.15)) you should get a dialog box to put a new speed in, so you don’t have to make multiple bookmarks.

zephyr@lemmy.world · 8 pts · 3y (1 reply)

BTW, glad to see bookmarklets still living. If I wasn't wrong, Firefox seems to be the only browser supporting it.

Madbrad200@lemmy.world · 2 pts · 3y

Chromium browsers still support bookmarklets

Darkmeatduck@lemmy.world · 7 pts · 3y

I use Enhancer for YouTube. It uses step increments of .1 plus has a ton of other features like being able to take a screenshot of the video.

Kissaki@feddit.de · 6 pts · 3y

I made myself a Firefox extension with a slider in the player. Super easy to control and change with a slider.

luki@lemm.ee · 5 pts · 3y

I use a plugin called Video Speed Controller, it‘s probably my most used browser extension. You can configure hotkeys as well, which makes it very convenient. I use Q/E for -0.5/+0.5 and A/D for -0.1/+0.1 so I can finetune the playback to my liking with just couple keypresses.

There's also a small window in the top left of the video showing the current speed, which you can toggle by pressing V.

vizhal007@lemmy.world · 4 pts · 3y (3 replies)

Why not just use an extension?

catharso@discuss.tchncs.de · 2 pts · 3y

because doing stuff yourself is fun*!*

but yeah, for most people and most use cases using an extension is obviously the better choice :)

zephyr@lemmy.world · 1 pts · 3y (1 reply)
  • enhancer for yt is closed source afaik
vizhal007@lemmy.world · 1 pts · 3y

I use vidspeedcontroller

lemminer@lemmy.world · 4 pts · 3y

This community is full of nice smart little tips! I 💕 it!

zephyr@lemmy.world · 3 pts · 3y (1 reply)

Saved.

Thanks for this. Used to get a browser extension just for this. Some people on youtube talk reaaally slow that x2.0 sounds like their normal talking speed

SilentStorms@lemmy.fmhy.ml · 1 pts · 3y

No kidding. I've found I've got increasingly more impatient with slow talkers since I started messing with the playback speed. I used to watch videos at 1.25-1.5x, now its up to 2.5-3x

Adda@lemmy.ml · 3 pts · 3y

This is a great solution, but unnecessarily cumbersome to use, in my opinion.

For the same outcome, I use Video Speed Controller to modify playback speed of any video on any website.

yourdogsnipples@lemmy.world · 2 pts · 3y

Nice one, thank you! This'll come in handy for when even 2x isn't fast enough to get to the point.

NotAPenguin@kbin.social · -5 pts · 3y

I recommend Enhancer For Youtube too, it's a nice extension that adds a bunch of useful stuff, like being able to playback at any speed you want.