/Youtube reveals new embed code

Youtube reveals new embed code

Youtube (and subsequently Google) is pushing their HTML5 support by rolling out a new embed code that will come with an Adobe Flash wrapper or in a HTML5 player (the best of both worlds?).

If you’re on a mobile device, the obvious advantage is that you’ll now be able to view videos on the browser you’re using instead of the built-in player.

Anyone viewing a site using the new embed code can watch them using Flash or an HTML5 player, depending on their viewing environment and preferences. A notable warning though is in instances when HTML5 isn’t supported (e.g. using the HTML5 player for videos with ads), the default Flash player is used.

The new code looks something like below:

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

The result?

Do note that if you try this with your wordpress blog, the Rich Tech Editor will eat up your code so try it with the HTML editor.

source Youtube API