Monday, October 18, 2010

Joomla Snippet - Strict valid You Tube movies in your articles


If you want to put movies in your articles on a site with a strict doctype you will run into problems with the embed tag that is used by the default code YouTube gives you for example. Embed is actually not XHTML strict valid and this is because embed has been deprecated from XHTML 1.0.

<object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/M15hurmvnhI&hl=en&fs=1"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/M15hurmvnhI&hl=en&fs=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350">
</embed>
</object>
You can solve that by making a little change to the code:
<object width="425" height="344" data="http://www.youtube.com/v/M15hurmvnhI&hl=en&fs=1">
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="movie" value="http://www.youtube.com/v/M15hurmvnhI&hl=en&fs=1" />
</object>

No comments:

Post a Comment