【问题标题】:Why is IE9 telling me it does not support audio, but it supports other audio为什么IE9告诉我它不支持音频,但它支持其他音频
【发布时间】:2011-08-13 20:07:03
【问题描述】:

我正在开发可在 Chrome 中运行但无法在 IE9 中加载的音频播放器。当我使用这段代码时,它说浏览器不支持音频。

<script>    var supportsAudio1 = !!document.createElement('audio').canPlayType;
alert(supportsAudio1);</script>

但是,也使用这种检测音频功能的方法的网站表示可以播放音频,并且该网站上的音频确实有效。谁能帮我弄清楚为什么 IE9 会这样做?

谢谢!

【问题讨论】:

    标签: javascript internet-explorer html audio internet-explorer-9


    【解决方案1】:

    Internet Explorer 仅支持 IE9 模式下的音频。确保您的标记开头有&lt;!doctype html&gt;,并且您没有按下兼容性视图按钮。 javascript:alert(document.documentMode) 可以告诉你 IE9 以哪种文档模式呈现页面。

    【讨论】:

    • 添加 修复了它。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2017-11-12
    • 1970-01-01
    • 2013-06-03
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    • 2012-04-03
    • 2012-06-20
    相关资源
    最近更新 更多