HTML 5 <video> tag vs Flash video. What are

2019-01-16 04:24发布

IMPORTANT UPDATE

This question was made over 9 years ago. It made sense then, it doesn't make it now. Flash is hard on its way out; <video> support is ubiquitous, including mobile devices. Almost anything that Flash could do, HTML can now do too. HTML won, Flash lost. If you're pondering on how to embed video in your page, just use <video> and don't give it a second thought. This question is only preserved for historical value.

Original question

Seems like the new <video> tag is all the hype these days, especially since Firefox now supports it. News of this are popping up in blogs all over the place, and everyone seems to be excited. But what about?

As much as I searched I could not find anything that would make it better than the good old Flash video. In fact, I see only problems with it:

  • It will still be some time before all the browsers start supporting it, and much more time before most people upgrade;
  • Flash is available already and everyone has it;
  • You can couple Flash with whatever fancy UI you want for controlling the playback. I gather that the tag will be controllable as well (via JavaScript probably), but will it be able to go fullscreen?

The only two pros for a <video> tag that I can see are:

  • It is more "semantic" - which probably holds no importance to a whole lot of people, including me;
  • It is not dependent on a single commercial 3rd party entity (Adobe) - which I also don't see as a compelling reason to switch, because free players and video converters are already available, and Adobe is not hindering the whole process in any way (it's not in their interests even).

So... what's the big deal?

Added:

OK, so there is one more Pro... maybe. Support for mobile devices. Hard to say though. A number of thoughts race through my head about the subject:

  • How many mobile devices are actually able to decode video at a decent speed anyway, Flash or otherwise?
  • How long until mainstream mobile devices get the <video> support? Even if it is available through updates, how many people actually do that?
  • How many people watch videos on web pages on their mobile phones at all?

As for the semantics part - I understand that search engines might be able to detect videos better now, but... what will they do with them anyway? OK, so they know that there is a video in the page. And? They can't index a video! I'd like some more arguments here.

Added:

Just thought of another Cons. This opens up a whole new area of cross-browser incompatibility. HTML and CSS is quite messy already in this aspect. Flash at least is the same everywhere. But it's enough for at least one major browser vendor to decide against the <video> tag (can anyone say "Internet Explorer"?) and we have a nice new area of hell to explore.

Added:

A Pro just came in. More competition = more innovation. That's true. Giving Adobe more competition will probably force them to improve Flash in areas it has been lacking so far. Linux seems to be a weak spot for it, cited by many.

31条回答
对你真心纯属浪费
2楼-- · 2019-01-16 04:43

I would say the definite pro of using <video> instead of Flash is that I will be able to watch videos in my browser without having it crash or go crazy slow. I use 64bit OpenBSD, so gnash is all I can get and I only enable it when I'm feeling really risky because most of the time I'll come across a flash banner ad and my browser(firefox 3.5) will crash.

And my mobile phone browser doesn't support flash, yet it supports the video tag(and it's not an overly "fancy" phone either).

查看更多
做自己的国王
3楼-- · 2019-01-16 04:44
  • The user has control of the UI: they can choose which browser they would like to download and use, and depending on how it works(I'm not sure of the details, but I'm familiar with the concept), even keep their browser and just choose the handler npapi plugin for it. How many times have you been stuck using a shitty actionscript video control interface because the devs of the site you're on were too lazy to do it right (or use flowplayer). Power to the users!, I say.

  • Its open source. Now, i'm not RMS or anything, and its nothing to do with ethics or anything else like that, but OSS is just the more efficient, better way to go. It produces better code.

  • Better platform support. Right now, Linux + flash = bad. Adobe's the only one who can do anything about it. This sucks.

  • like you said, more semantic.

查看更多
等我变得足够好
4楼-- · 2019-01-16 04:45

Here's my pros of HTML 5 in 2012:

  1. I'm using the HTML5 trail of youtube. Now flash player doesn't crash all the time. Now my computer is stable for weeks. Now I'm happier.
  2. I don't see an "update HTML5 player" whenever I reboot my computer like I do with flash.
  3. Once embedded video everywhere works with HTML 5, I can remove flash from my computer because the only use I had for it was to play videos.
  4. This is a pro for website developers: I have a flashblocker because of how annoying flash is. I don't have an HTML5 blocker. Webmasters have a second chance to send me content.
  5. HTML5 will likely be implemented properly on browsers instead of being the #1 security hole on most computers.
查看更多
霸刀☆藐视天下
5楼-- · 2019-01-16 04:45

I think the large majority of these answers condense to this: Flash is engineered mostly for the mass market, so it provides the easiest way to cover the bulk of the market, but it is deficient in covering less common and emerging platforms (i.e. shaky Linux and no iPhone). This has been the story with Flash pretty much from day one. It's practically a case study of how proprietary and OS software differ (and complement each other).

On the other hand, I think most answers are seriously underplaying the codec angle. There is one primary reason why Flash video dominates the web today: it's the only way to publish a single version of a video and expect it to be viewable by more than about half your audience. Even though the video tag looks to be designed well, as far as matching up multiple source files to the user's installed codecs, it's still difficult to know how many codecs are needed to cover what percentage of an audience, and impossible to know whether people will upgrade as new codecs emerge. Flash video has more known quantities, and a reasonably good expectation of upgrades for the large bulk of the audience.

I also kind of think that the performance angle is overstated in most answers, as well. It's true that Flash uses more CPU than any other player I have, but it also starts up more quickly - by orders of magnitude. When I come across a web page with an embedded MPG, my browser is frozen for 15+ seconds while QuickTime boots, or perhaps only 5 seconds if it was already running. (Almost as bad as PDF ;) ) Obviously Flash is less efficient in some ways, but from where I stand it's more efficient in others; like any software solution tradeoffs are involved.

查看更多
爷的心禁止访问
6楼-- · 2019-01-16 04:46

HTML5 Pros:

  1. It supports whole new DOM API for video objects, you can write script which can interact with new HTML5 tags.
  2. You can detect different video format support play, pause, and track video playback.
  3. Its already well supported. Firefox, opera, chrome already support chrome, video , etc... Even youtube is testing some HTML5 player.

Flash Pros/ HTML5 Cons:

  1. Flash is there everywhere. So HTML5 will take lot and lots of time to catch up.
  2. Flash support extensive features, let it be HW rendering, high definition video supports, Animation features it supports are simply irreplaceable(?)
  3. DOM API would never replace AS2/AS3 feature already supported by flash.
  4. Just count the number of professional flash developers out there... they will never switch unless HTML5 answers all their questions. There are number of flash developers who haven't switched from AS2 to AS3 yet :-)
查看更多
混吃等死
7楼-- · 2019-01-16 04:47

It will be nice to use some of the HTML 5 features... in 5-10 years from now...

We still have too many visitors using Internet Explorer 6 to ignore them, it will be quite some time before we can even move on to only testing the pages for IE7+...

查看更多
登录 后发表回答