How can HTML5 "replace" Flash?

Viewed 87853

A topic of debate that's seen a resurgence since the unveiling of the iPad is the issue of Flash versus HTML5. There are those that suggest that HTML5 will one day supplant/replace Adobe Flash.

I do not develop software that runs in a browser, so my (limited) understanding is:

  • HTML is a pure-text markup language that is delivered over HTTP to a client browser. The client browser interprets the markup and renders (with varying degrees of success) the page according to an standard specification.
  • Adobe Flash is a propriety framework for working with audio, video, sound and raster/vector graphics. It requires special authoring tools (a compiler perhaps?) and a custom player that's available as a plug-in to most common browsers.

Could someone please explain (to this C/C++ developer) how it is possible from a technical/coding point-of-view that a text-based markup language (HTML5) could be considered a replacement to a multimedia framework (Flash)?

Please no opinionated arguments - just technical facts.

25 Answers

What people loosely refer to HTML5 in the context of this discussion is the combination of HTML as a markup language, CSS which specifies how it is rendered, and the javascript code which manipulates the HTML and CSS dynamically.

Furthermore, HTML5 not only has the standard text elements, but also <canvas> on which 2d graphics can be drawn, and <video> elements which embeds the video (as the name suggests).

So, in a full-fledged implementation of HTML5, you can implement dynamic web sites without using Flash. An example is the HTML5 version of Youtube, recently introduced as beta for Safari/Chrome users, see here. Another is an NES emulator in javascript + HTML. (Well the latter does not really concern HTML5... it uses <canvas>.)

When Steve J. made the comments about HTML5 being the future, he didn't bother to explain that this statement really refers to the most widespread use of Flash today, that being Video. Perhaps he didn't explain this purposely, so that many misinformed end users who want to watch Hulu on their iPhones would unleash their rage against Flash. Which is exactly what has been happening..It is annoying and I lost respect for Steve.

The HTML5 stack (html, css and JS) will NOT be a direct replacement for Flash. I have been developing Flash content for over 10 years, I am also very competent in JS. I cringe thinking about using JS for tasks where ActionScript can accomplish the same thing in 50% less code. There are tasks that will be very difficult if not impossible to achieve with JS and CSS. For rudimentary animations and JQuery-like functionality, sure, HTML5 can be a viable option instead Flash. But for complex games and RIAs, I just don't see it. Actionscript has evolved into a robust, full featured language.

The other important thing is that the Flash player is updated by Adobe periodically to address any issues that may arise. How will they update/improve HTML5 spec if it becomes the norm and Flash went bye-bye?? They won't. You have to wait for HTML6 and all the browsers to support it. Which means you end up waiting 5-10 years. Great way to bring us back to 1998. No thanks, I'll stick with Flash for now.

As much as open standards are a worthy goal, I don't see this panning out the way they are saying...

My two cents.

how it is possible from a technical/coding point-of-view that a text-based markup language (HTML5) could be considered a replacement to a multimedia framework (Flash)?

HTML5 is the new hot name for "web technologies stack", not just a "markup language".

It has a programming language (JavaScript), like Flash does; a set of APIs, significantly expanding as part of the efforts commonly labeled as "HTML5", ways to draw graphics (SVG, <canvas>), play audio and video (<audio>, <video>).

Unlike Flash, the "HTML5 applications" are processed by the browser, not by a proprietary browser plugin, which is good - at least for browser vendors (see the relevant piece of this blog post - thanks Jotham). For example, it makes possible for a browser vendor to fix issues (and not wait for Adobe) -- IIRC Apple cited Flash as being #1 reason for crashes among all crashes on the Mac.

[edited to remove "open standards are better" claims which I am too lazy to back up]

It is not simply HTML5, but when browser adoption of it is complete. For instance, the presence of the HTML5 <video> tag means nothing without a browser provided video player to actually present the video (At which point, the hope is, Flash Video will no longer be needed). Same goes for the <audio> tag.

Additionally, HTML5's canvas element (combined with JS) allows for far more advanced graphics inside a browser than could be achieved before.

Well, to get an impression of the capabilities of HTML5/canvas + JavaScript, you may want to take a look at this which is an implementation of Wolfenstein 3D purely done in HTML5, without using any Flash (note that you need a canvas-enabled browser such as Firefox to see this working).

It is not so much that HTML5 can replace Flash by matching it feature by feature. It is more that the HTML5 stack (including JavaScript and CSS) can be used to build the same sort of rich web applications for which Flash was the only viable option before. Because HTML holds the promise to also address some of the shortcoming of the Flash platform, there is a potential that it can replace Flash in this space in the future.

This discussion is very much centered around the technology that is used to render the application at the users end. It does not address the ease with which authors are actually able to create the content which will be delivered to their users. You already mentioned that Flash is associated with a set of commercial tools which are specifically built and marketed by Adobe to address the need of rich-content authors. Such solutions for HTML5 are not that much adopted yet. For developers who view authoring mostly as coding this is not a big concern and they will not have a hard time getting traction with HTML5 (and many already do). For those authors that don't have a developer/coding background, this may be another story and for them the viability of HTML5 will greatly depend upon the availability of integrated authoring tools. Maybe the Adobe Flash tools will output to HTML5 instead of SWF in a few years...

There's much more to Flash than Audio/Video. Recently Flex has been very popular because of it's rich programming model and ability to develop high performance user interfaces.

if HTML 5 or anything has to become popular, first of all the in-built JavaScript engine has to be more efficient. Flex/Flash these days are popular because of robust ActionScript engine.

I doubt it's meant as a replacement for everything Flash is able to encompass. However, if you look around the web nowadays, you'll see that Flash is in widespread use for delivering video or audio content in the browser. Something that's included in HTML 5, albeit crippled by now since they couldn't agree on any standard codecs.

Surely, all those nice Flash games and ads won't go away just because of HTML 5 and HTML 5 won't be able to replace them. But it aims for being able to replace uses that actually can deliver content. For vector graphics there is also SVG which might get some special treatment.

Whether this will really be the death of Flash for video remains to be seen. The HTML 5 video codec issues might be sorted out sooner or later. However, Flash will quite likely remain the medium of choice where content deliverers will want greater control over what will be delivered, DRM and similar techniques, &c.

The modern browser that support HTML5 standard have capability to playing supported media file inside the browser, without needing 3rd party plugins.

You can try this by yourself. Latest version of Safary and Google Chrome, (Firefox 3.6 too) can play <video> tag in a HTML5 page directly. YouTube now support HTML5.

That's why iPad will be able to play video if the video site is using HTML5, without Adobe Flash plugins, using Safari browser that fully comply the HTML5 standard.

Together with javascripts for tracking GUI events and scripting of the new HTML 5 elements, you get a lot of what Flash offers.

HTML 5 has a number of new elements. One of them is called Canvas. With it you can draw anything you want on screen, within its bounds. You use javascript to draw on it and you can catch any mouseclicks and similar with javascript too. If you are used to GUI toolkits on the desktop like Tk, GTK, you can liken these new elements to some of the widgets of those GUI toolkits.

Take a look at thejit to see an example of graphs in HTML 5

I sure hope that HTML5 can deliver the goods and maybe not replace flash entirely but at least when it comes to video. Although flash video is small in size it does takes up way too much processing. Go to youtube without flashblock enabled and then open task manager. Now you can see how the processes for firefox suddenly leaps off the page whenever you visit a flash driven site like youtube. My advice get Flashblock.

I first heard the comment of "HTML replacing Flash" from Steve Jobs. (He hates Flash perhaps because it crashes on his Mac computers I'm not sure. I think he's out of touch. The proof is his ridiculous product the "iPad".)

The point is HOW GOOD IS IT FOR DEVELOPERS? Answer: not as good as Flash. Yet. Why do I say this with my limited experience? It's all that "try... catch" compatibility code you need in Javascript to work in all the browsers. WHAT A LOAD OF RUBBISH. ActionScript/Flash is ONE piece of code/app for ALL browsers.

The other thing Flash has is graphical (and non-graphical) development software tools to streamline the process.

So THE SHORT ANSWER IS THAT ADOBE WON'T LET HTML5 "replace" flash, at least for the short term. But it can compete with Flash if people make enough development tools for it particularly WYSIWYG graphical tools, like if Google develop an easy to use WYSIWYG editor for making GWT apps. And that's a big IF.

Simply put, many are hoping that HTML5 features paired with javascript can provide a better, cheaper, more efficient graphical web experience than flash. Consider that many sophisticated websites like gmail, google maps, and youtube can run without any flash using HTML and javascript. Improvements being made to javascript and HTML allow for websites to develop even richer graphical & animation features without resorting to paying Adobe.

Web developers still care for a browser like IE6 which is really old, so you can be sure that Flash and similar technologies will be around for a long long time...

Related