开发者

Why is IE9 telling me it does not support audio, but it supports other audio

开发者 https://www.devze.com 2023-03-28 09:17 出处:网络
I\'m working on an audio player that works in Chrome,开发者_运维问答 but won\'t load in IE9. When I use this code it says the browser does not support audio.

I'm working on an audio player that works in Chrome,开发者_运维问答 but won't load in IE9. When I use this code it says the browser does not support audio.

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

However, sites that also use this method of detecting audio capability say audio can play, and the audio on that site does work. Can anyone help me figure out why IE9 is doing this?

Thanks!


Internet Explorer only supports audio in IE9 mode. Make sure you have <!doctype html> at the beginning of your markup and you didn't press the Compatibility View button. javascript:alert(document.documentMode) can tell you which document mode is IE9 rendering the page in.

0

精彩评论

暂无评论...
验证码 换一张
取 消