YouTube With XHTML 1.0 Strict Valid!!

Posted on November 2006 at about 2:14 PM by hwa

For those who broadcast YouTube in their blog before, you should know that the YouTube embed tag is actually not XHTML valid, it’s because the <embed> had been deprecated from XHTML 1.0.

By default the YouTube embed tag should looks something like this:

  1. <object width="425" height="350">
  2. <param name="movie" value="http://www.youtube.com/v/m_Dxp5HQNIA"></param>
  3. <param name="wmode" value="transparent"></param>
  4. <embed src="http://www.youtube.com/v/m_Dxp5HQNIA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350">
  5. </embed>
  6. </object>

But it contain the <embed> HTML tag which is not allow in XHTML 1.0 Strict, so in order to make it pass the validation, i change the above code to something like this:

  1. <object type="application/x-shockwave-flash" width="425" height="350" data="http://www.youtube.com/v/m_Dxp5HQNIA"><param name="movie" value="http://www.youtube.com/v/m_Dxp5HQNIA" /></object>

YouTube plays well with the new tag, and it doesn’t have the <embed> tag, which is XHTML 1.0 Strict valid!

13 Responses to “YouTube With XHTML 1.0 Strict Valid!!”

  1. Julius Says:

    Hey guys,
    I have an iMac G5 running tiger 10.4.7 and I an having a wierd problem. Whenever I go to a site that has an embedded youtube, flash or some kind of video, there is no sound. If it a quicktime file there is no problem. There is not sound no matter what broswer I use, firefox, camino, safari, or shiira. And keep in mind that about a week ago I was not having this issue.

    Help Would be awesome
    Thanks!

  2. hwa Says:

    Julius said:
    Hey guys,
    I have an iMac G5 running tiger 10.4.7 and I an having a wierd problem. Whenever I go to a site that has an embedded youtube, flash or some kind of video, there is no sound. If it a …

    could it be possible that you disable the sound for your YouTube??

  3. Sharry Says:

    Thank you! 🙂 I have a XHTML project in in a few days, just what I needed. Thanks.

  4. Mike Toillion Says:

    Thanks for your post about how to embed youTube content with valid XHTML 1.0 Transitional. It really helped me out!

    Check out my site at http://www.jettisonhigh.com/projects/beatbox360/beatbox360.html and click on “video” on the left.

    Thanks again!

  5. David Says:

    Thanks for this, I’ll be using this for my new site when embedding videos!

  6. ckuron Says:

    Very usefull thanks 🙂

  7. Dave Joyce Says:

    This works great except the original youtube code had wmode=”transparent”. When I use this code I have a white background rather than a transparent one. Is there a workaround to this?

  8. Thomas Says:

    Thanks for the XHTML strict youtube plugin. Excellent.

  9. Fred Jones Says:

    The code works well! my site validates as xhtml strict with the suggestion above.

  10. Tomas Says:

    Wonderfull… was just looking for this 🙂

  11. Jeff Says:

    Nice! Thanks for the tip… is there any way to make sure that WordPress 2.9 always returns valid youtube code. WordPress 2.9 now supports automatic video embedding by url, but it would be nice if it spits out proper xhtml instead. Any suggestions?

  1. Contranexo » Save the XHTML, save the world 07 Dec 2006
  2. SEO Rapper | Webdesign Amersfoort 25 Jan 2010

Leave a Reply

You must be logged in to post a comment.