HTML5 vs. SWF
A lot of people who post comments to Slashdot advocate abandoning SWF, the technology stack used by Adobe's Flash Player, in favor of HTML5, the technology stack used by Safari, Chrome, Opera, and Firefox.
Both have their pluses and minuses.
- Open specification
- The license of the SWF specification banned third-party players until May 2008, and one of the transport protocols wasn't published until June 2009. Things have improved since then. But HTML5 has been open from the start, which allows for diversity and competition in implementations.
- Royalty-free video codec
- One video codec option available to HTML5 is Theora. This codec is based on the VP3 codec, whose patents are licensed royalty-free by On2, a Google company. All video codecs supported by SWF have patents without royalty-free licenses.
- iPhone and iPad availability
- Mobile Safari on iPhone and iPad can play HTML5, not SWF. Apple prefers HTML5 because Flash Player for Mac OS X is so unstable and CPU-inefficient and because of HTML's longer history of open specification.
- Guaranteed codec
- No disjoint video and audio codecs among players. Virtually all SWF players are Flash Player, and Flash Player has H.264, unlike HTML5 where some popular browsers have only Ogg video and audio (Theora and Vorbis) and others only MPEG video and audio (H.264 and AAC), due to the various browsers' different patent policies. Google's release of WebM in mid-2010 helped soften this, and Microsoft pledged to support third-party codecs such as WebM in Internet Explorer 9.
- Authoring tools
- It appears some HTML5 browsers do not support playing more than one
<audio>element at once. Flash Player, on the other hand, lets a script play sound effects on top of the background music. Reportedly, even those that do allow multiple simultaneous
<audio>don't support playing the same sound multiple times at once, such as two car engines using the same sample. Moreover, Flash supports procedural decompression and synthesis of audio on the client, unlike both HTML5 and XNA 3.
- PC availability
- A lot of PCs come with Flash Player preinstalled but no HTML5 player. Organizations' IT departments are likely to lock down installation of plug-ins. Google provides a browser helper object called Google Chrome Frame that adds HTML5 support to Internet Explorer versions 6 through 8 on sites that use the
X-UA-CompatibleHTTP header to opt in. But as long as far more sites use SWF than HTML5, IT departments are more likely to authorize the deployment of Flash Player than Chrome Frame. Among computers running mainstream desktop operating systems, Flash Player simply has far closer to 100 percent penetration than HTML5 browsers.
- Script type system
- On one PC running Windows XP and Firefox 3.6, a particle system written in HTML5 Canvas and Flash ran at 46 FPS in Flash and 19 FPS in Canvas. This relative lack of performance has remained the case even for Firefox 11.
Here's a challenge for fans of HTML5 technologies: "Badgers" is a 36-second-long SWF vector animation that takes 436 KiB. HTML5 will be ready to replace Flash once it is as easy to make "Badgers" in HTML5 as it is to make "Badgers" in Flash without making the HTML5 download size more than 50% bigger than the SWF download size. (One example of "cheating" involves rendering each frame of the SWF and compressing the result as H.264 or WebM.) I recommend starting with Synfig or KToon.
- Steve Fulton. For Flash Games Developers, Working With the HTML 5 Canvas Is A Lot Of "Roll Your Own". 8bitrocket. Accessed 2010-05-02.