How to Embed Youtube Videos in HD

Mon, Mar 2, 2009

Web Design

Since most of the videos we publish now are derived from HD video, we wanted the ability to link and embed these videos in true HD format. Applying the embed code provided by Youtube did not accomplish this and the quality is still very poor, but the solution is very simple. Simply remove the original video format – in this case “&fs=1″ and append the video URL in the embed code with the following code: &ap=%2526fmt%3D22 to achieve 720P true High Definition quality!

For example, here is the original embed code from Youtube:
<object width=”480″ height=”295″><param name=”movie” value=”http://www.youtube.com/v/lZrzF_ZM4Wg&hl=en&fs=1“></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/lZrzF_ZM4Wg&hl=en&fs=1” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”480″ height=”295″></embed></object>

Here is the revised code:
<object width=”480″ height=”295″><param name=”movie” value=”http://www.youtube.com/v/lZrzF_ZM4Wg&hl=en&ap=%2526fmt%3D22“></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/lZrzF_ZM4Wg&hl=en&ap=%2526fmt%3D22” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”480″ height=”295″></embed></object>

Oh but keep in mind, the uploaded source videos must be encoded in HD quality resolution in order for this to work.  Also this HD video may be displayed to a maximum picture size of 1280 x 720. So you can modify the width and height values in the embed code to display videos much larger!

Naturally the HD version takes a little longer to load – but it’s so worth it!

Original Youtube HD embed video:

Modified 720P HD Youtube Video:

Share this now:
  • Facebook
  • TwitThis
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • Digg
  • StumbleUpon
  • Sphinn
  • Spurl
  • Furl
  • email
,

1 Comments For This Post

  1. Andrew Mc Says:

    Wow. I sync’d these up to play at the same time. It’s amazing the difference in quality. It’s noticable the whole time, but it becomes hugly apperent when there is text on the screen. Nice job.

Leave a Reply