【问题标题】:Why isn't my webm file playing in firefox?为什么我的 webm 文件不能在 Firefox 中播放?
【发布时间】:2013-12-06 18:46:51
【问题描述】:

我正在使用 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 中运行良好。有什么关系?

【问题讨论】:

    标签: html firefox html5-video ogg webm


    【解决方案1】:

    已解决: 这里的问题实际上是托管帐户 - 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

    【讨论】:

      【解决方案2】:

      根据您页面的 HTML,一旦页面在 Firefox 上加载,视频元素将具有 src="/images/intro.webm"。但是,一旦我尝试访问该页面,它就会返回 404 错误。我相信视频只是丢失了,您需要将其放在图像目录中。 intro.ogv 视频也是这种情况 - 它只是丢失了。

      【讨论】:

      • 文件肯定在那里。刚刚检查了文件管理器。这与文件权限有关吗?
      猜你喜欢
      • 2012-01-29
      • 1970-01-01
      • 1970-01-01
      • 2014-07-27
      • 2012-11-07
      • 2016-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多