IE 9无法从Tomcat加载HTML5音频 [英] IE 9 has trouble loading HTML5 audio from Tomcat

查看:127
本文介绍了IE 9无法从Tomcat加载HTML5音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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.

来源: http://social.msdn.microsoft.com/Forums/pl-PL/iewebdevelopment/thread/b4f58d95-ac27-4a28-a4ae-86477ddfc74f

这篇关于IE 9无法从Tomcat加载HTML5音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆