Friday, December 18, 2009

How to embed youtube video with HQ enabled by default

This might not be a secret to some people already, but I think it is still worth sharing.
When you are on youtube, you can watch videos in high quality and the video stretches to a wide screen mode.

From my point of view, the size of the video and the quality of the video is perfect for audience's viewing pleasure. However, when you try to embed the video into your page (blog), the amount of options provided by youtube really limits you to low quality and square sized video.

After a few Google searches, I found the perfect solution (hack, if you prefer this word)

This is the default embed code:
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/fO4DsOcZHBs&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/fO4DsOcZHBs&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

Let's modify a few things:
<object width="854" height="505"><param name="movie" value="http://www.youtube.com/v/fO4DsOcZHBs&hl=en_US&fs=1&ap=%2526fmt%3D18"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/fO4DsOcZHBs&hl=en_US&fs=1&ap=%2526fmt%3D18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="854" height="505"></embed></object>

You can see the result in my previous post (I'm MT Ep.01)

No comments:

Post a Comment