If you have a video blog or post videos on your blog, you have most likely embedded something off of YouTube. Last year, YouTube bumped up the quality of the videos but when you embed a video on your site, it still references the low quality version instead of the available higher quality video. Now, you need to realize that most of the videos on YouTube are still of the lower quality persuasion but newer videos will always have a higher quality version available.

Tricking the embed code to search out the high def version of each video is pretty simple.

Here are two examples.

Low quality:

High quality:

The difference is one little bit of code that is added to the embed code.

Here is the original embed code:

<object width="560" height="345" data="http://www.youtube.com/v/zrSWBvNXTuM&hl=en&fs=1" type="application/x-shockwave-flash">
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="src" value="http://www.youtube.com/v/zrSWBvNXTuM&hl=en&fs=1" /><param name="allowfullscreen" value="true" />
</object>

And here is the new code:

<object width="560" height="345" data="http://www.youtube.com/v/zrSWBvNXTuM&ap=%2526fmt%3D22&rel=0" type="application/x-shockwave-flash">
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="src" value="http://www.youtube.com/v/zrSWBvNXTuM&ap=%2526fmt%3D22&rel=0" />
<param name="allowfullscreen" value="true" />
</object>

I have replaced the &hl=en&fs=1 with &ap=%2526fmt%3D22&rel=0. You don’t need to add the &rel=0 part. That only removes the related videos that usually appear at the end.

There is one issue with this hack. The D22 of the code searched for the highest quality version, aka 720p HD. If there is no 720p HD version you will get a “This Video has Been Deleted” message. The only option is to change D22 to D18 so that is searches for the middle quality version, aka 480p SD.