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 Technology/Engineering for Chaotic Moon. This site has no comments. If you want to talk to me, send me an @cksample on Twitter. If you like this post, feel free to send me a micropayment via Bitcoin.
This entry was posted in Blogging and tagged , , , . Bookmark the permalink.