Once again today I have used it, I'll tell me, how you can build XHTML valid Youtube videos.
Since Youtube is still working with an inserted video embed can produce with the standard "embed" code already 7 or more errors in the XHTML validity.
For someone who puts out value (like me), there is almost a disaster :D

Let's look at the development of a standard embed code from youtube to repeat:

  1
 2
 3
 4
 5
 6
  <object width="480" height="295">
 <param name="movie" value="http://www.youtube.com/v/lQ3D4CqHbJM&hl=de&fs=1&color1=0x006699&color2=0x54abd6"> </ param>
 <param name="allowFullScreen" value="true"> </ param>
 <param name="allowscriptaccess" value="always"> </ param>
 <Embed src = "http://www.youtube.com/v/lQ3D4CqHbJM&hl=de&fs=1&color1=0x006699&color2=0x54abd6" type = "application / x-shockwave-flash" allowscriptaccess = "always allowfullscreen =" true "width = "480" height = "295"> </ embed>
 </ Object> 

A lot of stuff, everything not valid according to today's standards.
Videos Here are the important characteristics of again at a glance:

  • In line 1 is both width and height, here 480 × 295
  • In line 2 and 5, we find the VideoID (youtube.com / v / [VideoID]), in this case lQ3D4CqHbJM
  • Behind the VideoID nor are other parameters for color, borders, and son stuff, in the example &hl=de&fs=1&color1=0x006699&color2=0x54abd6

Let us now with the XHTML Transitional valid code:

  1
 2
 3
  <object type="application/x-shockwave-flash" width="425" height="261" data="http://www.youtube.com/v/lQ3D4CqHbJM">
 <param name="movie" value="http://www.youtube.com/v/lQ3D4CqHbJM&hl=de&fs=1&color1=0x006699&color2=0x54abd6&fmt=18" />
 </ Object> 

What has changed?:

  • Width and height are different, is the only way to fit in my blog. They continue to be printed with height and width ="***" ="***".
  • The VideoID lQ3D4CqHbJM is now in data = "*" in line 1 and line 2
  • The parameters are in line behind the two VideoID and the "&" is "amp;" become stuck.

How do you build a Youtube video now so hurry valid one?
1st You copied the standard embed code from the Youtube VideoID and the parameters out, thus: lQ3D4CqHbJM&hl=de&fs=1&color1=0x006699&color2=0x54abd6
2nd Take you the valid code from me and replaced my VideoID and parameters with yours.
3rd Looking at this code after all the "&" and adds more "amp;" back on, until no "&" remain.
Done!

So, by that I post trade course, many errors in the code, but that's the price of education ;)