HTML5视频标签无法在Firefox中播放

时间:2012-09-10 23:46:47

标签: html5 html5-video

我有一个MVC / .NET项目,我在webconfig中设置了mimetype:

<staticContent>
      <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
      <mimeMap fileExtension=".m4v" mimeType="video/m4v" />
</staticContent>

然后我将此视频标记添加到我的网页

<video width="640" height="385" controls="controls">
      <source src="/videos/sample_mpeg4.mp4" type="video/mp4" />
      <object data="/videos/sample_mpeg4.mp4" width="640" height="385">
        <embed src="movie.swf" width="640" height="385" />
      </object>
    </video> 

我在Firefox中打开此网页,但收到消息“没有支持格式的视频和找到的MIME类型”。 如果我打开http://localhost/videos/sample_mpeg4.mp4 Firefox打开下载窗口,那么这意味着视频路径正确。

我在Stackoverflow和google中进行了搜索,这使我达到了目前的状态,但现在我被卡住了。 有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:2)

Firefox在其视频代码中不支持MP4格式。主要原因是版权费附加在mp4格式上。

直接从Mozilla工作人员或以下博文中查看Media_formats_supported_by_the_audio_and_video_elements以获取更多信息:

http://pauljacobson.org/blog/2010/1/22/firefox-and-its-limited-html-5-video-support.html