现在哪些浏览器支持 Windows 上的 html 5 <audio> 标签?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1007223/
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
Which browsers support the html 5 <audio> tag on Windows today?
提问by BenB
Which browsers support the html 5 <audio>
tag on Windows today?
目前哪些浏览器支持<audio>
Windows 上的 html 5标签?
Edit: Trying http://moztw.org/demo/audioplayer/as a test. Chrome 2, and Safari 4 not working for me.
编辑:尝试http://moztw.org/demo/audioplayer/作为测试。Chrome 2 和 Safari 4 不适合我。
采纳答案by Anne
Safari 3.1+ and Firefox 3.5 both support the audio element. Opera 10 does notsupport the audio element though it does support an older version of it in the form of an Audio object. Chrome 3 will likely support the audio element.
Safari 3.1+ 和 Firefox 3.5 都支持音频元素。Opera 10的没有不支持的音频元素,虽然它不支持它的一个旧版本的音频对象的形式。Chrome 3 可能会支持音频元素。
(Just saw you wanted to know support for that specific page. That mostly depends on the codecs you are using I'm afraid.)
(刚刚看到您想知道对该特定页面的支持。恐怕这主要取决于您使用的编解码器。)
(Disclaimer: I work for Opera and am a member of the HTML WG.)
(免责声明:我为 Opera 工作并且是 HTML WG 的成员。)
回答by Paul Irish
if this evaluates to true:
如果这评估为真:
!!document.createElement('audio').canPlayType
, then you have audio tag support in your browser. Doing a feature detect like this is a lot better than parsing userAgent strings.
,那么您的浏览器就有了音频标签支持。像这样进行功能检测比解析 userAgent 字符串要好得多。
Alternatively, you can use something like Modernizrto handle this detect and many others for you.
或者,您可以使用Modernizr 之类的工具来处理此检测以及其他许多检测。
回答by Tom Gullen
Our blog post.
我们的博客文章。
Contains more up to date information on modern browser support for HTML5 audio.
包含有关现代浏览器对 HTML5 音频的支持的更多最新信息。
As of July 2011
截至 2011 年 7 月
IE9
IE9
Supports MP3 and AAC
支持 MP3 和 AAC
Firefox 5
火狐 5
Supports Ogg and Wav
支持 Ogg 和 Wav
Chrome 12
铬 12
Supports Ogg, MP3, Wav and AAC
支持 Ogg、MP3、Wav 和 AAC
Safari 5
野生动物园 5
Supports MP3, AAC and WAV
支持 MP3、AAC 和 WAV
Opera 11
歌剧11
Supports Ogg and Wav
支持 Ogg 和 Wav
As you can see from the data above and from reading the blog post, it's a bit of a frustrating situation as there isn't one audio format supported by all browsers. There's no immediate sign of any resolution yet either.
从上面的数据和阅读博客文章可以看出,这种情况有点令人沮丧,因为并非所有浏览器都支持一种音频格式。目前也没有任何解决方案的直接迹象。
回答by Helephant
I put together a list of when the browsersstarted supporting the audio tag and which audio formats they support.
我整理了一份浏览器何时开始支持音频标签以及它们支持哪些音频格式的列表。
The support is pretty good now. Since IE9, the latest versions of all the desktop browsers and most the mobile browsers support the audio tag. The only reason not to use it, would be to support old versions of IE, but you can always provide a fallback if that's important.
现在的支持非常好。从 IE9 开始,所有桌面浏览器和大多数移动浏览器的最新版本都支持音频标签。不使用它的唯一原因是支持旧版本的 IE,但如果这很重要,您始终可以提供后备。
Here are the details for desktop browsers:
以下是桌面浏览器的详细信息:
+---------+-------------------------+----------------------------------+
| Browser | Supported since version | Formats |
+---------+-------------------------+----------------------------------+
| IE | 9.0 | AAC or .mp3 |
| Firefox | 3.5 | .ogg, .wav |
| Chrome | 3 | .mp3, .ogg |
| Safari | 4 | Any audio supported by Quicktime |
| Opera | 9.5 | .ogg, .wav |
+---------+-------------------------+----------------------------------+
Here are the details for mobile browsers (no format information, sorry):
以下是移动浏览器的详细信息(没有格式信息,抱歉):
+--------------+-------------------------+
| Browser | Supported since version |
+--------------+-------------------------+
| iOS Safari | 4 |
| Opera mobile | 10 |
| Opera mini | no support (Dec 2011) |
| Android | 2.3 |
| Blackberry | 6 |
+--------------+-------------------------+
If you want to use the audio, it's important to provide both .ogg and .mp3 versions of the fileto get good cross browser support.
如果您想使用音频,重要的是提供 .ogg 和 .mp3 版本的文件以获得良好的跨浏览器支持。
<audio controls>
<source src="/my-podcast.mp3" />
<source src="/my-podcast.ogg" />
</audio>
回答by Jon Tackabury
回答by goibhniu
For Safari to support audio on Windows, Quicktime needs to be installed. The javascript snippet reports correctly if it's supported or not.
要使 Safari 在 Windows 上支持音频,需要安装 Quicktime。javascript 代码段会正确报告是否受支持。
回答by Brandon Lewis
All of these browsers support the functionality of the tag. The reason your player does not work on Safari is because you are using OGG files. OGG is supported on Firefox and Chrome.
Firefox supports only WAV and OGG.
Chrome supports everything.
Opera supports only WAV.
Safari supports everything but OGG.
所有这些浏览器都支持标签的功能。您的播放器无法在 Safari 上运行的原因是您使用的是 OGG 文件。Firefox 和 Chrome 支持 OGG。
Firefox 仅支持 WAV 和 OGG。Chrome 支持一切。Opera 仅支持 WAV。Safari 支持除 OGG 之外的所有内容。
Good luck!
祝你好运!
回答by Stephen
Gecko, Webkit and Presto engines are suppose to support it, but I think only partly. So Firefox 3.5 and Opera are your best bet.
Gecko、Webkit 和 Presto 引擎应该支持它,但我认为只是部分支持。所以 Firefox 3.5 和 Opera 是你最好的选择。
回答by Thomas Broyer
The page (moztw.org/demo/audioplayer) works OK in Chrome 3 (dev channel)
该页面 (moztw.org/demo/audioplayer) 在 Chrome 3(开发频道)中运行正常
回答by red777
opera 10 and ff 3.5 , don't know about safari
歌剧 10 和 ff 3.5 ,不知道野生动物园