Looping YouTube Videos
This is cool: Simply adding &loop=1 to a YouTube <embed> tag makes the video loop forever. Check it out with this short clip of a Pong-playing watch from Make magazine. (Be sure to click the small play button below the video, not the big one in the center.)
Despite just writing an article on hacking embedded videos, I never thought to mess with the YouTube embedding tags, which are right out in the open.
Jake Luddington, on whose excellent blog I first saw this trick, also explains how to make an embedded YouTube video play automatically. Both his techniques involve removing the <object> tag and modifying the <embed> tag. I'm not sure if there's any downside to that besides losing XHTML compliance.
Here's the original tag and the modified looping, autostarting version:
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/Rr7jnYQf_2g"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/Rr7jnYQf_2g" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
<embed src="http://www.youtube.com/v/Rr7jnYQf_2g&loop=1&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
It would be fun to embed a bunch of loops on the same page and have them phase against each other. Leave a link if you come up with something good!
Categories
WebComments (3)
Read More Entries by David Battino.

Youtube changed. &autostart=1 replaced &autoplay=1
Not sure about how to loop using a tag in the URL.
If you figure it out: maximilixn@gmail.com
the &loop=1 doesn't work. it doesn't replay itself. sucks.
Sadly because they changed the ending of the videos, the &loop=1 loop doesn't work anymore.