todd’s thoughts on the higher ed web world Rotating Header Image

No embed tag for now

Now that we have started to put a few more videos up at You Tube we have also embedded some of them directly into our pages. I took the embed code sample provided by You Tube and pasted it into the page.

<object width="480" height="295">
<param name="movie" value="http://www.youtube.com/v/wmkkVhBxLsc&hl=en&fs=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/wmkkVhBxLsc&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed>
</object>

Now is where my problem comes up. We are making an effort to produce pages that are all W3c compliant and we are using XHTML 1.0 Transitional and the embed tag doesn’t validate. According to the HTML 4.01 elements page, there is no embed tag. But the specs for HTML 5 have the embed element. So once HTML 5 gets here life will be easier.

In the meantime there is a way to validate using the HTML 4.01 tags.

<object width="480" height="295" 
type="application/x-shockwave-flash"
data="http://www.youtube.com/v/wmkkVhBxLsc&amp;hl=en&amp;fs=1>
<param name="movie" value="http://www.youtube.com/v/wmkkVhBxLsc&amp;hl=en&amp;fs=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
</object>

Take the type attribute from the embed tag and move it to the object tag. Then take the src attribute from the embed tag and move it to the object tag but change the name of the attribute to data. Also make sure all the ampersands (&) are encoded (&amp;) even in the URL.

Once HTML5 comes along this code will still be valid since the object tag is staying around.

todd

Leave a Reply