YouTube Switches To iframe Embed Tags For Videos

youtube_logoLooks like the new YouTube homepage was not the only changes rolled out by yesterday. In addition to the homepage changes, YouTube has also switched all video embed codes to use <iframe> instead of the older <object> embeds.

This was probably the first time I saw YouTube providing me with an iframe embed instead of the regular object embed code. However, this is not a new change and has been in test for a long time now. I came up with across various articles which have discussed this issue in the past six months or so.

youtube_iframe_embed_code

One of the discussions I found was on the YouTube API blog done back in July 2010. The post delved into the new iframe embed and explained to developers that the switch from object to iframe was to allow YouTube to display the video in either or Flash, based on the user’s browser capabilities. They also wrote a post on Jan 20, 2011 to say that the iframe tag was now the default embed tag.

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. Environments that support the HTML5 video player are listed here on our HTML5 settings page. In instances where HTML5 isn’t supported (e.g. our HTML5 player can’t play videos with ads), we use Flash.

The move was apparently done so that the embedded videos would eventually work on mobile platforms that do not support Flash including the .  However, it looks like Google still has a lot of work to do since the video does not play on the iPhone even if you use the iframe embed tag.

Did you have any luck with playing YouTube videos on the iPhone, or while using the iframe embed tags?

2 thoughts on “YouTube Switches To iframe Embed Tags For Videos”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>