Saturday, December 17, 2011

Flash: why do you still need

After the defection of Flash on mobile platforms, supporters of HTML5 have in sight the battlefield following: computers. But things are far from a foregone conclusion, because Flash keeps some benefits that HTML5 can still claim.

Ubiquity Runtime

If Flash was given as a rapid adoption of browsers and web sites is that it offered a solution to a real headache for web developers: it offered a runtime unique and universal to all browsers, while the HTML often requires adaptation to each browser. This is the famous "write once, run anywhere" (write once, run anywhere) was once the promise of Java, fully completed by Flash, at least until the advent of mobile platforms.

Specifically, the mass adoption of WebKit as the rendering engine on mobile platforms has made the same service for web developers. As long as the mobile version of a site appears correctly on a given mobile OS, it will work in much the same way on all. And just as Flash was missing on iOS, so it was that the HTML5 work gateway via WebKit.

The deal, however, is quite different on computers with different browsers is shared between multiple rendering engines: WebKit for Safari and Chrome, Firefox Gecko and many of its variations, and Trident for Internet Explorer. This is just, however, that a rendering engine, which must also add the JavaScript runtime engine that still differs from browser to browser, both features that speed, even among those who share the same rendering engine. Not to mention that browsers do not support the HTML5 so that even fragmented (Safari 5.1.2 gets away with a score of 308 out of 450, against 342 for Chrome on top of the podium)

In short, Flash still has many services to be rendered, even if only to make it easier for web developers.

Audiovisual nightmare

Things do not stop there though. While HTML5 adds support for video and sound, they do increase the hours for the puzzle.

Indeed, the W3C is at present unable to impose a standard file format, companies like Apple and Microsoft weighing all their weight to support the couple who own H.264/AAC, and supporters free formats of the Mozilla Foundation to Google, support Ogg Theora, Ogg Vorbis, and WebM.Chaque browser, depending on the positions of its promoters, will only support one of two camps, and make it difficult for website publishers. Thus, for a video in HTML5 natively readable by both Chrome by Internet Explorer, it will encode in both formats. Again Flash work is universal solution, since it allows any browser to play videos, they are encoded in H.264 or WebM.

If the HTML can switch to an alternative solution for displaying a video in the absence of technology covered by default (or "fallback"), in practice this capacity is still not put into practice, and in most cases is that Flash remains the priority. Thus, the version of a page will be compatible iOS charged on detection of the corresponding user agent, not the test for the presence of Flash. Thus, YouTube like DailyMotion to see their videos in HTML5, but only on explicit request from the user, and not in the absence of Flash. A small number of Mac users chose to withdraw Flash (the Mac version is criticized for its red), relying occasionally on the engine embedded in Flash Chrome when the need arises, but number of sites that have yet to HTML5 compatible content not present on iOS, unless you change the user agent developer in the menu.

On the other hand, Flash incorporates a feature critical for content providers and rights holders still missing the call for HTML5: the support of technical protection measures (DRM). Indeed, the dissemination of certain audiovisual works on the web can be done by contract if they are protected by such measures, and without them the catch-up TV services simply would not have been possible, for example.

But other online services depend on other feature exclusive to Flash video, including the ability to make video conferencing. Support for Skype in Facebook, the web version of AIM, or Chatroulette can only exist with Flash. If HTML5 allows broadcasting live video on the server side by means including HTTP Live Streaming (based on H.264, which is limited for now to Safari on Mac and iOS), it cannot access a webcam or microphone to the client side. The W3C is working on this problem with Media Capture API, still in the
draft. Finally, sound support is still incomplete in HTML5: it is possible to start playing a sound on a user event (clicking the mouse or pressing a key on the keyboard), it is still difficult to do so in a purely programmatic. The real-time mixing of several audio tracks consume too many resources, so much so that Apple has disabled the dynamic iOS (ostensibly to prevent abuse of bandwidth on 3G). For example, many web applications made in HTML still rely on a Flash module to manage the sound, through communication with JavaScript. Performance is therefore more technical demonstration than a real implementation, because even if it means Flash is required to make a web application, provided it is fully developed in Flash. At the cost of heavy efforts, it remains possible to make a game just fine completely in HTML, in any case this is Opera Software has demonstrated Emberwind, a game originally released for Windows, Mac OS X and iOS, with 100 000 lines of C code were laid entirely in JavaScript.

On the other hand, if there are low-level API to achieve a variety of sound effects in real time directly in JavaScript, they are more or less well supported (Web Audio API only works on Chrome and WebKit nightly builds, while Firefox supports its own system, of course, incompatible, called Audio Data API).

The Battle of the 3D

With Flash 11, Adobe attacks the market for online 3D, which was previously the preserve of Shockwave in its catalog. The announcement is significant because Flash still has a substantial installed base, so much so that Unity, which had its own plugin so far, has decided to integrate an output to the Flash IDE. More significantly, Epic Games has announced the porting of the Unreal Engine 3 in
Flash. If HTML5 does not include management of 3D, another standard, WebGL, managed by the Khronos Group, can use the maps in 3D an HTML page. 

Since the completion of version 1 in March, only Firefox (from version 4) and Chrome (since version 9) include support for WebGL standard. Safari 5.1 is still in an experimental support is disabled by default, Opera does not support WebGL in the beta of version 12, and Microsoft does not currently plan to support this technology in its browser. Concerned, a serious security flaw (read WebGL, weak link in security), sufficient concern that Microsoft has no plans to get started (see Apple and Microsoft cast doubt on securing WebGL).

On the other hand, Flash has already been a significant feature still missing in HTML: switching to full screen. Moreover Adobe also announced the arrival of the capture of the cursor, a feature for many of the elements contained in 3D.Protection

The essence of an HTML page is to contain the HTTP link to each of the elements it contains images, sounds, videos, text, javascript and other code. This makes data protection and code more complex, since the default is to print the source code of the page in the browser to find and download these elements (see Step by step: download web content).

JavaScript, the programming language HTML, and ActionScript, the programming language of Flash, have in common the need to be executable on any processor family: the code can be distributed in compiled form. This is the runtime (in one case the browser itself and the other the Flash plugin) that will interpret the code to send the necessary commands to the API system and processor. The disadvantage is that the source code should be available to the runtime, which exposes it to potentially prying eyes.

JavaScript developers who do not want to squander their skills may not use that code obfuscation. This process makes reading the code difficult for a human while being executed by the browser, through dedicated tools. As for third-party resources such as images, it is possible to prevent the load off the page for which they are provided, but again at the cost of additional server-side development, and potential exposure of the secret shared client side.

Things are simpler for Flash, as the SWF format does not inspect its contents, at least in theory. The code and the media that contain Flash files are relatively safe from prying eyes, except that there are also tools for "reverse engineering" of the SWF. This is a misnomer because the SWF is not; strictly speaking, compiled the code is converted into intermediate language (or bytecode). It is possible to convert the ActionScript bytecode that is readable, but it will not come out so far in its original form and is more or less usable as
is. In any case, nothing prevents an unscrupulous competitor to copy and paste JavaScript code in your own page to take advantage of your development without spending a penny, while the management of cross-domain Flash avoids this problem. Flash generally offers more latitude to protect the investments of developers and assigns, as to add an extra layer of protection against the JavaScript: it blocks direct HTTP requests to the SWF file, and all the items will be out of reach. It is also possible to prevent the storage of the SWF in the browser cache.

In sum, developments that require large investments will be protected with Flash, and open to the winds in HTML. A difference sufficient to deter some developers to abandon Flash.


Development tools dedicated to HTML5 are still relatively confidential. These include Hype, Senshi Animator, or Adobe Edge is currently under development. As for some games engines facilitate their implementation such as Impact Engine. But no one even competes with the convenience and flexibility of Flash, the less amount of additional tools that has emerged with the opening of the file format SWF.D the other hand, web developers themselves have a unique know-how with Flash to create dynamic and interactive content, while still few developers were able to get a real experience in HTML5 beyond mere tech demo, not to mention that each implementation in each browser is included a number of bugs that must be tamed. If we add to this the fact that it is the lack of Flash has motivated investment in HTML5 for mobile, this is not the same with computers: Flash is the path of least resistance on this platform. One day soon, the share of mobile OS, and maturity of HTML5, some sites may grow to reconsider the dual development between Flash and HTML, but there is still a long way by then.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.