Can HTML5 do most of what Flash does today? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
开发者_StackOverflow中文版 Improve this questionWhat can it do? and what can't it do? (in relation to flash)
HTML5 doesn't do anything, per se. It's a spec; one that isn't finished yet. Sure, many of its proposed features will allow developers to produce similar features as Flash, but it's up to the browser developers to implement said specification. Currently, there's a good amount of its proposed spec implemented in different ways by different browser vendors. If your application only uses something that supports some of the HTML5 spec (webkit-based Safari 5/Chrome/Chromium for instance), you can do a lot (ahem, guessing your question stems from Steve Jobs mentioning HTML5 in a Keynote™)...but will struggle with cross-platform support. Many of the major players in the browser market haven't even agreed on a common codec for video yet (H.264 for many, not supported currently by Firefox/Opera/etc. which use ogg/theora) so basically we're going back to pre-flash days of plugin-madness for a bit.
Some of the exciting features proposed in the spec for me are:
- flexible
canvas
for scripting drawings, images, animations - more semantically accurate documents
- custom data attributes
- video and audio support (assuming something is agreed upon with RE: to codecs)
- web/browser database
One of the major things that I personally would find to be a pain to produce using the proposed HTML5 spec:
- animation and design. Ok, this is a coding site, but I'm a designer who codes and I work with a lot of designers. I don't want to have to programmatically animate a vector walkcycle :D ...canvas has little to no support for designers..do you see your designer friend writing code like this?)
Here's an app that shows a little bit of HTML5: http://9elements.com/io/projects/html5/canvas/
You'll note that it may "run up" your processor a bit (hey, just like flash!).
In the next 5-10 years it'll all be possible. Most of the spec is (if at all) partially supported in major browsers. You can keep up with which major browser's layout engines support what here. Officially though, the spec is scheduled to be complete in 2012, and recommended by 2022. Flash will still be a major player for a bit.
http://html5gallery.com/
and just in case:
http://ishtml5readyyet.com/
Edit just to add a few more notes from a blog comment I posted recently
HTML5 is about semantics and interoperability; it defines a recommendation about how HTML producers should produce documents. If browsers adopt these standards, it will make it easier for producers to create interoperable content that can be consumed sans plugin. This is why I love Flash; because it’s standards are implemented by the same people who “wrote” the standards. It behaves the same cross-platform (mostly) because it’s a plugin. The primary intention of HTML5 is to reduce the need for plugins.
One thing we (we being developers, designers) need to be careful with is lumping CSS3 and Javascript in with HTML5. Much of the cool stuff you see that is denoted as HTML5, isn't (Apple's recent "HTML5" showcase–which, the majority of which was not HTML5–is a great example). It's jQuery; it's CSS3 animations and transformations; it's proprietary video codecs that are only supported it one browser. Much to my chagrin, HTML5 has become the new "Web 2.0", representing a wide body of somewhat related technologies.
You have less control over the audio with HTML5 than in Flash. You also depend on the browser for embedded video support.
But, HTML5 on some browsers, supports having a small database, so that you can locally cache some information and have it be persistent between iterations.
You can do 3D graphics, there are examples on the web, using the canvas tag, but, the tag has only limited support on IE using the excanvas code.
One thing HTML5 can do that Flash can't is run on the iPad. :) <== This is supposed to be humorous, it appears that that is lost on some people.
So, what do you want to do with Flash that you may consider trying to do in HTML5?
With Flash you can use their development tools and so have little actually coding to get some functionality, with HTML5 most of the changes seem to be driven by using javascript and there are few tools for that, that are specific to HTML5.
To a large extent, the answer to this question depends on how closely you look at the features. Take video as an example - can HTML5 do what Flash does today? If you mean "can they play video?" then the answer is yes - HTML5 will include a tag, that lets you embed video directly into a page without using a plugin. But if you mean "can they play video for 95% or so of the market with a single codec", then the answer is quite different - today, HTML5 requires at least two codecs to be published (H264 and ogg/theora) to covers something less than 40% of the market.
Eventually though, when HTML5 video gets into IE and maybe solves its codec issue (though the codec part doesn't appear very likely right now), what will realistically happen is that content owners will have two ways to distribute video, and they'll choose whichever fits their purpose better. So if you want your video to be accessible to search engines, HTML5 is definitely going to be better than Flash. But if you want features that aren't standardized, like DRM, then the proprietary option is going to cover you better than the standardized one.
So I think the answer for the future is that it doesn't really matter whether they "do" the same thing - after all, HTML/AJAX does basically the same things that Flex does, but that doesn't mean nobody uses Flex. The difference is in the tooling support, hooks into other technologies, and in the details of all the non-standardized parts of the feature sets.
精彩评论