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;}

28 points
*

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.

permalink
report
reply
13 points

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

permalink
report
parent
reply
15 points
*

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

permalink
report
reply
5 points

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.

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
4 points

Ah yes I get it! Thanks

permalink
report
parent
reply
9 points

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.

permalink
report
reply
8 points

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

permalink
report
reply
2 points

Chromium browsers still support bookmarklets

permalink
report
parent
reply
7 points

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.

permalink
report
reply

You Should Know

!youshouldknow@lemmy.world

Create post

YSK - for all the things that can make your life easier!

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must begin with YSK.

All posts must begin with YSK. If you’re a Mastodon user, then include YSK after @youshouldknow. This is a community to share tips and tricks that will help you improve your life.



Rule 2- Your post body text must include the reason "Why" YSK:

**In your post’s text body, you must include the reason “Why” YSK: It’s helpful for readability, and informs readers about the importance of the content. **



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That’s it.



Rule 5- No baiting or sealioning or promoting an agenda.

Posts and comments which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding non-YSK posts.

Provided it is about the community itself, you may post non-YSK posts using the [META] tag on your post title.



Rule 7- You can't harass or disturb other members.

If you harass or discriminate against any individual member, you will be removed.

If you are a member, sympathizer or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people and you were provably vocal about your hate, then you will be banned on sight.

For further explanation, clarification and feedback about this rule, you may follow this link.



Rule 8- All comments should try to stay relevant to their parent content.

Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- The majority of bots aren't allowed to participate here.

Unless included in our Whitelist for Bots, your bot will not be allowed to participate in this community. To have your bot whitelisted, please contact the moderators for a short review.



Partnered Communities:

You can view our partnered communities list by following this link. To partner with our community and be included, you are free to message the moderators or comment on a pinned post.

Community Moderation

For inquiry on becoming a moderator of this community, you may comment on the pinned post of the time, or simply shoot a message to the current moderators.

Credits

Our icon(masterpiece) was made by @clen15!

Community stats

  • 4.8K

    Monthly active users

  • 390

    Posts

  • 16K

    Comments