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:

 <object width="640" height="385">
 <param name="movie" value=""></param>
 <param name="allowFullScreen" value="true"></param>
 <param name="allowscriptaccess" value="always"></param>
 <embed src="" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed>

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.