Feeds

Google tests (semi) HTML5 YouTube embed code

It works with HTML5. Except when it doesn't

Boost IT visibility and business value

Google is testing new YouTube embed code that plays videos using either the company's experimental HTML5 player or its standard Flash player, depending on the video and the setup of the user's system.

YouTube is still very much wedded to its Flash player, but since January, Google has offered an experimental HTML5 player that operates sans plug-in. The player uses either the royalty-hampered H.264 codec or the newly open source WebM format, so it won't work with the stable version of Firefox (let alone Internet Explorer 8), and it doesn't handle YouTube ads.

But don't get your hopes up. The new embed code won't let you use the HTML5 player if a video has ads.

If you've set up your system to use the HTML5 player and the video doesn't have ads and it support Google's setup other ways, the embed code will player the video with HTML5. If not, it defaults to Flash.

Google unveiled the new code with a Thursday blog post, indicating it would soon be rolled out across the entire site. "Before we make this new embed code the standard for our general users, we wanted to give our developer community a preview," the post reads.

The new embed code – for embedding YouTube in third-party sites – uses the iframe HTML tag. It looks like this:

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

"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," Google says. "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."

Google's HTML5 player works with test versions of Firefox that support the WebM format, Opera, Google Chrome, Apple Safari 4.0 or later, the Microsoft Internet Explorer 9 beta, and other version of IE if they're equipped with Google Chrome Frame, the plug-in that turns Microsoft's browser into a Google browser. But not all videos will work with the player. Google has only begun to encode videos with WebM, and even test versions of Opera and Firefox don't support H.264. Opera and Mozilla don't believe in royalty-hampered codecs.

Created by Google, WebM is an effort to provide a royalty-free codexc for use with HTML5. Opera and Mozilla have vowed to make the leap to WebM, based on the VP8 codec Google open sourced in May. And Microsoft will allow WebM use if IE9 surfers install the codec themselves. But Apple is still firmly behind H.264, a codec licensed by the patent pool organization known as MPEG-LA. Like Microsoft, Apple is a member of the H.264 patent pool.

In order to use the HTML5 player, you must join the beta program here

Last month, with another blog post, Google confirmed that Flash will continue to "play a critical role" on Youtube because HTML5 isn't ready for prime time. One of the reasons Google gave is that HTML5 doesn't allow users to easily lift video from YouTube and embed it in other sites.

"Flash Player's ability to combine application code and resources into a secure, efficient package has been instrumental in allowing YouTube videos to be embedded in other web sites," the post read.

"Web site owners need to ensure that embedded content is not able to access private user information on the containing page, and we need to ensure that our video player logic travels with the video (for features like captions, annotations, and advertising). While HTML5 adds sandboxing and message-passing functionality, Flash is the only mechanism most web sites allow for embedded content from other sites."

It would seem that Google eventually wants to move away from Flash. But this isn't happening any time soon. ®

Build a business case: developing custom apps

More from The Register

next story
BBC goes offline in MASSIVE COCKUP: Stephen Fry partly muzzled
Auntie tight-lipped as major outage rolls on
iPad? More like iFAD: We reveal why Apple fell into IBM's arms
But never fear fanbois, you're still lapping up iPhones, Macs
White? Male? You work in tech? Let us guess ... Twitter? We KNEW it!
Grim diversity numbers dumped alongside Facebook earnings
Microsoft: We're making ONE TRUE WINDOWS to rule us all
Enterprise, Windows still power firm's shaky money-maker
HP, Microsoft prove it again: Big Business doesn't create jobs
SMEs get lip service - what they need is dinner at the Club
ITC: Seagate and LSI can infringe Realtek patents because Realtek isn't in the US
Land of the (get off scot) free, when it's a foreign owner
Dude, you're getting a Dell – with BITCOIN: IT giant slurps cryptocash
1. Buy PC with Bitcoin. 2. Mine more coins. 3. Goto step 1
There's NOTHING on TV in Europe – American video DOMINATES
Even France's mega subsidies don't stop US content onslaught
You! Pirate! Stop pirating, or we shall admonish you politely. Repeatedly, if necessary
And we shall go about telling people you smell. No, not really
prev story

Whitepapers

Top three mobile application threats
Prevent sensitive data leakage over insecure channels or stolen mobile devices.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Application security programs and practises
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
The Essential Guide to IT Transformation
ServiceNow discusses three IT transformations that can help CIO's automate IT services to transform IT and the enterprise.