如何可靠地嵌入 wmv/mpg/avi/mov/etc 视频?
我正在尝试通过在 javascript 中创建嵌入元素来动态嵌入视频文件(wmv、mpg、avi、mov 等)。我遇到的问题是,这在所有浏览器中都不是很可靠,即使它确实有效,也不能保证最终用户拥有播放视频所需的插件。理想情况下,我会将所有内容转换为 flv 或 HTML5 视频格式,但由于 cpu/磁盘空间限制,目前这是不可能的(这些是最终用户上传的视频,而不是我)。我觉得这不应该像它所呈现的那么困难——有人有什么建议吗?
I am trying to embed video files (wmv, mpg, avi, mov, etc.) dynamically by creating embed elements in javascript. The problem I am running in to is this has not been very reliable across all browsers and even if it does work, there is no guarantee that the end user has the required plugin to play the video. Ideally, I would convert everything to flv or an HTML5 video format but this is not currently possible due to cpu/disk space restrictions (these are videos uploaded by the end user, not me). I feel like this shouldn't be as difficult as it has presented itself to be - does anyone have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
直到VLC发布浏览器插件的那一天,最好的方法是将它们转换为.FLV或.MP4文件服务器端。并使用免费的 Flash 视频播放器进行播放(我的意思是带有 Flash 回退功能的 HTML5)。
如果您不想转换这些视频,请让最终用户直接下载文件。并自行处理多种视频格式的问题。
编辑:
或者您可以将您的网站移出 HTML 浏览器,并构建一个桌面软件,该软件可以在客户端负责所有这些视频格式。
编辑2:
使用 Youtube API 或任何其他现有的视频托管服务。就我个人而言,我会避免使用这种解决方案。
To the day VLC release a browser plug-in, the best way is to convert them to .FLV or .MP4 files server side. And use a free Flash video player for the playback (I mean HTML5 with Flash fallback).
If you do not want to convert those videos, let the end user directly download the files. And deal with the problem of multiple video format himself.
edit:
Or you could move your website out of the HTML browser, and build a desktop software, that can take charge of all those videos format, client side.
edit2:
Use Youtube API or any other already existing video hosting services. Personally I will avoid this solution.
可靠地做到这一点的唯一方法是使用闪光灯。使用 ffmpeg 将传入视频转换为 .FLV 并使用 Flash 播放器。
The only way to do it reliably is with flash. Use ffmpeg to convert incoming videos to .FLV and use a flash player.