YouTube Intros New Video Embed Format, Replacing Flash With HTML 5Jul 23rd, 2010 | By James Lewin | Category: Internet TV, Video
YouTube has announced a new option for video embeds, designed to support HTML 5 and to fall back to Flash where HTML 5 is not supported.
According to YouTube, “If you use the new embed code style, your viewers will be able to view your embedded video in one of our Flash or HTML5 players, depending on their viewing environment and preferences. In instances where HTML5 isn’t supported (e.g. our HTML5 player can’t play videos with ads), we use Flash.”
This new style uses <iframe> and looks like this:
<iframe type=”text/html” width=”640″ height=”385″ src=”http://www.youtube.com/embed/VIDEO_ID” frameborder=”0″>
An additional benefit of the new embed style is that it will eventually allow embeds to work on mobile devices, which typically use a built-in player instead of Flash or HTML5.
Note: The new embed code is currently for developer testing and hasn’t replaced the default embeds – but it looks like YouTube may be moving to marginalize Flash sooner rather than later.
I’ve embedded a video both ways below so you can compare them.
Current Embed Code:
New Embed Code: