DEV Community

Today I Googled: How to Loop Videos on YouTube

Andy Zhao (he/him) on September 05, 2018

Back when music videos starting getting really big on YouTube, a lot of websites popped up that would do something you think YouTube would do for y...
Collapse
 
antogarand profile image
Antony Garand • Edited

No need for an extension, you can add a bookmark with something like

javascript:document.getElementsByClassName('video-stream html5-main-video')[0].loop=true

And click it when you want the video to loop!

Collapse
 
splintor profile image
Shmulik Flint

Even better than bookmarklet - use a userscript to add a Loop button to the page when it loads.
For instance, check out this userscript: greasyfork.org/en/scripts/16323-yo...

For more details about userscripts:
en.wikipedia.org/wiki/Userscript
stackoverflow.com/questions/525898...
tampermonkey.net/

Collapse
 
andy profile image
Andy Zhao (he/him)

Awesome! This is great!!

Collapse
 
sadick profile image
Sadick

But if you right click on the youtube video, there is an option to loop the video currently playing. It works without installing any extensions. Have you checked that?

Collapse
 
andy profile image
Andy Zhao (he/him)

See, this is why I write these posts. :mindblown:

Collapse
 
isaacleimgruber profile image
IsaacLeimgruber

When I discovered it I was also stunned at how stupid and non-ergonomic this feature is

Collapse
 
akashdeepsingh profile image
Akashdeep Singh

I was going to comment this, and then I thought someone might already have, and here you are.

Collapse
 
stephanie profile image
Stephanie Handsteiner

Eh, right click the video and click Loop. 🤣

Collapse
 
andy profile image
Andy Zhao (he/him) • Edited

Oh.... right....

Nothing like good ol' overengineering solutions right? 😓

Collapse
 
rup1 profile image
Rup

Ha yeah you can just right click the video and you get a "Loop" option ;)

You know what woul dbe a great youtube project? THere used to be a full blown website for it but whoever made it took it down.

If you make a youtube playlist and start playing it. Next time you go to the playlist it starts from the beginning and it's frustrating as hell. It woulld be better to be able to resume your playlist wherever you left off.

Collapse
 
ryanoc profile image
Ryan Connolly

I create this to practice guitar riffs. It needs a little work, but I have used it a lot to learn from. You could use it to learn anything repetitive as well. 813software.com/bitpractice/?v=x-x...

Collapse
 
jess profile image
Jess Lee

The style of your writing is so pleasant and easy to read/follow. Keep it up!

Collapse
 
andy profile image
Andy Zhao (he/him)

Thanks!! Glad you enjoyed it!

Collapse
 
andreaszwane profile image
Andreas Zwane • Edited

Yo programmer,
Check this out.

classynemesis.com/projects/ytembed/
Just click the properties you want and VOILA! It loops
generated code:
iframe src="youtube.com/embed/QH2-TGUlwu4?auto..." width="560" height="315" frameborder="0">
/iframe>"
Not as much fun as grinding through code though.

Collapse
 
jsalvador profile image
Juanjo Salvador

Nice hack!

Collapse
 
jacoby profile image
Dave Jacoby

Now I'm wondering what's the markdown to put a YouTube video into your blog post.

OFF TO THE INTERNET!

Collapse
 
andy profile image
Andy Zhao (he/him)

It's custom!

{% youtube video-id %}

See our editor guide for more.

Collapse
 
jacoby profile image
Dave Jacoby

I'd SO love to see that elsewhere, too.

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Hmm, I wonder if other Markdown editors allow using embed links/scripts.

Collapse
 
mogery profile image
Gergő Móricz

right click on video + loop button tho?

Collapse
 
rrei profile image
Rui Rei
Collapse
 
david_j_eddy profile image
David J Eddy

Couldn't you right click and select loop?

Loop video

Collapse
 
sebastiannielsen profile image
Sebastian-Nielsen

You can just right click on the video and click "loop". lol