Warning: Invalid argument supplied for foreach() in /home/techrecipes/public_html/wp-content/themes/techrecipes/header.php on line 77

YouTube Hack: Automatically Start and Loop Videos

Building on the previous URL youtube hack presented here, I have figured out how to automatically start and loop youtube videos.


Davak recently posted on how to hack the URL of a youtube video to increase or decrease the size. This continues the practice of manipulating the URL to change the default embedded youtube player’s characteristics.

I’ll use the very cool Web 2.0 … The Machine is Us/ing Us clip as an example. Here is the default code.

To make the video play automatically (like it does on the youtube page) add &autoplay=1 to both of the youtube url codes above.

So you would change http://www.youtube.com/v/6gmP4nk0EOE to http://www.youtube.com/v/6gmP4nk0EOE&autoplay=1

This resulting code will therefore automatically play the youtube clip when the page is visited (unless youtube is choking for some reason today):

If you want the youtube clip to automatically restart and loop when done then add this additional modifier to the url: &loop=1

Therefore, you would change all the youtube urls to this:
http://www.youtube.com/v/6gmP4nk0EOE&autoplay=1&loop=1

The results code should autostart and autoloop…

The Conversation

Follow the reactions below and share your own thoughts.

  • http://www.leadstampede.com Brian

    Thank you for this page. It really helped me loop my videos so that people don’t end up looking at other peoples videos at the end..so they stay on my page.

  • mo

    don’t work on piczo

  • ioftigr

    Any way to make this validate? I am currently using swfobject to make it validate so it would be nice to continue to do so.

  • http://www.grupobastet.com.br Thiago

    THANK YOU, GUY!!!!!!!!!!!!!!

  • Su

    Thanks A LOT :D

  • Some guy

    It doesn’t work

  • jenn

    It doesn’t work.. i’ve tried it a dozen times..
    And I’m getting sooo pissed off. srsly.

    • Gas Snake

      I think the trick is the URL format. The default url of a youtube video is http://www.youtube.com/watch?v=xxxxxxx. The loop=1 doesn’t work with this format. You have to change the url to http://www.youtube.com/v/xxxxxx and put &loop=1 in the end. Only in this way the trick will work.

      • james

        not sure what you mean by youtube.com/v/xxxxx ?

  • Satisfied

    its wor king this is what i make

  • Cookie Monster

    Thanks! This helps me out a lot.

  • http://twitter.com/GreysonZone greysonfan

    Had a video that I needed to have run automatically on my Greyson Chance fansite and I found your blog post! Thanks so much. It worked like a charm!

  • Maxwell

    is it possible to loop an embedded video from a specific time?

  • Guest

    Hallo how to put on auto suptitles? &cc_load_policy=1 is not working

  • Jodemeil

    How could I loop only a moment of a clip, for example 3:00 to 3:15? Possible?

  • NIM DORNES

    Autoplay working. Loop may need a bit more trial and error. How do I extend auto loop to go through library of footage on the same subject?

  • NIM DORNES

    How do I merge 2 embedded codes of seperate youtube footage together to play and loop as 1 piece constantly in autoplay?

  • shrenuj

    UPDATE:
    loop does not work…..they made some changes…even vidoes on this page are not being looped

  • NIM DORNES

    DOES NOT WORK.

  • NIM DORNES

    AUTOPLAY PROMPT WORKS, BUT LOOP PROMPT DOES NOT. ANY UPDATE ON THIS?

  • NIM DORNES

    If new loop prompt is found can someone “let us in on the loop”….haw haw haw. Nah serious let manz know. Major nutsack ache. Peace.

  • steve

    Hello

    I want to loop, autoplay and autohide so you just get the video and no player visible.

    &loop=1&autoplay=1&autohide=1 as code.

    But this does not seem to work using version 3 (or AS3) of youtube player code. the above code does
    work on other players such as version 2, but other players don’t have the ‘full screen’ button, which I need
    as well as loop, autoplay and autohide.

    Looks like i’ve hit a wall, because every where I try to find the answer no one knows how to get this working in version 3, plus your loops don’t work.

    Thanks for your answers.

    Steve

    • hadar

      i’m having the same problem!
      all i want is to put a video in my website that is playing constantly – autoplay and loop and nothing seemed to work..
      BTW does it only work with youtube videos? what about other website that are playing videos (works like youtube.)>

  • Gerry

    You could put what I know in a thimble, but I did embed a YouTube on my site that I wanted to autoplay, loop & to remove the related videos at the end. &autoplay=1 and &rel=0 both worked but the &loop=1 had no effect. It wouldn’t loop. Then I changed ver3 to ver2 player and that did it. It worked beautifully.

    • NIM DORNES

      >How do you change ver3 to ver2 player? Is it by embeded code manipulation or what?

  • marcus

    it does work but i tell you this is hard to find ;) If you set &loop=1 you must also set &playlist=VIDEOID straight after then it will FINALLY loop if you set the vVIDEOID to the same video you have loaded. huzzah!

  • ds

    I can confirm that rolling back to the older player version allows loop to function properly.

    So your link will look like this:

    http://youtube.com/v/xxxxxxxxx?version=2&loop=1

    Of course you will replace the the x’s with the id of your video.

  • papachu

    “I can confirm that rolling back to the older player version allows loop to function properly.

    So your link will look like this:

    http://youtube.com/v/xxxxxxxxx?version=2&loop=1

    Of course you will replace the the x’s with the id of your video.”

    -Thank you very much! tried everything! nothing worked except yours! thanks!

  • Loofy Loo

    Sorry it just doesn’t work for me :-(

  • Mike.T

    this is how the embedded code looks:

    replace the the x’s with the id of your video.”

    works perfectly guy’s Thanks!

  • SteveParkinson

    Thanks