YouTube With XHTML 1.0 Strict Valid!!
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:
- <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:
- <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!
November 24th, 2006 at 5:25 AM
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!
November 24th, 2006 at 6:57 PM
could it be possible that you disable the sound for your YouTube??
January 8th, 2007 at 9:54 AM
Thank you! 🙂 I have a XHTML project in in a few days, just what I needed. Thanks.
June 5th, 2007 at 1:45 AM
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!
June 5th, 2007 at 11:21 PM
Thanks for this, I’ll be using this for my new site when embedding videos!
December 3rd, 2007 at 4:48 AM
Very usefull thanks 🙂
March 30th, 2008 at 12:12 AM
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?
May 7th, 2008 at 2:41 AM
Thanks for the XHTML strict youtube plugin. Excellent.
October 29th, 2008 at 8:17 AM
The code works well! my site validates as xhtml strict with the suggestion above.
February 17th, 2009 at 1:09 AM
Wonderfull… was just looking for this 🙂
December 20th, 2009 at 8:34 PM
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?