Friday, April 20, 2007

Validate the Youtube embed code!

I wrote about it here and it is really usefull. As we now the embed code of youtube is a mess as it uses the embed tag which does not validate as xhtml. Using the code this tip you can embed a youtube or google video to your site or blog and keep your code validated:
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/moviecode" width="400" height="326"><param name="movie" value="http://www.youtube.com/v/moviecode" /></object>
The moviecode is a code found in each youtube video adress and is after v= until the first ampersand (&). For example in this URL http://www.youtube.com/watch?v=xmHHjUZPyMY, the code is xmHHjUZPyMY.

4 comments:

Anonymous said...

i still can't embed a youtube video on my vampirerave account T_T

Anonymous said...

thanx for the coding. I tried it. Works great in IE but no Firefox

Anonymous said...

worked great in firefox & ie.. thanks!

peter said...

Fantastic.. working great.. ;)