如何在 Firefox 中播放此 MP4?据我所知,Firefox 不支持 MP4

How can this MP4 be played in Firefox? From what I know Firefox doesn't support MP4

我从 Giphy 网站上找到了这个 mp4。令我惊讶的是它在 Firefox 中播放。有谁知道那是怎么回事?通常我必须为每个视频文件生成两个版本,mp4 和 webm。如果不必那样做就好了。

这是文件: http://media2.giphy.com/media/yoJC2NG0MLnSoEPjIA/giphy.mp4

如果可以使用 HTML5,我建议使用如下视频标签。我想您需要控件,所以我将 controls 属性添加到视频标签;如果需要,您还可以添加自动播放。我在 IE11 和当前版本的 Firefox 和 Chrome 上测试了它。适用于所有这些。拥有替代版本不是一个坏主意,但 mp4 在现代浏览器上非常通用。

<video controls>
      <source src="http://media2.giphy.com/media/yoJC2NG0MLnSoEPjIA/giphy.mp4" type="video/mp4">
      <source src="http://media2.giphy.com/media/yoJC2NG0MLnSoEPjIA/giphy.webm" type="video/ogg">
    Your browser does not support the video tag.
    </video>

至于原因:

MP4 H.264 (AAC or MP3) The MP4 container format with the H.264 video codec and the AAC audio codec is natively supported by desktop/mobile Internet Explorer, Safari and Chrome, but Chromium and Opera do not support the format. IE and Chrome also support the MP3 audio codec in the MP4 container, but Safari does not. Firefox/Firefox for Android/Firefox OS supports the format in some cases, but only when a third-party decoder is available, and the device hardware can handle the profile used to encode the MP4.

Note: MP4s encoded with a high profile will not run on lower end hardware, such as low end Firefox OS phones. The MPEG media formats are covered by patents, which are not freely licensed. All the necessary licenses can be bought from MPEG LA. Since H.264 is currently not a royalty free format, it is unfit for the open web platform, according to Mozilla [1, 2], Google [1, 2] and Opera. However, since royalty free formats are not supported by Internet Explorer and Safari, Mozilla has decided to support the format anyway, and Google never fulfilled their promise to remove support for it in Chrome.
Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats

Firefox 将使用一个 mp4 库是一个合适的库,它在 Firefox 运行 的系统上:

Firefox/Firefox for Android/Firefox OS supports the format in some cases, but only when a third-party decoder is available, and the device hardware can handle the profile used to encode the MP4.

source