As you increase your web presence, you may want to embed your YouTube videos on external pages. Perhaps you'd like to include your latest video in your new blog post or even include it on your MySpace profile. That's great, and I encourage it. Embedding your video on an external page (a page outside YouTube) gives visitors to other websites the chance to watch your video without leaving that site. However, viewers of embedded videos won't be able to rate or comment on that video, and they won't be able to subscribe from the external site, something to consider before embedding.
Embedding is fairly straightforward. YouTube provides a string of code next to each video that you can copy and paste into your blog or MySpace profile. Once it's pasted there, your video appears like magic. By default, the video appears in a YouTube player with a large Play button in the middle of the screen. For some instances, though, you may want your video to play automatically without requiring your viewers to click that Play button.
Here's how to hack the embedding code to autoplay (automatically start) your video:
Start with the default embed code, provided by YouTube:
<object width="425" height="344"><param name="movie" value="www.youtube.com/ v/717oxEOfERQ&hl=en"></param><embed src="www.youtube.com/v/717oxEOfERQ&hl=en" type="application/x-shockwave-flash" width="425" height="344"></embed></object>
Find the video URL; it will appear in the string of code twice and will look something like this:
www.youtube.com/v/717oxEOfERQ&hl=en
Add &autoplay=1 to the end of the video URL like this:
www.youtube.com/v/717oxEOfERQ&hl=en&autoplay=1
When you're done adding &autoplay=1 to the end of the video URL both times it appears in the embed code, you're finished. Your final embed code should look like:
<object width="425" height="344"><param name="movie" value="www.youtube. com/v/717oxEOfERQ&hl=en&autoplay=1"></param><embed src="www.youtube.com/ v/717oxEOfERQ&hl=en&autoplay=1" type="application/x-shockwave-flash" width="425" height="344"></embed></object>
Now your video will automatically start each time the web page it is embedded in loads. Autoplaying is a great way to save your visitors the hassle of clicking the Play button. Just be careful to not embed more than one autoplaying video on any single page. As a viewer, nothing is more irritating than trying to pause multiple players that have all started playing different videos at the same time. It can crash people's browsers, which will lose you the viewers you're trying to gain. Not many people have the attention span to try to view a new site over and over. They'll simply go someplace else.
We mentioned the oversaturation of things like autoplaying videos and music and MIDI songs and glitter text on your profiles earlier in the book, but it bears repeating. Be prudent. Be classy. Be minimalist.