I've been working on a project that uses Youtube's javascript api using their flash object embed method (swfObject embed), but today learned that I can use their iframe player api and use HTML5 version. It sounded awesome because getting rid of Flash would mean lower cpu usage....at least that's what I thought.

Anyway I worked on it for a while and turned it into an html5 version, but the cpu usage hasn't changed that much. Actually in most cases it seems it's even higher. I understand there are other benefits of using HTML5 player, but my highest expectation was on the low resource usage part, so I am quite disappointed.

Maybe I did something wrong? Can anyone who implemented iframe api share their experience in terms of cpu usage?

1 Answer
1

The Youtube IFrame API will still serve a flash player if the device/browser supports flash. It will only serve the html5 player as a backup if flash isn't available.

From the docs:

This approach provides more flexibility than the previously available APIs since it allows YouTube to serve an HTML5 player rather than a Flash player for mobile devices that do not support Flash.

This would likely be why you are seeing little difference in cpu usage since it is probably serving the flash player. Either way you should use the IFrame API for the added flexibility and if you do notice the cpu usage becoming a problem the best place to ask about it would be the Youtube APIs Developer Forum http://groups.google.com/group/youtube-api-gdata?pli=1 since it is monitored by Google.

I don't think it's serving a flash player if i right click on it and the context menu shows HTML5. Also, Flash IS available on my computer. I am pretty sure it's not Flash.
–
VladMar 1 '12 at 0:50

Also, as far as I know, there is NO added flexibility for using iframe api. Actually I've found there's less methods available, not to mention the lack of documentation for the lack of methods. Even Google doesn't suggest developers use the api for production purpose because it may change without warning because it's in beta.
–
VladMar 1 '12 at 0:58

There is added flexibility in that it serves either a flash player or an html5 player. It depends how much mobile means to you. The Iframe API basically uses the same set of methods as the Javascript API so you can look at that for extra documentation.
–
P. GalbraithMar 1 '12 at 1:04