Html Firefox 不支持 MP4?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20061175/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MP4 not supported in Firefox?
提问by David Jones
If I paste the following URL directly into the address bar in Firefox, the video plays just fine:
如果我将以下 URL 直接粘贴到 Firefox 的地址栏中,则视频播放得很好:
http://distilleryvesper1-13.ak.instagram.com/744b42900fab11e3a34522000ae80008_101.mp4
http://distilleryvesper1-13.ak.instagram.com/744b42900fab11e3a34522000ae80008_101.mp4
However, as soon as I wrap it in HTML5 video tags (as in this Fiddle), Firefox claims that the video isn't supported:
但是,一旦我将它包装在 HTML5 视频标签中(如在这个Fiddle 中),Firefox 就会声称不支持该视频:
<video width="612" height="612" controls>
<source src="http://distilleryvesper1-13.ak.instagram.com/744b42900fab11e3a34522000ae80008_101.mp4" type="video/mp4">
</video>
I'm using Firefox version 24.0.
我正在使用 Firefox 版本 24.0。
Any ideas?
有任何想法吗?
回答by
MP4 is not supported in Firefox through the video element unless you are on Vista (since version 22), Windows 7 (since version 21) and 8, Linux (since version 24 but disabled by default until version 26) and Android (since version 17) and then only if a third-party decoder is available for it (source).
Firefox 不通过 video 元素支持 MP4,除非您使用的是 Vista(自版本 22)、Windows 7(自版本 21)和 8、Linux(自版本 24,但在版本 26 之前默认禁用)和 Android(自版本 17) ),然后仅当第三方解码器可用时(源)。
Update 1 (2014)Current plansis to also support MP4 for Mac from version 35 (released early next year),
更新 1 (2014)当前计划从 35 版(明年初发布)开始也支持 Mac 版 MP4,
Update 2 (2016)It's supported through native APIs since v35.
更新 2 (2016)自 v35 以来通过本机 API 提供支持。
Also from Mozilla Developer Network:
同样来自Mozilla 开发者网络:
Firefox supports the format on some platforms, but only when a third-party decoder is available.
Firefox 在某些平台上支持该格式,但仅当第三方解码器可用时才支持。
That it plays when you supply the link directly indicates that you have a plugin installed which is capable of showing mp4 (ie. QuickTime or something similar). This and the video element are unrelated however.
它在您直接提供链接时播放表明您安装了一个能够显示 mp4 的插件(即 QuickTime 或类似的东西)。然而,这与视频元素无关。
To get around this you can supply OGG Vorbis and/or WebM formats. You can use a free converter such as Miroto support these formats which are supported also in Firefox.
为了解决这个问题,您可以提供 OGG Vorbis 和/或 WebM 格式。您可以使用免费的转换器(例如Miro)来支持 Firefox 也支持的这些格式。
回答by greg.kindel
FYI, Firefox 35 offered up native support on OSX and Windows in early 2015. https://www.mozilla.org/en-US/firefox/35.0/releasenotes/
仅供参考,Firefox 35 在 2015 年初提供了对 OSX 和 Windows 的原生支持 。https://www.mozilla.org/en-US/firefox/35.0/releasenotes/
回答by hsivonen
You are probably on Mac and you have the QuickTime plug-in installed, so the plug-in plays the video if you navigate directly to it, but it doesn't work in the video
element, because Mac support for MP4/H.264/AAC isn't ready yet.
您可能在 Mac 上并且安装了 QuickTime 插件,因此如果您直接导航到该插件会播放视频,但它在video
元素中不起作用,因为 Mac 支持 MP4/H.264/ AAC 还没有准备好。
As of November 2013 / Firefox 26, Firefox supports MP4/H.264/AAC on Vista and newer Windows, Android and Firefox OS.
自 2013 年 11 月 / Firefox 26 起,Firefox 在 Vista 和更新的 Windows、Android 和 Firefox OS 上支持 MP4/H.264/AAC。
Your Fiddle also works on Linux when GStreamer support is enabled and encumbered codecs are installed. (GStreamer support is not yet enabled by default in e.g. builds supplied by Canonical for Ubuntu.)
当启用 GStreamer 支持并安装了受限编解码器时,您的 Fiddle 也可以在 Linux 上运行。(在 Canonical 为 Ubuntu 提供的构建中,默认情况下尚未启用 GStreamer 支持。)
回答by maestro888
you may be needing this in case you do not have support for MP4 files:
如果您不支持 MP4 文件,您可能需要它:
Windows Media Feature Pack for Windows 7 N and for Windows 7 KN:
适用于 Windows 7 N 和 Windows 7 KN 的 Windows 媒体功能包:
http://support.microsoft.com/kb/968211
http://support.microsoft.com/kb/968211
http://www.microsoft.com/en-us/download/details.aspx?id=16546
http://www.microsoft.com/en-us/download/details.aspx?id=16546
Also make sure that these prefs have the default value:
还要确保这些首选项具有默认值:
media.windows-media-foundation.enabled
media.windows-media-foundation.enabled
media.directshow.enabled
media.directshow.enabled