Skip to content

XHTML Valid YouTube Embedding

If you have ever tried to embed a YouTube video and then tried to validate the HTML of your page, you know that youtube will break your validation.  I recently discovered the solution.  Apparently YouTube videos are also supposed to be viewed 320×267, I think I actually like the smaller size.  I bolded the important parts.

Original:

<object width=”425” height=”344“><param name=”movie” value=”http://www.youtube.com/v/nrlSkU0TFLs&hl=en“></param><param name=”wmode” value=”transparent”></param><embed src=”http://www.youtube.com/v/nrlSkU0TFLs&hl=en” type=”application/x-shockwave-flash” wmode=”transparent” width=”425″ height=”344″></embed></object>

Valid:

<object type=”application/x-shockwave-flash” data=”http://www.youtube.com/v/nrlSkU0TFLs&” width=”320” height=”267“><param name=”movie” value=”http://www.youtube.com/v/nrlSkU0TFLs&” /><param name=”FlashVars” value=”playerMode=embedded” /><param name=”wmode” value=”transparent” /></object>

Code from this excellent post.

Share and Enjoy
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email

Post a Comment

Your email is never published nor shared. Required fields are marked *