javascript 网络AVI播放器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8111666/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 02:20:00  来源:igfitidea点击:

Web AVI Player?

javascripthtmlvideoavi

提问by Richard Hedges

I'm looking to play AVI files in a web browser however I can't seem to find a decent tool to do so.

我想在网络浏览器中播放 AVI 文件,但是我似乎找不到合适的工具来这样做。

The basic WMP object embed is what I'm using right now but it doesn't really do what I'd like it to do, and I can't really implement JavaScript into it. (AFAIK I can't. I done a little digging and that's the conclusion I came to)

基本的 WMP 对象嵌入是我现在正在使用的,但它并没有真正做到我想要它做的事情,而且我无法真正在其中实现 JavaScript。(AFAIK我不能。我做了一些挖掘,这就是我得出的结论)

I've also tried DivX though I don't really like it. It has adverts, and I've no idea if JavaScript can be included either.

我也试过 DivX,虽然我不太喜欢它。它有广告,我也不知道是否可以包含 JavaScript。

AFAIK Flash doesn't support AVI playback at all.
Does anyone know of any player at all that can play AVI files on the web, which I could possibly integrate some kind of JavaScript in (or has an API)?
Just a thought too, but would Java itself have anything like this?

AFAIK Flash 根本不支持 AVI 播放。
有谁知道任何可以在网络上播放 AVI 文件的播放器,我可能会在其中集成某种 JavaScript(或具有 API)?
也只是一个想法,但 Java 本身会有这样的东西吗?

The player also needs to be able to source the files like this:
file:\\Network-PC-Name\avi\avifile.avi

播放器还需要能够像这样获取文件:
file:\\Network-PC-Name\avi\avifile.avi

采纳答案by Kae Verens

flowplayer is recommended by this post: Flash video player for AVI files (free for commercial use)

flowplayer 这个帖子推荐: 用于AVI文件的Flash视频播放器(免费用于商业用途)

not sure about the file:\ source, as that's on your local machine and could be refused by the browser for security reasons

不确定文件:\ source,因为它在您的本地机器上,出于安全原因可能会被浏览器拒绝

回答by Jaruba

What you're looking for is WebChimera, there's no doubt about it. It has the most complex JS APIever made for web video, and it supports all file types.. it also supports "file:///" (for links like file:///C:/avi/avifile.avi).

您正在寻找的是WebChimera,毫无疑问。它拥有有史以来为网络视频制作的最复杂的 JS API,并且支持所有文件类型……它还支持“file:///”(对于像 的链接file:///C:/avi/avifile.avi)。

It is open source and has no advertising. And the best part is that everything inside the player is editable, so you can skin it, add buttons and even add entirely new features to it with mostly just JavaScript. :)

它是开源的,没有广告。最好的部分是播放器中的所有内容都是可编辑的,因此您可以使用大部分 JavaScript 为其设置外观、添加按钮甚至添加全新功能。:)

Update

更新

As you mentioned you need it to connect to file:///Network-PC-Name/avi/avifile.avi, this tells me you need this for some Local / Private / LAN use.

正如您所提到的,您需要将其连接到file:///Network-PC-Name/avi/avifile.avi,这告诉我您需要它用于某些本地/专用/局域网用途。

In this case, I think the best solution for you is to use WebChimera with Node-Webkit, as it will also give you a JS API based server environment.

在这种情况下,我认为最适合您的解决方案是将 WebChimera 与Node-Webkit一起使用,因为它还会为您提供基于 JS API 的服务器环境。

WebChimera Player is already ported to NW for Windows and Mac: https://github.com/jaruba/WebChimeraPlayerNW

WebChimera Player 已经被移植到 Windows 和 Mac 的 NW:https: //github.com/jaruba/WebChimeraPlayerNW

On Windows, just download the package, and run nw.exe. To customize just edit the html pages. For Mac, just follow the instructions in the Readme.md.

在 Windows 上,只需下载包,然后运行 ​​nw.exe。要自定义,只需编辑 html 页面。对于 Mac,只需按照 Readme.md 中的说明进行操作。

The great part about using it like this, is that it already has the plugin embedded in the app, so you won't even need to install the plugin for the player to work.

像这样使用它的好处在于它已经在应用程序中嵌入了插件,因此您甚至不需要安装插件即可让播放器工作。

The only thing I can't be fully sure of, is if Network-PC-Namecan even be accessed through the file:///protocol in it's normal usage. But this would still be possible anyway as you could map the network drive, and you can even map it programatically (with only JavaScript!) by using the child process execto run the necessary command. (child_processis built in node-webkit natively)

我唯一不能完全确定的是,是否Network-PC-Name甚至可以file:///在正常使用中通过协议访问。但是无论如何这仍然是可能的,因为您可以映射网络驱动器,您甚至可以通过使用子进程 exec运行必要的命令以编程方式(仅使用 JavaScript!)映射它。(child_process本机内置于 node-webkit 中)

回答by Master

See my answer: https://stackoverflow.com/a/41097181/3421640This is my version of js avi video player for browsers

请参阅我的答案:https: //stackoverflow.com/a/41097181/3421640这是我的浏览器 js avi 视频播放器版本