0

Posted: October 19th, 2009    By: Devin Walker   

Youtube Drink IconAs a web designer, I like to have my site validated by the W3C Validator and display the banner on each one of my site’s pages. I embed videos from YouTube on this blog, therefore I must do it in a way that is valid. This tutorial is the code I use to embed Youtube videos, Google Videos, etc. with W3C valid markup. This is just a personal preference, many of the top sites out there are not W3C valid (google, youtube, ebay).  This is most likely because the validator tends to be behind the curve and does not recognize newer markup. 

<object width="[INSERT WIDTH VALUE]" height="[INSERT HEIGHT VALUE]" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="FlashVars" value="playerMode=embedded" /><param name="src" value="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" /><embed type="application/x-shockwave-flash" width="[INSERT WIDTH VALUE" height="[INSERT HEIGHT VALUE]" src="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" flashvars="playerMode=embedded"></embed></object>

I got this code from several other blogs out there:

Sample the Web’s Article

Bernzilla.com’s Article

Let me know what you think! Thanks.

Leave a Reply