How to embed YouTube and Google Video without breaking validation!

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.


About C.K. Sample III

I am a father, a husband, a blogger, a parrot owner, a pug owner, and the VP of Product Development for Crowd Fusion. This site has no comments. If you want to talk to me, send me an @cksample on Twitter.
This entry was posted in Blogging and tagged , , , . Bookmark the permalink.

120 Responses to How to embed YouTube and Google Video without breaking validation!

  1. Pingback: Embedding YouTube and Google Videos Without Breaking Validation Revisited | Sample the Web

  2. dizi izle says:

    thank you man

  3. hey, great work, thanks

  4. Rob C says:

    Thanks for the quick fix.

  5. bearshare says:

    thanks, great work

  6. oyun says:

    thanks alot

  7. oyunlar says:

    merhaba ho? geldiniz te?ekkürler

  8. oyun says:

    Thanks so much.

  9. toner says:

    Thanks a lot.

  10. kartu? says:

    Thanks for that. Your method validates in XHTML 1.1 and that’s the one I needed.

  11. aljuk says:

    OMFG! Thankyou SO much!

  12. Thomas says:

    will google adsense ban me if i paste youtube videos in my site?

  13. c.k. says:

    Thomas,

    No. YouTube is owned by Google, so it’s all good.

  14. 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.

  15. hikaye says:

    Yes Thats is a good idea

  16. Dizi izle says:

    No. YouTube is owned by Google, so it’s all good.

  17. 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

  18. Tony Oravet says:

    This worked great! Thanks so much! IE can be such a pain sometimes!

  19. hdtv antenna says:

    For some reason I have the hardest time ever when dealing with this type of code. Still learning though!
    Thanks for the article

  20. sohbet says:

    Thank you
    sohbet

  21. sohbet says:

    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.