15 Wed

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:

HTML:
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/m_Dxp5HQNIA"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/m_Dxp5HQNIA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350">
</embed>
</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:

HTML:
<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!

Technorati Tags: , , , ,

10 Responses Add your own

  • 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!

    Quote This
  • 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??

    Quote This
  • Sharry Says:

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

    Quote This
  • David Says:

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

    Quote This
  • ckuron Says:

    Very usefull thanks :)

    Quote This
  • 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?

    Quote This
  • Thomas Says:

    Thanks for the XHTML strict youtube plugin. Excellent.

    Quote This
  • Fred Jones Says:

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

    Quote This
  1. Contranexo » Save the XHTML, save the world
    Pingback on 07/12/2006 at 05:49:24

Leave a Reply

Required

Required, Hidden