Advanced YouTube Tips – Custom Embedding
Posted by Steven Shattuck on

Join the conversation


In the last of our series of advanced YouTube tips, we’re going to outline how to customize your embed code to beautify your player, add or remove functionality, and optimize overall viewer experience.

After your favorite video company has edited your video, it’s time to put it on your website or blog. When you hit the “Embed” button right below your video on YouTube, you’re given a few default options:

HTTPS is the secure counterpart to HTTP. This is typically used to provide enhanced privacy and security for services like web browsing, e-mail and instant messaging. You can check it if you want, but it may prohibit some users from seeing the video.

Enabling privacy-enhanced mode will prevent YouTube from placing a cookie on the viewers’ browser history.

If you check “Play in HD” your viewer’s load time may increase slightly.

By default, “use old embed code” will be checked. The following custom codes will only work with the old embed code. Check out this blog from Michael for more info about the new embed code.

Custom Embedding

A typical embed code will look like this:

<object width=”640″ height=”390″><param name=”movie” value=””></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=””application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”640″ height=”390″></embed></object>

This code gives the following result:


There are a number of additional codes that you can put at the end of the url within the embed code (look for the “&”):

Turn off Title & Ratings – &showinfo=0

Turn on Related Videos – &rel=1

Turn on AutoPlay – &autoplay=1 (don’t unless you have a silent video that appears above the fold)

Loop Playback – &loop=1

Remove Full Screen Option – &fs=0

You can also change the dimensions manually by simply inputting whatever values you would like. Keep in mind you will have to do it twice, as the dimensions appear twice in the embed code. The videos in this post display at 640×390. No matter what values you input, YouTube will always maintain your aspect ratio – you will have black bars at the tops or sides if you do not input a scalable dimension that matches either 4:3 or 16:9. Note: if you’re shooting with a Flip, your native footage will always be 16:9.

Let’s put these codes into action. My favorite, in particular, is to turn off the Title and Ratings, since it covers up some of the video content. Let’s add that line of code to the default embed code from above:

<object width=”640″ height=”390″><param name=”movie” value=”“></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”“application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”640″ height=”390″></embed></object>

Compare this to the original embedded video – notice how the titles at the top are gone?

Keep in mind you will have to add the code twice, because each embed code contains an instance of the url twice.

Experiment with these codes to get a player that best suits your needs!

Recommended Reading