开发者

Can html5 video element play flash movies?

开发者 https://www.devze.com 2023-01-01 17:22 出处:网络
<video> element is upcoming cross browser standart for playing videos, whi开发者_如何学编程le most videos out there right now are in flash format.

<video> element is upcoming cross browser standart for playing videos, whi开发者_如何学编程le most videos out there right now are in flash format. I am new to tag, so if it is possible a code sample of how to play flash movie with <video> tag would be nice


The tag itself does not specify what formats are supported. It is up to each browser to choose what codecs to support. I do not believe any browser supports flash video as part of their video tag support.


When you say 'play Flash movies' I assume you are referring to the video 'codec' and not the Flash browser plugin technology itself.

As far as I'm aware Flash supports it's own .flv video format and H.264 format. HTML5 video doesn't specify a codec to use, some HTML5 browsers support the H.264 codec (Chrome, Safari and IE9), others support Ogg Theora (Firefox, Opera, Chrome). If you have a Flash video that is in H.264 then in theory it should work as an HTML5 <video> in Chrome, Safari and IE9, but not in other browsers.

Your best bet is to use HTML5 video in H.264, and default back to Flash video if either HTML5 isn't supported (IE8 and below), or if the video codec isn't supported. Or you could encode in H.264 and Ogg to switch between them depending on the browser, but your storage and processing requirements go up.

To add to the confusion there is a third video codec for HTML5 called VP8 (or WebM) recently acquired and Open-sourced by Google, this will be supported in Firefox, Opera, Chrome and IE9, but not Safari.

Given the confusing landscape for HTML5 video at the moment, you might be better off sticking with Flash until things clear up, unless you don't mind the extra effort, or you need your videos to play on iPods/Pads


Yes, but...

Yes, you can. I have done it myself in FF 3.6.3 on OSX with h.263 FLV files. (Remember that FLV is a container that can hold different codecs.) But since HTML5 codec and container support is browser dependent, it may not work on all browsers that support HTML5.


No it's not possible. Flash movies require a different codec which isn't supported by html5. Depending on the browser you use, the h.264 codec or Google VP8 codec is supported to play movies. For example .OGG files will play with HTML5.

edit: since flash and html5 video are each other opponents i doubt .flv files will be supported in html5. Would be a nice feature though ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消