Html 如何在视频标签中播放 AVI 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6624863/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to play an AVI file in a video tag?
提问by Muffun
I'm wondering if it's possible to make a browser play a AVI file within a video
tag.
我想知道是否可以让浏览器在video
标签内播放 AVI 文件。
Everything I found on the web talking about it focus on MP4 and Ogg formats but nobody talks about the AVI format.
我在网上找到的所有谈论它的内容都集中在 MP4 和 Ogg 格式上,但没有人谈论 AVI 格式。
The only solution I found is to drop the video
tag and make the video playable using JW Player.
我找到的唯一解决方案是删除video
标签并使用 JW Player 播放视频。
回答by scumtag
Only the DivX web player can stream avi files. actually, theres a plug in for vlc to stream avi files also, but its buggy.
只有 DivX 网络播放器可以流式传输 avi 文件。实际上,vlc 也有一个插件可以流式传输 avi 文件,但是它有问题。
Sometimes it's a pain in the ass to get a solid answer. its one of the big sucks of the internet.
有时,要得到可靠的答案是一件很痛苦的事情。它是互联网的一大败笔。
<object id="ie_plugin" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616"
width="660"
height="300"
codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<param name="custommode" value="stage6" />
<param name="autoPlay" value="false" />
<param name="src" value="link-to-avi" />
<param name="bannerEnabled" value="false" />
<embed id="np_plugin" type="video/divx"
src="link-to-avi"
custommode="stage6"
width="660"
height="300"
autoPlay="false"
bannerEnabled="false"
pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>
note where it says "link-to-avi" twice :)
注意它两次说“链接到avi”的地方:)
回答by Hellon Canella Machado
Today there are excellent approaches to deal with it. One of them is the module fluent-ffmpegfound on npm.
今天有很好的方法来处理它。其中之一是在 npm 上找到的模块 fluent-ffmpeg。
It requires the previous installation of FFMPEG
它需要先前安装FFMPEG
The support of avi isn't direct. It will be necessary build a server with node to serve your html.
avi 的支持不是直接的。有必要构建一个带有节点的服务器来为您的 html 提供服务。