html - 为什么我的 webm 文件无法在 Firefox 中播放?

标签 html firefox html5-video ogg webm

我正在使用 video.js,我尝试过使用 ogv,现在使用 webm。两者都无法在 Firefox 25 中运行。站点是 http://www.hybi.info

<video id="intro" class="video-js vjs-default-skin" width="498" height="365" 
data-setup= '{"controls":true, "autoplay": true, "preload":"auto"}'>
<source src="/images/intro.mp4" type="video/mp4">
<source src="/images/intro.webm" type="video/webm">
<source src="/images/intro.ogv" type="video/ogg">
</video>

在使用 video.js 之前我得到了

Video format or MIME type is not supported. 

在 Chrome 中运行良好。这是怎么回事?

最佳答案

已解决: 这里的问题实际上是托管帐户 - godaddy。

Godaddy 默认情况下不提供 .webm 或 .ogv/ogg,并且使用 .httaccess 不会执行任何操作。您需要创建一个 web.config 文件并添加以下代码:

<configuration>
   <system.webServer>
   <staticContent>
     <mimeMap fileExtension=".EXTENSION" mimeType="TYPE/SUBTYPE" />
   </staticContent>
 </system.webServer>
</configuration>

例如我添加:

<configuration>
 <system.webServer>
   <staticContent>
     <mimeMap fileExtension=".ogv" mimeType="video/ogg" />
     <mimeMap fileExtension=".webm" mimeType="video/webm" />
   </staticContent>
 </system.webServer>
</configuration>

来源:http://support.godaddy.com/help/article/6286/modifying-or-adding-custom-mime-types-to-windows-hosting-accounts

关于html - 为什么我的 webm 文件无法在 Firefox 中播放?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20135530/

相关文章:

javascript - 关闭模式后,Vimeo 声音继续在 Bootstrap 模式中播放

javascript - 如何检测页面并根据它修改类

javascript - 使用 JavaScript 禁用 ASP.NET 1.1 验证器 - 在 Firefox 中不起作用

jquery - Firefox css 显示问题

reactjs - 使用 react-player npm 无法在 IOS 上自动播放视频

javascript - Safari 视频元素不会在 403 响应时触发错误事件

html - 如何在加载网站上添加动线?

javascript - 在 Firefox 中将 SVG 绘制到 Canvas 时出现 InvalidStateError(适用于 Chrome)

javascript - 如何拒绝 WebRTC 来电

javascript - jqueryui.com 上的日期选择器示例不起作用