Don's Pages and my Music

Monday, July 26, 2010

YouTube's shiny new HTML5 embed code is now live

YouTube's shiny new HTML5 embed code is now live

Most of you have probably embedded a YouTube video at one time or another, even if it's just to share it on Facebook. Because copying and pasting is so easy, you might not have paid much attention to the embed code itself, though. Well, now's a good time to start looking, because Facebook is changing to a shorter, more compatible embed code, using the <iframe> tag.

What does that mean to the average YouTube user? Well, for one thing, the new code adapts to users' viewing environments, serving HTML5 or Flash videos depending on your browser and settings. It's also a big step toward showing embedded YouTube videos on mobile devices that don't have a dedicated YouTube player.

If you want to try out this enhanced embedding capability on your own site, you can just copy-paste this block of code, and fill in the video ID for the video you want to embed:

<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>


Go there...
http://www.downloadsquad.com/2010/07/26/youtubes-shiny-new-html5-embed-code-is-now-live/

Don

No comments:

Post a Comment