IE 9无法从Tomcat加载HTML5音频 [英] IE 9 has trouble loading HTML5 audio from Tomcat
问题描述
我的HTML5音频播放器在IE9内部运行时,无法播放运行Apache Tomcat的服务器上的音频文件。例如,它永远不会在此路径上加载文件:
My HTML5 audio player, when running inside of IE9, has trouble playing audio files located on a server running Apache Tomcat. For example, it'll never load the file at this path:
http://www.siascend.com/repository/audios/1017_Q1.mp3
但是很开心地播放同一个文件位于@:
but happily plays the same file located @:
http:// hirebrodie .com / demo / audio / 1017_Q1.mp3
当玩家在Chrome或Safari中运行时,这两种路径都能正常工作。为什么它不能在Internet Explorer中工作?这是HTML5音频的IE实现的已知问题吗?
Either path works fine when the player runs in Chrome or Safari. Why wouldn't it work in Internet Explorer? Is this a known issue with the IE implementation of HTML5 audio?
推荐答案
Tomcat默认为.mp3扩展名指定MIME类型audio / x-mpeg。将此默认值更改为audio / mpeg解决了问题。换句话说,IE9对audio / x-mpeg不熟悉,但接受audio / mpeg作为标记资源的MIME类型。
Tomcat by default specifies for a .mp3 extension the MIME type audio/x-mpeg.Changing this default to audio/mpeg solves the issue.In other words IE9 is NOT comfortable with audio/x-mpeg but accepts audio/mpeg as MIME type of a resource for an tag.
这篇关于IE 9无法从Tomcat加载HTML5音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!