So, here’s the code for either one:
<object type="application/x-shockwave-flash" data="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" width="400" height="326"><param name="movie" value="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" /><param name="FlashVars" value="playerMode=embedded" /></object>
Took a while to figure out, but it works. I originally tried the code mentioned in this article, but it kept breaking my site, so I trimmed it all down to the bare essentials. This works for me and my template. Let me know if it does / doesn’t work for yours in the comments. w00t!
UPDATE: Great post from Ryan over at Hapless band of staff and regulars, where he tweaks my code slightly to avoid YouTube upscaling of the video. Check it out.
Comments on this entry are closed.
Works great. Thanks.
http://www.virtualvideomap.com
Your work was a GREAT help for me today and stopped me from stepping in front of a train. Perhaps you could write for A List Apart. How can they make it so complicated — and yet, still not work!
Honestly, thanks a ton, dude! :)
Great! Thanks a lot!
Thank you very much!
I’m new about this “blog-video-stuff”.
An example? I really don’t understand how to put this in the Wordpress template.
Thank you and excuse my english (really sucks!).
groovy. Killed 8 validation errors I was trying to get rid of.
Is there anyway to get this code to work with firefox too? It works great with IE but does not show up with FF (at least not on my machines)
thanks
Yup, not working for me in FF either. Any ideas?
Works fine for me in FF 1.5 and FF 2.0 – Embedding Google Video clip. Using Flash Player 9.
Al
Great! you solved my problem, and it does not work only for Netscape but for IE too!
Thanks!
Dude, you saved my blog from breaking apart! :’)
Thanks a lot!!
eskeci de deixar o link pro meu blog…
This page will help you to convert youtube’s code into a valid XHTML.
http://www.gl3nnx.net/valid-xhtml-youtube.php
No Sweat! instant valid XHTML!
Just want to inform that the codings provided by c.k. works for metacafe videos as well. Just replace the embedded video’s url into his codings. I haven’t tried it with other video sites, but I think it should work for those as well. Thanks for the codings!
I still don’t see my embedded youtube video in my blog. I see it my other machines and not in my laptop. I reinstalled Flash plugin and still not working.. Help me here..
Thanks
VIJAI
Works great. Gracias!
cool stuff, works like a charm. thanks for sharing.
http://basilar.net
F*ckin Hell! Yur a GOD!!!
I’m tryin to find a way to display these goddam vidz without breaking the W3C Validation for hours…
ThanXX A LAAAAAATTT ^^
Thanks, just used it for my site and it works great!
hmm well got rid of all the validation errors, but all i see is a white box which isn’t clickable or anything. I’m using Firefox 2.0.0.3
Make sure you use the URL in YouTube’s embed code, NOT the videos URL.
ah ok well the link someone above posted here works:
http://www.gl3nnx.net/valid-xhtml-youtube.php
but it leaves a white border on top/bottom and to the right one pixel, so change width to 424px and height to 336px
Super! I had the same problem but that did the work!
Thanx man
What blows my mind is the fact that all of those services offer embeding as a service, but don’t make it valid code when they easilly can.
Thanks,
http://www.thesmartass.info
Thanks for that. Your method validates in XHTML 1.1 and that’s the one I needed.
Great tip, works cleanly, easy to understand, and I agree with many of the comments above. Why does everyone have to make it so hard?
Thank u very much guy!
Thank you for this code! I wonder why Google doesn’t use it?
One thing I had to do however…
I was getting 5 validation errors when I first used your code. When I took out the &hl=en from the end of the docId code, it passes completely…
I suppose that stands for home language = English ? probably used by Google to filter your language results but not necessary to play when embedding.
Chris Davis
http://www.chrisdavistech.com
Nice, Thank you!
Deviantz – http://www.iCzalazar.com
http://www.youtube.com/v/HpwtQiHZI2E
Bummer that the video controls don’t work though. Would be nice to be able to pause.
hey, this works great, thanks for helping the web with your work
Great, it’s what I looking for,Thx
http://www.digitalframe0.com
Big thank you! =)
Thank you, this worked great. I also used it to help me embed myspace videoa without breaking validation:
Hope this helps too :)
Worked perfectly, thanks!
YouTubeRobot.com today announces YouTube Robot 2.0, a tool that enables you to download video from YouTube.com onto your PC, convert it to various formats to watch it when you are on the road on mobile devices like mobile phone, iPod, iPhone, Pocket PC, PSP, or Zune.
YouTube Robot allows you to search for videos using keywords or browse video by category, author, channel, language, tags, etc. When you find something noteworthy, you can preview the video right in YouTube Robot and then download it onto the hard disk drive. The speed, at which you will be downloading, is very high: up to 5 times faster than other software when you download a single file and up to 4 times faster when you download multiple files at a time.
Manual download is not the only option with YouTube Robot. You may as well schedule the download and conversion tasks to be executed automatically, even when you are not around. Downloading is followed by conversion to the format of your choice and uploading videos to a mobile device (if needed). For example, you can plug in iPod, select the video, go to bed, and when you wake up next morning, your iPod will be ready to play new YouTube videos.
Product page: http://www.youtuberobot.com
Direct download link: http://www.youtuberobot.com/download/utuberobot.exe
Company web-site: http://www.youtuberobot.com
E-mail: support@youtuberobot.com
i was looking for this thank you.
great codes thanks
found your blog which definitely helped me in getting code to validate (thanks!) … one thing to add, for embedding hulu videos where specific clips are chosen from a longer video there: in the code hulu will give, part of it will have something like “st=400&et=550” (st being “start time” and et being “end time” — numbers here are just examples). With your validating code, you’d take the start/end code and add it to this part:
<param name="FlashVars" value="playerMode=embedded" />
so that it would look similar to this:
<param name="FlashVars" value="st=1022&et=1157&playerMode=embedded" />
(Again, the numbers are examples only; one would use whatever numbers are in the embed code hulu gives for the particular clip chosen.)
PS of course use (without spaces):
& amp;
in place of just & in the code … that part didn’t come through right in the example.
hey thanks a bunch. this is exactly what I was looking for. now my site doesn’t break IE.
Works here. Thank you.
Wordpress users: this is a plugin that embeds all of the current media today without breaking validation!
http://wordpress.org/extend/plugins/video-embedder/#post-5127
thanks…
thank you man
hey, great work, thanks
Thanks for the quick fix.
thanks for fix
thanks, great work
thanks alot
merhaba ho? geldiniz te?ekkürler
thanks
Thanks so much.
Thanks a lot.
thx alot
Thanks for that. Your method validates in XHTML 1.1 and that’s the one I needed.
OMFG! Thankyou SO much!
will google adsense ban me if i paste youtube videos in my site?
Thomas,
No. YouTube is owned by Google, so it’s all good.
Your web site is really nice if we think the others
I think you had worked about that web site, hardly.
Like I see. Thank you for information tht i get.
Yes Thats is a good idea
ty
No. YouTube is owned by Google, so it’s all good.
Another awesome way to embed video is to use VideoSwiper a web 2.0 online application that can mass populate your websites and wordpress blogs with niche targeted video content. The application also allows you to edit the embed codes title, description and tags before posting it to your website to keep the content unique.
http://www.videoswiper.com
This worked great! Thanks so much! IE can be such a pain sometimes!
For some reason I have the hardest time ever when dealing with this type of code. Still learning though!
Thanks for the article
Thank you
sohbet
Another awesome way to embed video is to use VideoSwiper a web 2.0 online application that can mass populate your websites and wordpress blogs with niche targeted video content. The application also allows you to edit the embed codes title, description and tags before posting it to your website to keep the content unique.
I had the same problem but that did the work! great.
Thanks a lot I’ve been trying to get this to work on an script it was able to remove all errors except one.
Duplicate specification of attribute “class”.
…alue=”” size=”22″ tabindex=”1″ class=”styled” />
You have specified an attribute more than once. Example: Using the “height” attribute twice on the same “img” tag.
I had no idea that you could break validation with a youtube embed. I sure am glad that I ran across this. I guess I need to spend more time in this blog!
Thanks,
Really!
Brilliant, cheers mate! time for a mass embedded vid editing session!
mirc
kelebek
kelebek script
kelebek sohbet
kelebek resimleri
Hi, I tried this in Google groups and it strips the code – should this work in Groups, or only Google pages?
Thanks!
Thanks guys for your hard work. I've tried Ryans' code. It works with IE, Firefox, Opera. Can you please, tell me other browsers about…Finaly I fixed that mess. Here it is at http://www.jewelry-engraver.com
this is the you tube valid embedding code
I also though all the coding to embed videos is a little excessive, alot of the tags are repeated and not needed
thank grice nice
Everything seems to be working just fine!
I don't see the reason why you have to go through that. The embed code is good enough.
what''s new with this code? am I missing something?!
thanks for that info m really good
I go along with everything you say. Which was? Huh?
Can you plaese give a valid xhtml with full screen option?
Thanks helena.
Thanks mate, works like a charm. I was searching to solve this for a while !
Thank you very much! It works perfectly!
“This document was successfully checked as XHTML 1.0 Strict!” : YESS
Awesome! Thanks!
Full screen dosen’t work =(