Html5视频和Flash方法 [英] Html5 Video and Flash Approach

查看:352
本文介绍了Html5视频和Flash方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看看HTML5视频标签,并研究哪些浏览器支持哪些视频文件类型,而我最初的想法就是比使用flash更难。



我是想知道是否有一些框架代码(结合视频的开发方法),有人已经想出了如下:


  1. 如果flash是
  2. 如果不是,请尝试html5视频ogg格式

  3. 如果不行,请尝试html5视频h.264格式
  4. li>
  5. 如果这样做不行,试试html5视频的webM格式

根据我所看到的我是否认为现在为了适应所有浏览器上的所有用户,需要以4种格式发布视频?如果是这样,这个HTML5视频的东西是一个史诗般的失败!

无论如何,任何想法,流程,链接到图书馆等赞赏。



谢谢 -

解决方案

这并不难。您可以为单个< video> 标记提供多个来源(以多种格式)。

 < video width =320height =240controls> 
< source src =pr6.mp4type ='video / mp4; codecs =avc1.42E01E,mp4a.40.2'>
< source src =pr6.webmtype ='video / webm; codecs =vp8,vorbis'>
< / video>

另外更好的选择是首先搜索原生html5视频,然后回到闪光灯。

您需要的两个fromat是WebM(皇家提供免费的,由Mozilla,Opera,Chrome和其他选择的briwsers支持)和H.264为大的(IE和Safari)。你的后备选项(flash)也可以播放H.264。



我建议阅读



编辑:



如果你正在寻找最常见的demoninator,那么肯定会暗示H.264 over HTTP 。 Flash可以在没有媒体服务器的情况下播放它,而且它是iOS支持的唯一格式,所以你暂时可以使用一种格式。



但即使是这样格式,您可以在两个工厂团队(Safari和IE)上支持HTML5-b播放。我知道视频标签有点新,但是它们在操作系统的基础上建立起来的。即使在这种状态下,它们也比Flash更好。因此,真正的困境毕竟是替代浏览器。你可以使用两种格式而不是一种(扔在WebM中),或者你只使用H.264,而在非h264浏览器上使用Flash。
$ b

这是一个相当个人喜好问题(和双重存储的成本)。但是现在存储空间一般都是免费的,无论如何带宽是真正的成本因素。

Looking into HTML5 video tag, and researching which browsers support which video file types, and my initial thought is things just got harder than just using flash.

I am wondering if there is some skeleton code (combined with development approach for videos) that someone has figured out to do the following:

  1. If flash is available, use it
  2. If not, try html5 video ogg format
  3. If that doesn't work, try html5 video h.264 format
  4. If that doesn't work, try html5 video webM format

Based on what I am seeing, am I correct in thinking that now, in order to accommodate all users on all browsers, a video needs to be published in 4 formats? If so, this HTML5 video thing is an epic fail!

Anyway, any ideas, processes, links to libraries, etc are appreciated.

Thanks -

解决方案

It's not that hard. You can give multiple sources (in multiple formats) for a single <video> tag.

<video width="320" height="240" controls>
  <source src="pr6.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
  <source src="pr6.webm" type='video/webm; codecs="vp8, vorbis"'>
</video>

Also the better choice is to search for native html5 video first, then fallback to flash.

The two fromats you need are WebM (royaltiy free, supported by alternative briwsers Mozilla, Opera, Chrome and others) and H.264 for the big ones (IE and Safari). Your fallback option (flash) is also able to play H.264.

I suggest reading this guide if you haven't already.

Edit:

If you're looking for the lowest common demoninator then it's surely hinted H.264 over HTTP. Flash can play it without a media server and it's the only format iOS supports anyway, so you are OK for one single format for the time being.

But even with this single format you can support HTML5-bsed playback on the two factory teams (Safari and IE). I know the video tag is kinda new but they build on solid foundations in the OS's. Even at this state they are a better option than Flash.

So the real dilemma after all is ith the alternative browsers. You can use two formats instead of one (to throw in WebM) or you only stay with H.264 and use Flash on non-h264 browsers.

This is rather a question of personal preference (and the cost of double storage). But storage is generally free these days, bandwidth is the real cost factor anyway.

这篇关于Html5视频和Flash方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆