Embedding YouTube Videos as Valid XHTML 1.0

Album Cover: The Future

"Love's the only engine of survival."
Leonard Cohen / The Future

Posted on May 29, 2006 4:32 PM in Web Development
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

If you've ever validated an otherwise XHTML 1.0 compliant website that embedded a video from YouTube, you've probably seen validation errors related to YouTube's use of the <embed> tag, which has been deprecated in XHTML 1.0.

If you're looking to embed a YouTube video in your website's code and want to retain your validity, instead of using their suggested format:

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U"></param><embed src="http://www.youtube.com/v/7_6B6vwE83U" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

Use the following format:

<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/7_6B6vwE83U"><param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U" /></object>

You'll notice that the new format leaves out the <embed> tag and still functions correctly when embedded in your web page.

Props to the K2 Community Forums for pointing me to the Spanish explanation of this technique.

Comments

minghong on May 30, 2006 at 11:54 PM:

height and width attributes are prefectly fine in the object element, even for XHTML 1.1, see http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_objectmodule

So one should instead write the following:

<object type="application/x-shockwave-flash" width="425" height="350" data="http://www.youtube.com/v/7_6B6vwE83U"><param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U" /></object>

Permalink

Will Pritchard on August 24, 2006 at 3:55 PM:

Thanks for the tip mate. Saved me at least 30 minutes worth of pouring through the W3 specs looking for the correct codebase.

Also -

So one should instead write the following . . .

Either way is correct by the way. It is a matter of using CSS to define the paramater versus attributes within the object tag.

Permalink

TOFUmonkey on October 11, 2006 at 9:50 PM:

hey thanks for the help!

I was pouring over the different sources trying to look for plugins and codes and files.

Didn't know by using another code, it solves the problem!
woo hoo! i'm so happy! :)

My first youtube video at www.RisingIMStar.com

Thanks alot! :)

Permalink

alex sin on October 12, 2006 at 9:40 AM:

Hi Bernie

Thanks for the code. Really appreciate your effort.

Well, you heard of the latest Google deal right?

Here it is www.alexsintq.com

Cheers
Alex

Permalink

Mike Hunt on November 25, 2006 at 9:00 AM:

Will, TOFU: I think you'll find it's "poring" although if either of you has noticed sparks and smoke coming from your monitor, and it also seems to have stopped working, then perhaps "pouring" was the correct term after all ...

Mike

Permalink

Fred Campbell on December 27, 2006 at 3:01 AM:

Thanks that's brilliant. Been looking at all sorts of mind bending solutions with reams of code. This is short, simple and sweet.

Permalink

Felipe on January 01, 2007 at 11:33 AM:

Thanks a lot! i was just looking for this and it works perfectly!

Permalink

Baggas on January 23, 2007 at 5:13 AM:

Thanks for the tip mate. Was struggling to work out why the YouTube standard code wasn't working in my Wordpress blog. This solved the problem right away.
Cheers :)

Permalink

anakin on January 26, 2007 at 3:09 AM:

// i'm from Turkey, sorry for my english :(

I use this code for valid xhtml coding for a long time...
---------------------------------------------------------
<object
type="application/x-shockwave-flash"
data="../images/yazi.swf"
width="383" height="39" title="www.huseyindeniz.net">

<param name="movie" value="../images/yazi.swf" />
<param name="quality" value="high" />
<param name="Menu" value="0" />
<param name="WMode" value="Transparent" />
<param name="swliveconnect" value="true" />
</object>
---------------------------------------------------------
it works on all browsers but a new problem occured.
If a preloader exists in flash, that preloader does'nt work on IE7

in my website (www.huseyindeniz.net) there is no preloader and it works
but in www.yazkardesim.com a preolader exists in flash and do not work on IE7. so i use embed tag and it works on ie7. i think there is a problem between ie7, object tag and flash preloading functions. Is there any solution for this problem.
Thanks
---------------------------------------------------------
// Sorry for my english again, i hope you understand my problem :)

Permalink

nogg3r5 on January 28, 2007 at 6:42 AM:

Thanks for this. Awesome-ly helpful.

YouTube videos have been the thorn in my valid side for a while now!

Permalink

Sigurd on January 28, 2007 at 1:51 PM:

This code works fine, but there is a white edge around the player. I solved that using this code:

<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/ulakMBcqyPo"><param name="movie" value="http://www.youtube.com/v/ulakMBcqyPo" /><param name="wmode" value="transparent"></param></object>

All I did was to add <param name="wmode" value="transparent"> to the code.

Permalink

Sigurd on January 28, 2007 at 1:56 PM:

Ops... Here is the code

Permalink

Jason Fisch on February 10, 2007 at 12:15 PM:

Thanks a million, worked without a problem!

Permalink

GamingG on February 11, 2007 at 10:39 AM:

Internet Explorer has always had problems with supporting the standards correctly.

Permalink

cribber on February 14, 2007 at 10:00 AM:

i cant thank you enough..my whole blog was based on you tube and IE was such a mess with embed code..

Permalink

Matt on February 20, 2007 at 7:00 PM:

Thanks so much! I was scratching my head trying to find a valid tag for adding a gameplay video for my game off of youtube.

Permalink

sat on February 28, 2007 at 3:22 AM:

Saved a lot of time...just got here via first page of google....great cool trick.....thanx for it.

Permalink

ApplesH on March 07, 2007 at 6:06 AM:

Hey... Im so glad I found your site as I have been having problems with the different plugins Ive used to display youtube videos. Yours is the best method by far. Thanks!

Permalink

grog_sit_reserve on May 29, 2007 at 5:00 PM:

Thanks for this. It saved me a lot of time and is so much cleaner.

Permalink

Chty on June 11, 2007 at 10:48 AM:

thanks for this post, it's very useful.

Permalink

Onur Buyukceran on June 18, 2007 at 4:59 PM:

Thank you for the tip, I wonder why YouTube gives us W3 invalid codes?

Permalink

Edgar Franco on June 27, 2007 at 2:26 PM:

Thanks for this tip. Now Youtube videos show good using IE 7. My web site is in spanish. Gracias

Permalink

TW on July 16, 2007 at 5:50 AM:

Is there a way to add code that will replace the still image that YouTube provides? Their still is a video grab and is low-res. I'd like to modify the code to make it find a JPG on my website, but then play the video from YouTube.

Thanks.

Permalink

Jaffer Maniar on August 07, 2007 at 6:38 PM:

This is my very first time on this blog, I found you by googling "embedding youtube".

I want to exclaim that this is the most beautiful blog (by design) I have ever seen !

Permalink

Thomas on August 10, 2007 at 9:08 AM:

Hey thanks for the code guys, however -

It works great in Firefox but doesn't in IE 7...

Here is my code...What am I doing wrong???

<object type="application/x-shockwave-flash" style="width:160px; height:132px;" data="http://www.youtube.com/v/g_bK1IHTr5E"><param name="movie" value="http://www.youtube.com/v/g_bK1IHTr5E" /><param name="wmode" value="transparent"></param></object>

Permalink

Thomas on August 10, 2007 at 9:31 AM:

For those who were having an IE issue like I was, I figured out the perfect code that works in both IE and Firefox and is XHTML compliant:

<object type="application/x-shockwave-flash" width="400" height="329" data="http://www.youtube.com/v/g_bK1IHTr5E"><param name="movie" value="http://www.youtube.com/v/g_bK1IHTr5E" /><param name="wmode" value="transparent" /></object>

Permalink

Thomas on August 16, 2007 at 3:15 PM:

By the way, my previous post addressed the issue of changing the width and height of a YouTube embedded video (aside from its default, 425x300 width and height) - apparently, when using the code given by this site, for some reason functionality is lost when a video is resized using this site's code.

The code in my previous post can be used for videos that are resized - maintaining its XHTML compliance and function in IE and Firefox.

Permalink

James Forsyth on August 28, 2007 at 3:04 AM:

Hi,

This is great! I use it every time.

James

Permalink

herr_ernst on August 30, 2007 at 5:25 AM:

thanks very much!

Permalink

John Shaw on September 19, 2007 at 5:34 PM:

It's good but there's a white border around the edge. Is there anyway to fix that?

Permalink

Bernie Zimmermann on September 20, 2007 at 12:01 AM:

John, scroll up to Sigurd's comments and you should see how to get rid of the white border using the optional wmode parameter.

Permalink

Robin on September 25, 2007 at 12:21 AM:

I'm finding this embedded code. I have got validation errors when i first embed it. But after tried your embedded code, it's work now. Thanks for your info!

Permalink

Chris M on September 28, 2007 at 10:18 AM:

Helped me alot with w3c standards!

Permalink

Laer Carroll on September 28, 2007 at 1:47 PM:

I want my YouTube video to automatically start playing rather than waiting for the watcher to click on the arrow button. The old way let me do that with an autoplay parameter, as shown below. How can I do what I want with the new scheme?

<embed src="http://www.youtube.com/v/S-mkR-KoPts&NR&
autoplay=1" type="app (and so on).

Laer

Permalink

Laer Carroll on September 28, 2007 at 1:53 PM:

I hit the Post Comments button only once, but I got THREE darned posts!

Permalink

Laer Carroll on September 29, 2007 at 5:45 AM:

I accidentally found the answer. Change the following
data="http://www.youtube.com/v/VIDEOID"
to
data="http://www.youtube.com/v/VIDEOID&autoplay=1"

And thanks much Bernie. Oh, and I love the color scheme. Very easy on the eyes, and attractive.

Permalink

Bernie Zimmermann on September 29, 2007 at 8:28 AM:

Thanks for posting your findings, Laer, and thanks for the compliments.

Permalink

Cropeck on October 02, 2007 at 6:45 PM:

The thing is it is not work with YouTube customized player...

Permalink

TheSmarty.com on October 07, 2007 at 3:57 PM:

Yes, this is one of the best features of youtube. I love it

Permalink

Make money log on October 09, 2007 at 12:05 PM:

I have done your embed code to my site, it's work well. Thanks for sharing this tip!

Permalink

slime.bot on October 14, 2007 at 11:16 AM:

Lets sum:

- got rid of
- got rid of white background with transparent
- got video on autaplay

problm: IE doesnt autoplay but shows no border
FF autaplays but shows white border (on non-white background)

:) help!

Permalink

TheSmarty.com on October 16, 2007 at 1:43 PM:

Hmm, sometimes it says... "the member that submitted this video has disabled embedding" or something like that.

I hate it when that happens. Any ways to avoid that?

Permalink

Bernie Zimmermann on October 17, 2007 at 7:19 PM:

The only way to avoid the "embedding disabled" issue, as far as I know, anyway, is to contact the person who originally submitted the video and ask them to enable embedding.

Permalink

Christoph Dollis on October 27, 2007 at 8:28 AM:

You solved my problem as well. Thanks.

By the way, I love this web and form design.

Permalink

Fenix Torch on October 31, 2007 at 4:43 PM:

Thank you so much.

It baffles me why sites such as youtube don't give code that will validate. My shopping cart provider does the same thing even though it would be very simple for them to fix.

My working example can be seen here:

http://www.fenixtorch.co.uk/led_torches/lockblock.html

Permalink

Inge on November 04, 2007 at 6:32 AM:

Thanks for the code!

Permalink

Andrew Faulds on November 04, 2007 at 1:01 PM:

Great! Thanks! It's not validness that is good, it's also a clue to my puzzle of finding the youtube video swf address!

Permalink

Ravan on November 10, 2007 at 1:40 PM:

finally xhtml compliance on every page!!!

thank you VERY much Bernie :)

Permalink

Ravan on November 10, 2007 at 2:59 PM:

oh, and just to share what i found to be working too:

you can even use FlashVars as a parameter like
<param name="FlashVars" value="the=variables,you=want,to=pass,to=flash" />

:)

Permalink

jhay on November 13, 2007 at 9:01 AM:

hi

a.

at work and in some other places, youtube website is blocked, on my website I want to put videos from my youtube account, how can i convert it to a video that everyone can access eventhough the codes are from my youtube account? not unless, I have the original mp4 video with me, how can i get the embedded codes on that one, is there a way to do that?

b. if i have a mp3 songs and want to put it in my website, how do I get the embedded codes? because i want to put music on my website.

c. what about the slideshows for my pictures? how can i get the embedded codes on this one as well

Permalink

WindBlower on December 04, 2007 at 6:28 AM:

Thank you for sharing this, it is a GreaT Help!

Permalink

kevin on December 19, 2007 at 2:38 AM:

Thanks, but what if i want to add some other options like play=true or menu=true?
This wont work..
Any ideas?
Kevin

Permalink

Mateo on December 20, 2007 at 2:00 AM:

hmmm... I was looking for a way, that's cool to validate w3c but you don't have the small preview before playing the video, and that's not really cool...

Permalink

nihal on January 06, 2008 at 12:45 AM:

i embed your code, its working fine, thanks allot for sharing this Tips.

Permalink

Dan Sing Underfoot on January 07, 2008 at 1:06 PM:

Thanks! I had the validation figured out but couldin't get my z-index to work properly!

Permalink

ravi on January 09, 2008 at 3:13 PM:

is there anyway to remove those youtube logos from the videos while playing on my site?

Permalink

David on January 11, 2008 at 11:27 AM:

Thanks, it helped me deliver a XHTML valid 3D model design site here: http://www.3dmodeldesign.co.uk

Permalink

Sistereinstein on January 17, 2008 at 6:39 AM:

Good Morning,
Trying to get this object to embed correctly in DW4 and it recognizes the Activex Control but still appears as a Greg Box on the page, and online it is a white BOX. Very frustrating.

Any ideas on how I can embed this to show correctly? I am able to get it to work on the blogsite http://www.donniepick.blogspot.com but not in the website.

Permalink

thedral on February 01, 2008 at 8:07 AM:

help

Permalink

TechAdvance on February 03, 2008 at 1:05 PM:

Fantastic......... Thankyou very much!!! My Youtube videos wouldnt show in IE7 and this solved the problem 100% and i found this site in seconds ......

Permalink

andrezero on February 09, 2008 at 3:47 PM:

Hi. Found your site by chance when looking for a valid xhtml way to embed google videos. I posted a link to your post as the good solution(s) within with a post about "zero errors policy" on validation over at my blog.

Permalink

George Felix on February 10, 2008 at 12:37 PM:

I need to have a YouTube player that will search YouTube and will find automatically the last 20 videos that have been uploaded with a spesific key word. The player must be able to be embeded into ASP pages and PHP pages. it must look like the regular YouTube player

Permalink

Matt on February 16, 2008 at 8:20 PM:

Unfortunately, it doesn't appear this method works with IE6.

Permalink

BEAUTIFUL SONG on February 28, 2008 at 3:05 PM:
Judy on March 08, 2008 at 1:02 AM:

This post was of great help! I was really starting to stress out at one point with the YouTube code breaking my CSS.

Thanks, Bernie!

Permalink

Wiper on March 13, 2008 at 8:01 AM:

Thanks Bernie for the code.

Permalink

steve on March 16, 2008 at 6:44 PM:

Bernie, thanks for the blog post.

Thomas, thanks for the code. It worked best for me, in getting both ff and i.e. working.

Permalink

BlueBerry Pick'n on March 17, 2008 at 2:18 PM:

I wish I could figure out how to encourage Serendipity to accept the code rather than formatting it as text...


~~~
Spread Love...

BlueBerry Pick'n
can be found @
ThisCanadian
~~~
"We, two, form a Multitude" ~ Ovid.
~~~
"Silent Freedom is Freedom Silenced"

Permalink

metoto on March 18, 2008 at 8:52 AM:

Hi,

I would really like to know why the code for an youTUBE embedded does not work on eBay auction sites is there more or less needed?

Permalink

metoto on March 18, 2008 at 8:56 AM:

WOOPS!!
ok , yep it works here but not for yahoo email or some html sites either. Please someone could provide the embedded code especially for ebay.


Thanks everyone...

Permalink

Florentina on March 19, 2008 at 7:22 AM:

WOW, thanks a lot! If I'd have found this sooner I woudn't have wasted 4 hours trying to figure out why it doesn't work.

Permalink

Ruusvuu on March 31, 2008 at 10:38 PM:

website's in production. This was a most valuable resource as I am developing the site to be completely standards compliant.

Cheers! ;-)

Permalink

Martin Nielsen on April 29, 2008 at 12:04 AM:

Incredibly this post is still highly relevant 2 years later. My solution to the problem, a php preg_replace that changes the code automatically so I can still be lazy and copy the code directly from youtube. Thanks for the post

Permalink

Richard Ogima on May 11, 2008 at 1:53 PM:

Hey guys, thanks for all the help with all the codes and all. It's a pretty resourceful page. I am trying to embed code into my Facebook account. If only I could create a automatic loading video that plays when users visit my site....then again, why would uses want stuff starting up without their consent or activation....but, maybe that's what they get as the result of visiting mysite, however, I don't own Facebook, dammit.

Permalink

Mahmood Ali on May 14, 2008 at 6:09 AM:

Can you get title, descrition and other details by using vedio_id of youtube.
I have vedio_id and using php 4.3 version. Please tell me, can we get the other details using vedio_id.

Permalink

Hip-Hop on May 24, 2008 at 4:08 PM:

Great Share!!!!!!!!!!!!!!!!!!!!!!!!!!

Permalink

Brendan on May 25, 2008 at 5:02 PM:

Thanks for the tip! Still works fine!

Permalink

Lenser on June 09, 2008 at 10:31 AM:

Great information! I could kiss you.

This had been preventing me from adding videos to my sites for some time.

Permalink

arijeet bannerjee on July 16, 2008 at 12:39 AM:

This piece of code was very helpful. it is working fine. saved a lot of time.

thanks buddy!!!! keep up the good work...
:)

Permalink

Betsy on July 17, 2008 at 8:52 PM:

Thanks, Bernie, for the fast and easy tip...perfect. Beautiful blog as well. Cheers to you.

Permalink

freeball on August 05, 2008 at 11:42 PM:

thanks a lot for the solution! greets from romania

Permalink

Will on August 27, 2008 at 7:00 PM:

Glad to see that after 2 years, this method still works. Thanks a bunch!

Permalink

Jason Hubsch on September 05, 2008 at 3:28 PM:

Once again, a google search for a issue I'm encountering leads me to a Bernie solution. Thanks again!

Permalink

Dan Pickett on September 19, 2008 at 11:34 AM:

Really helpful! Thank you.

Permalink

Tharaka Umayanga on September 20, 2008 at 11:36 PM:

Thank You

Permalink

Nick Pettit on September 26, 2008 at 11:00 PM:

My buddy Jim and I over at Done21.com noticed that a lot of people on the web were having this same problem, so we made a free tool, called Validifier, to help make it a lot easier.

Check it out at http://validifier.com/

Hope this helps someone. :D

Permalink

Bernie Zimmermann on September 27, 2008 at 6:10 AM:

Pretty cool tool, Nick. Thanks for sharing the link.

Permalink

BMJackal on October 27, 2008 at 3:42 PM:

Thanks a lot, really! Your code has saved me from rotting at my computer for several hours! My praises to you ;)

Permalink

Vowels on November 02, 2008 at 2:50 PM:

Works great, even over two years later, but what about allowing fullscreen? With the above code, it doesn't work; when I put this into the object tag -- allowfullscreen="true" -- it's invalid again.

Oh well, more Googling to be done.

Permalink

Bernie Zimmermann on November 03, 2008 at 10:38 AM:

Vowels, remember, the <param> tag is your friend. I bet if you drop the allowfullscreen/true name/value pair in one of those, you'll be golden.

Permalink

Konstantin on November 05, 2008 at 7:05 AM:

By the way, this does not work with "Page Style" equals to "No Style" (this is in terms of Firefox's menus). The original YouTube code works.

Permalink

Stuart Davison on November 25, 2008 at 4:59 AM:

Totally awesome - been looking for this solution for whats seems like a lifetime now. *hat tips* much respect!

Permalink

virtual millenium on November 25, 2008 at 5:42 PM:

The code works fine in Firefox and IE7, the problem is that it doesn't show anything in IE6 and earlier!

so what's the solution for that?

Permalink

markese on December 05, 2008 at 6:06 AM:

grazie mille. la soluzione funziona alla perfezione. grazieeeee

Permalink

FIELD_NICKNAME on December 16, 2008 at 3:57 AM:

FIELD_MESSAGE_elcorolget

Permalink

ccmee on January 15, 2009 at 9:32 PM:

It works fine in IE6 and IE5.5 so whats the problem. Thankyou for solving this problem for me.

Permalink

Davetta on January 20, 2009 at 9:53 AM:

Thank you SO much for this XHTML valid YouTube code!

I was going nuts trying to validate my stepdaughter's site. :)

Permalink

Thinker on January 26, 2009 at 3:44 PM:

I have a micro-blogger that I built and users can embed their own Youtube! videos. I don't want to try to change the tags programatically so that it validates. Are there any versions of HTML/XHTML that allow for Youtube! embed code to validate as it is?

Permalink

Chris Stone on January 28, 2009 at 6:18 PM:

Thanks for the code! Works great! The code was used in a a site that helps musicians get back their stolen music instruments by publicizing instrument thefts to the music community. Rock on!
www.ScreamingStone.com

Permalink

Bernie Zimmermann on January 28, 2009 at 7:27 PM:

Cool site, Chris. Thanks for dropping by.

Permalink

Billy Girlardo on February 09, 2009 at 1:43 PM:

HUGE PROPS!

3 years later and still rockin!

Thx so much!

Gee, am I an excited standardista or what? :-)

Permalink

Serena on February 10, 2009 at 9:25 PM:

What's the right code for IE?

It's not work with IE7 :(

Permalink

jurkis on March 20, 2009 at 3:07 AM:
The AntiVirus on April 06, 2009 at 1:19 AM:

I'm embedding a lot of videos from YouTube into my website and since I'm very concerned about the W3 validity I check every subpage against the compliance with the specs.

The errors generated by YouTube videos was a real pain in the neck. Now, after the mods, all my pages with videos embedded work like a charm!

Thanks for posting this tip, I'll be looking around your website for more useful articles.

Permalink

John Dale on April 06, 2009 at 1:22 AM:

I'm trying to get rid of the validation errors at http://www.sytru.com/norton-antivirus but the YouTube videos still generate errors, even after having modified them according to your suggestions.

Is there a way I can workaround this?

Thanks in advance for any hints.

Permalink

Joe on April 06, 2009 at 2:36 PM:

Nice, extremely handy!

Permalink

Nickie on May 04, 2009 at 11:23 PM:

Thank you so much for providing an alternative code for the YouTube. I couldn't find one anywhere, and YouTube and other embed src were not validating.

Do you by any chance know how to use CSS for video's style, for example height and width? Please let me know, if you know how to.

Thanks again.

Permalink

Random on May 20, 2009 at 6:44 PM:

It would be nice to have a PHP script that changed a Youtube! embed code into valid XHTML.

Permalink

Nino Natividad on May 28, 2009 at 8:29 PM:

Thanks for the tips! :)

Permalink

PHIL THORNTON on June 02, 2009 at 8:42 AM:

wow a 3 yr old thread!!

Thanks for this post - helped alot, 3 years on... who would have thought! lol

Permalink

Salman on June 11, 2009 at 2:03 AM:

You can now use the freely available swfobject library to embed youtube videos in your web applications. The following examples show you how to embed youtube videos in this way and bonus tricks:

http://911-need-code-help.blogspot.com/2009/05/embed-youtube-videos-in-your-web.html

http://911-need-code-help.blogspot.com/2009/05/embed-multiple-youtube-videos-in-your.html

Permalink

zbibo on June 29, 2009 at 3:23 AM:

dear,
this script is very helpful
but is there a way to embed a video without specifying the ID, in a way that everyday to embed the most recent one???
in our website, we need to embed everyday the recent Video from our channel.
so i'am asking if there is a way without each time to enter and change the code manually...

thanks a lot
any suggestion please...

Permalink

Salman on June 30, 2009 at 9:37 PM:

@zbibo, your post looks oddly familiar. Did you look at YouTube custom players:

http://www.youtube.com/my_players

A custom player plays videos from specified YouTube account or playlist. Probably the most recent one is played first which i think is close enough for your needs.

Permalink

Johnny on August 03, 2009 at 3:32 PM:

Unfortunately, this doesn't work at the Last.fm, precisely at the "About Me" box in a user's profile at the Last.fm.
Both the code given at the top of this page and the code produced by Nick Pettit's "validifier" are not functional at the Last.fm. :(
However, a clip from the Youtube can be posted to the Last.fm using this form: [youtube]http://www.youtube.com/watch?v=BHM5jsuoL[/youtube]

I'd appreciate it a lot if someone would provide a code or a form to post a Youtube clip of small dimensions (320 x 265) to the Last.fm, i.e. to the "About Me" box.

Thanks in advance!

Permalink

Venkat on August 14, 2009 at 12:32 AM:

how to check if a video is embeddable on a web page or not?

Permalink

goldfish on September 24, 2009 at 5:02 AM:

Thanks I have been looking all over for this!

Permalink

Don_Pedro on September 28, 2009 at 1:26 PM:

Thanks! My same validator problem settled this way, too.
And various high value key infos collected from the comments, too.

Now 1000 generated pages of proprietery CMS (PERL generated) are zero error for "XHTML strict" - like ibm.com :-)

The most astonishing is:
This is now since 3 years here, and is to find via Google in a direct fast manner.
Of course, many complaints about the problem will have been addressed to youtub.com , in the meantime.
Why did the programmers there, with a multi-million annual budget, never settle this problem?
It is THEIR job, not ours, because THEY are paid for it, not we.

On the other hand, the importance of validation is low... The use of CAPITALS now is error, while it was standard 10 years ago...

When 10 years ago HTML tags / attributes were mainly programming language, they had to by upper case - should have been lower case, THEN.
Now that they mainly have a character of constants (due to crazy CSS conventions), they should NOW be in capitals - but now they have to be in lower case....

"Crazy conventions"? - It is a basic fault to let the user redefine the effect of elements of a supplied language. It is one of the worst possible violation of basic rules of systems using formalized languages...

HTML. XML , CSS, Javascript standards are bureaucratic horror stories, compared with the abstract logical perfection of PERL for scripting, Postscript /Adobe .pdf for style.

And validators tend to multiply one single true standard difference to 10 ... 100 ... or more "errors" or warnings...
Check the major German newspaper Frankfurter Allgemeine,
its site is: faz.net
Is it the Guiness Record Holder of the validation error count?
Over 5 000 errors and 300 warnings....

So faz.net is a good excuse for Web designers
when criticized by customers for the typical average of several 100 error messages of relatively long and complex web pages....

Permalink

Emile on October 29, 2009 at 6:53 PM:

I would like to know if it's possible to use this embed code in combination with an insert of the video idea, this 11 digit code stacked in a mysql dbase. Is it possible and What would it look like?

Permalink

malofey on November 13, 2009 at 12:45 AM:

Hey... Im so glad I found your site as I have been having problems with the different plugins Ive used to display youtube videos. Yours is the best method by far. Thanks!

Permalink

Matthew on November 16, 2009 at 7:35 AM:

Thats very awesome. Thank you so much for providing an alternative code for the YouTube.

Permalink

Lover of Sadness on November 20, 2009 at 8:13 AM:

thank u very much for ur post...
but could anyone help me embed the link of houndbite.com
they always break my html validation....
:(

Permalink

macaulus on December 02, 2009 at 9:46 PM:

happy to find this, saved me a lot of time searching aroudn the place

Permalink

Joseph O'Kelly on December 20, 2009 at 1:41 PM:

This code still works.
Many of my embedded videos in IE had become blank boxes!
I have just prepared a new page useing your code It seems to work in IE FF Chrome and Safari.
http://www.hibla.com/Youtube-movies.htm

Permalink

Kelly on February 10, 2010 at 7:28 PM:

This code worked made it so that everything on my page works correctly, except my Facebook application no longer appears in Explorer.

:(

Permalink

Roger on February 22, 2010 at 1:50 AM:

You have no idea how happy I am to find this page. The Youtube tag in my bbcode parser was the only one left not producing valid XHTML 1.1 and now that's been solved, and in a way that works for IE users too :)

Permalink

Melroy van den Berg on February 23, 2010 at 11:41 AM:

Thx :D Send YT an e-mail -,-

Permalink

Jyri on February 25, 2010 at 8:52 AM:

This is awesome! At work we need to use xhtml-strict that validates properly and flash was a pain in the ***. Now however, I successfully added a flash file to one of our sites :)

Permalink

links of london on March 12, 2010 at 7:15 PM:

wonderful. thnx for ur nice work.

Permalink

Sam Johnson on March 22, 2010 at 2:38 AM:

So very much help. I was killing myself trying to get this valid. Thanks for the code!

Permalink

Alex on April 02, 2010 at 4:29 PM:

To enable the fullscreen button with this XHTML compliant method:

The ALONE is not sufficient - it won't show you the fullscreen button.

You must add ?fs=1 to the Video's URL to make the fullscreen button work.

The available parameters are documented here:

http://code.google.com/apis/youtube/player_parameters.html

Permalink

Tony on April 21, 2010 at 1:25 AM:

Nice web.I have bought a pair of nike blazer shoes from a worldwide Zoom kobe v shopping website. Happy to share it with you sincerly.

Permalink

ultradude25 on April 25, 2010 at 6:38 PM:

Doesn't work in Google Chrome. It loads the whole movie (Even if you don't click on the play button) before loading the rest of the page, instead of streaming.

Permalink

Flv Player on April 27, 2010 at 11:49 PM:

Thank you for the quick tutorial.

Permalink

hosting on May 02, 2010 at 8:07 PM:

It validates! And it's much lighter code. Thanks mate!

Permalink

L Jones on June 11, 2010 at 4:35 PM:

Thank you! Worked great and the comments helped out, too.

Permalink

ahdkaw on July 24, 2010 at 9:59 AM:

Wonderful, thanks for the code, worked a treat on my site, now my blog software finally validates the same as the rest of my site.

@Don_Pedro Whilst I agree with your sentiment, the great thing about HTML and XHTML is that you can choose either or a mix of the two, following strict rules or transitional rules, so it's up to the designer to choose the one they are most proficient in at the time. And as for the uppercase, lowercase changes, there is plenty of software that can do that for you across thousands of HTML documents in seconds, so it's not really a problem.

Permalink

קייטרינג חלבי on August 22, 2010 at 4:44 AM:

I've have embedded a few videos in my website and have found them to be useful when trying to explain wesite concepts to customers.

Permalink

Coolweb on August 26, 2010 at 4:19 AM:

Great, this code is valid @ validator.w3.org :)

Permalink

Peter Rudd on September 05, 2010 at 10:29 AM:

Seems to work OK for me !

Thanks

Permalink

Carl Crawford on October 03, 2010 at 3:31 PM:

Thank you so much for this post. It saved my ass.

Permalink

פסיכומטרי on November 19, 2010 at 6:08 AM:

I'd rather embed them using the xml wordpress plugin, but you are more technically advanced...

Permalink

kit 4 cat on November 25, 2010 at 2:42 PM:

the xml template is not stable enough for these requirements.

Permalink

eyal eldar on December 23, 2010 at 12:09 AM:

I don't understand what is xml templates

Permalink

Hasan Seeder on February 11, 2011 at 3:06 AM:

Thank you very much

Permalink

Kevin on February 27, 2011 at 4:07 PM:

You really save me. I have tried it out and it is now working. Thanks so much for your help.

Permalink

Rita Barberá on March 17, 2011 at 2:14 AM:

very useful tip for my videos

Permalink

Helle Frederiksen on June 06, 2011 at 4:25 AM:

Thanks - very usefull!

Permalink

Marcel on October 08, 2011 at 3:24 AM:

Last time I embedded a player on my website. I made a small one and the quality of the audio was awefull. I changed the size to big and the audio was normal again. How is this possible?

Permalink

Diane on October 08, 2011 at 3:27 AM:

@ Marcel. Yes, I don't know what that is with youtube, it really makes audio sound crappy.

Permalink

euluism on October 13, 2011 at 12:18 PM:

You save my life!

Thanks for sharing this code

Is work for me!

Sorry my bad english!

Permalink

Jamie on October 20, 2011 at 7:40 PM:

Is there a way to modify the new YouTube code to eliminate or shrink the css and js files? Combined they are a whopping 350K!

Permalink

Sago David on October 21, 2011 at 2:24 AM:

Thanks for sharing...

Permalink

Roofers El Monte on November 07, 2011 at 9:53 PM:

Brilliant job! The comprehensive data given was very helpful. I am hoping that you continue the excellent job done.

Permalink

janaka on November 11, 2011 at 2:44 AM:

best site for sri lanka

Permalink

Gabriel on August 22, 2012 at 8:55 PM:

Thank You! Your example helped me out when I was without a clue.
Thanks again...

Permalink

Segue on June 11, 2014 at 9:40 AM:

Keeping old post going... thank you - found a good example and ran it through validator...

Segue to Solar

Permalink

rajat gupta on August 13, 2014 at 11:35 PM:

thanks. i have been using you tube videos embeded in both wordpress n html websites. will check your guide to keep the validity intact.

Permalink

atul choudhary on August 18, 2014 at 7:48 AM:

Thanks for sharing i keep in mind when i embed videos in sites

Permalink

Random Thoughts on September 06, 2014 at 7:51 PM:

Youtube has finally made the embed code valid.

Permalink

bamboosu on September 19, 2014 at 6:10 AM:

It is now the norm to find Ugg boots in the stores and online which feature a wide range of colors including bright reds and greens or pinks,Ugg Baratas Espana and all sorts of other bright colors.

Permalink

bamboost on September 20, 2014 at 11:33 PM:

You can get an amazing look with the army style lace up Ugg boots. The boot comes with a small heel for easy walking with a rounded toe design. If you want to have that extra on-trend look, then allow the tongue of the boot to hang over. You can even get a new look with the gray colour Tibet boots from Botas Ugg.

Permalink

ghiqccdx on September 21, 2014 at 3:42 PM:
bamboosm on September 25, 2014 at 7:56 PM:

Westwood believes that there are too few female designers whose designs are kind to women, glamorous and empowering. Her belief is that "Fashion is very important.Vivienne Westwood UK It is life-enhancing and like everything that gives pleasure, it is worth doing well"

Permalink

bamboosx on September 26, 2014 at 12:24 AM:

Thus,among all the products of Vivienne Westwood jewellery is also a common product. She derived a way for using fashion statement in order to help the conditions due to global warming.Vivienne Westwood Jewellery She showed people the path to buy their fashion products only according to the needs of environment.

Permalink

bambooso on September 26, 2014 at 8:32 AM:

With the sucess and popularity of the coloured GHD hair straighteners,GHD Hair it leaves us in no doubt that GHD will again release a new coloured GHD very soon. They question is, What colour will it be?

Permalink

bamboosn on September 26, 2014 at 3:55 PM:

You can get an amazing look with the army style lace up Ugg boots. The boot comes with a small heel for easy walking with a rounded toe design. If you want to have that extra on-trend look, then allow the tongue of the boot to hang over. You can even get a new look with the gray colour Tibet boots from Botas Ugg.

Permalink

bamboosr on September 26, 2014 at 8:50 PM:

Would you believe it ' this pair of sunglasses features removable earbuds and disguised controls for the MP3 player installed on the glasses itself! Now you can jog along and enjoy the music without the annoyance of wires around you. Although, this might not be big news, since its predecessor,Canada Goose Danmak oakley sunglasses outlet, have such a feature as well.

Permalink

bamboosk on September 27, 2014 at 1:51 AM:

With the sucess and popularity of the coloured GHD hair straighteners,GHD Hair it leaves us in no doubt that GHD will again release a new coloured GHD very soon. They question is, What colour will it be?

Permalink

bamboose on September 27, 2014 at 5:42 AM:

Furthermore,Vivienne Westwood internet men's jewellery marketplace is witnessing increment in its sales notwithstanding the worldwide financial downtrend facing the world.

Permalink

bamboosc on September 27, 2014 at 8:58 AM:

Wearing an item from Vivienne Westwood,Vivienne Westwood Sale you would surely look trendy and chic. Being one of the leading brands in the field of clothing and accessories, you can get various types of items that include both men's and women's wear.

Permalink

bamboosy on September 28, 2014 at 1:21 AM:

It is perhaps these early influences that would come to shape Vivienne Westwood shoes and dresses later in the century.

Permalink

bamboose on October 09, 2014 at 1:27 AM:

It was also a time when men were particularly fond of fitted blazers,Vivienne Westwood checked and striped pants as well as breezy knitwear. The fact that makes Vivienne Westwood clothing stand apart from the rest is that it is characterized by light-weight material and intricate embroidered detailing.

Permalink

Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.

Name:

Email Address:

Website:

Comments:

Check this box if you hate spam.