【问题标题】:Firefox specific html5 video errorFirefox 特定的 html5 视频错误
【发布时间】:2015-02-12 11:00:51
【问题描述】:

使用 html5 视频播放器,我在 firefox 中收到以下错误

错误消息:找不到支持格式和 mimetype 的视频

通过测试:Chrome / Safari / IE

代码:

<video preload="metadata" controls="">
    <source type="video/mp4" src="https://subdomain.clientURL.mp4"></source>
            Your browser does not support the video t…
</video>

Http 响应 Mime 类型:

Request Method:GETStatus Code:206 Partial Content
Host: redacted.s3.amazonaws.com
Content-Length:405838
Content-Range:bytes 0-405837/405838
Content-Type:video/mp4
Server:AmazonS3

【问题讨论】:

  • 您找到解决方案了吗?我有同样的问题

标签: html firefox


【解决方案1】:

Firefox only supports mp4 if it's installed on the operating system. 由于专利问题,Firefox 未内置 MP4 支持。

【讨论】:

    【解决方案2】:

    您可以在具有不同 MIME 类型的视频标签中添加多个源路径。我已经测试过,MIME 类型“video/mp4”在另一个浏览器中工作,但在 firefox 中不起作用,因此对于 firefox,您必须将视频转换为“.ogg”格式并将其添加到相同的源位置。然后你可以像下面这样指定一个视频标签来定位不同的 MIME 类型。

    <video width="320" height="240" controls>
        <source src="abc.mp4" type="video/mp4">
        <source src="abc.ogg" type="video/ogg">
    </video>
    

    当您运行此代码时,浏览器将自动选择合适的 MIME 类型并从您的源位置获取特定视频,因此 chrome、edge 和 Internet Explorer 会考虑“abc.mp4”,而 Firefox 会考虑 abc.ogg。

    您无需安装 adobe flash player 即可在 Firefox 浏览器中播放此视频。我已经在firefox的71.0.1版本中测试过这段代码,希望能有所帮助。 快乐编码...

    【讨论】:

      猜你喜欢
      • 2011-11-11
      • 1970-01-01
      • 2011-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多