
Embedding + YouTube = not validated
For those of you worried about page validation, then the following information may already be known to you. However, for those of you who are just getting into the realm of taking the time to validate your website via the w3c validation service, then you may want to pay attention.
Currently, the method of insertion for YouTube videos is set up in such a way that, if used, your website will not validate correctly.
The current method:
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/ATXV3DzKv68"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/ATXV3DzKv68" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
What is wrong with this, you may ask? The use of the embed command was never a standardized piece of code. Every web browser, when given a piece of code unique in some aspect, will display that code differently. The reasoning behind standard code is so that no matter browser you are using, your website will look 99-100% the same, no matter.
The embed code comes from the days of Netscape and the ability to embed things like Shockwave, the predecessor to Flash.
The code that you will want to use is much simpler, and doesn’t involve so much to make it work.
<object type="application/x-shockwave-flash" data="http://www.example.com/example.swf" width="425" height="350"><param name="movie" value="http://www.example.com/example.swf" /></object>
An explanation of the code itself can be found at Alistapart.com/articles/flashsatay.
Speaking of flash, a useful thing to keep in mind is that when embedding, try not make the dimensions larger than they need to be. A 200×200 .swf doesn’t need to be resized to 600×600. Also when sizing, the smaller the dimensions, the faster it will run as it increases the fr.