YouTube Hack: Automatically Start and Loop Videos

Contributor Icon Contributed by MickeyMouse Date Icon February 15, 2007  
Tag Icon Tagged: Internet

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…

Previous recipe | Next recipe |
 
  • 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.
  • 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.
  • Satisfied
    its wor king this is what i make
    <object width="426" height="320" data="http://www.youtube.com/v/svFY5K6IYJg&autoplay=1&loop=1&hl=en&fs=1&" type="application/x-shockwave-flash"><param name="movie" value="http://www.youtube.com/v/svFY5K6IYJg&autoplay=1&loop=1&hl=en&fs=1&" /><param name="allowscriptaccess" value="never" /><param name="allownetworking" value="internal" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="l" /><param name="wmode" value="transparent"/><!--[if IE]><embed src="http://www.youtube.com/v/svFY5K6IYJg&autoplay=1&loop=1&hl=en&fs=1&" type="application/x-shockwave-flash" width="425" height="350" allowscriptaccess="never" allownetworking="internal" quality="high" scale="noscale" salign="l" wmode="transparent" /><![endif]--></object>
blog comments powered by Disqus