【问题标题】:mediaelement js says that webm file is damaged and can not be playedmediaelement js说webm文件损坏无法播放
【发布时间】:2014-03-19 20:01:29
【问题描述】:

我在使用 FF 中的 mediaelement js 和 webm 文件时遇到问题。我已将 mp4 视频转换为 webm 文件,并使其在我的服务器上可用。我正在使用下面的代码。

<video width="320" id="player1" height="240" controls="controls">
<source type="video/webm"   src="somefile.webm" />
<source type="video/ogg"   src="somefile.ogv" />
<source type="video/mp4" src="somefile.mp4" />
<-- there is also a flash fallback which is working fine in FF, but I've removed it here to simplify the example -->
</video>

这适用于除 Firefox 之外的所有浏览器。它告诉我文件已损坏,无法播放。但是,如果我打开 firebug 并通过选择“在新选项卡中打开”打开 webm 文件 - 视频将从我的服务器加载并正确播放 - 在 Firefox 中。

是否有其他人遇到过同样的问题并知道解决方案?我一直在搜索,但我似乎只找到了说该文件没有正确的 mime 类型的答案。我不认为这是我的情况的问题,因为当我在新标签中打开它时它在 FF 中播放得很好,而不是通过 mediaelement js 播放。

编辑:Firefox 中的响应标头,对于“损坏”的文件,显示“Content-Type video/webm”

【问题讨论】:

  • 有没有人遇到过这个问题,或者知道如何解决它?

标签: javascript jquery mediaelement.js


【解决方案1】:

似乎服务器毕竟没有设置正确的 Content-Type。我把它修好了,现在它就像一个魅力。

【讨论】:

    猜你喜欢
    • 2020-09-21
    • 2020-06-08
    • 1970-01-01
    • 2018-02-26
    • 2012-03-31
    • 1970-01-01
    • 2016-12-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多