YouTube (s GOOG) is experimenting with a new form of embeds that enable iPad users to play embedded videos right within a web page. The new embeds use iframes to switch between a Flash and an HTML5 version of the video, depending on the user’s device. The experiment was announced today on the YouTube API blog, but the site’s software engineer Toliver Jue didn’t make any direct mention of the iPad. Instead, he just vaguely promised that this method will “eventually allow embeds to work on mobile devices.”
However, we were able to confirm that at least the test video used for the announcement already plays on the iPad’s Safari browser, as shown in the screenshot below:
It’s probably a little early to swap out all your YouTube embed codes. The new method of embedding videos is dubbed “a preview” by YouTube, and there are a number of downsides:
- Videos with ads can’t be shown as HTML5 and are instead shown via Flash by default.
- There’s no way of automatically generating these new embed codes on YouTube just yet, which means you’ll have to manually change the code for each video you want to embed.
- The Next Web reports that changing the width of the embed will break the player.
- Firefox and Opera users will only get to see HTML5 videos if the source video is available in WebM, which apparently isn’t the case for every YouTube video just yet.
- Users have to opt into the Testtube HTML5 trial to see any HTML5 videos at all, which means that most users will still get Flash by default, even when using the new embed code. iPad users that haven’t opted into the Testtube trial just see a black box instead of the video.
Still, if you’re a developer or webmaster of a site with lots of iPad traffic, you might want to take a stab at it and play with the new embeds.
Related content on GigaOm Pro: HTML5’s a Game-Changer for Web Apps (subscription required)