YouTube's embedded videos are not valid HTML5

With HTML5 the embed tag is now recognized as a valid HTML tag. So I ran a simple test by copying and pasting a YouTube's embedded code into a web document, like so:

<div>
 <object width="640" height="385">
 <param name="movie" value="http://www.youtube.com/v/1-EguTJQm3s?fs=1&hl=en_US"></param>
 <param name="allowFullScreen" value="true"></param>
 <param name="allowscriptaccess" value="always"></param>
 <embed src="http://www.youtube.com/v/1-EguTJQm3s?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed>
 </object>
</div>

The W3C Validator says that:

An object element must have a data attribute or a type attribute.

End of games. Since YouTube uses the param element to fetch video's data, this error is really annoying and requires a manual check to make sure that the final code is in the correct form. However, if you add such attributes, you have to run additional tests to check whether your video works in all browsers. Hope they will fix this soon.

This entry was posted in by Gabriele Romanato. Bookmark the permalink.

Leave a Reply

Note: Only a member of this blog may post a comment.