html - 为什么 videojs HTML5 视频在 Firefox 中无法播放声音?

标签 html ogg webm video.js

我已将 .mp4 视频转换为 .ogg 和 .webm 格式(使用 ffmpeg),并使用 videojs 创建以下网页,该网页可在所有浏览器(IE6-IE9、safari、chrome、opera、firefox)上播放视频):

http://tanguay.info/examples/testvideo

但是,Firefox (12.0) 并不总是播放音频,具体取决于页面的访问方式:

file:// 播放,使用 ogg 之前的 webm 源,Firefox 播放良好:

<source src="videos/damconnect.mp4" type='video/mp4'>
<source src="videos/damconnect.webm" type='video/webm'>
<source src="videos/damconnect.ogg" type='video/ogg'>

但是在 webm 之前从 file://ogg 源播放时,Firefox 会无音频播放:

首先使用 oggwebmhttp:// 播放,Firefox 会无音频播放。

如何让 Firefox 通过 http://播放音频?


附录:

另外:如果首先列出 oggOpera 将不会播放视频(只是旋转,不启动)。

我注意到我的 tanguay.info 服务器似乎正在发送带有 .webm 视频的文本/纯文本 header ,我该如何更改它?

enter image description here


答案:

我将此 .htaccess 文件添加到了 index.htm 所在的目录中,这解决了问题:

AddType audio/ogg oga ogg
AddType video/ogg ogv
AddType video/webm webm

最佳答案

对于 text/plain - 编辑 mime.types 文件 (~www/conf) 并添加 webm/video网络管理

您可能在使用 ogg/ogv 时遇到同样的问题,请添加 mime 类型 ogg/video ogg ogv

还要确保转换时音频编解码器正确。

编辑

Ok, I see you added it to the httpd.conf - just read this

10.5.31. TypesConfig TypesConfig names the file which sets the default list of MIME type mappings (file name extensions to content types). The default TypesConfig file is /etc/mime.types. Instead of editing /etc/mime.types, the recommended way to add MIME type mappings is to use the AddType directive.

For more information about AddType, refer to Section 10.5.54 AddType.

虽然我可以找到任何论据来解释为什么......

关于html - 为什么 videojs HTML5 视频在 Firefox 中无法播放声音?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10834621/

相关文章:

javascript - 显示可拖动 div 悬停的标签内容

audio - Web音频API-浏览器ogg与Windows Media Foundation mp3

audio - 在 Ogg/Opus 上寻找

python-3.x - Python读取声音文件,ogg还是wav?

scripting - FFMPEG 脚本将文件夹中的所有 Webm 文件转换为 Gif,然后删除那些 Webm

html5-video - Shaka 播放器做了哪些 <video> 标签单独做不到的事情?

html - CSS:根据屏幕分辨率使用不同的宽度

html - 使用 ionic.js 和 CSS 设置图标

html - 我有这个具有绝对定位的 div 和另一个宽度为 :100%. 的定位 div 为什么它不填满它的父级?

C++ ffmpeg "Starting new cluster"错误