MP3音频无法在FireFox中播放

时间:2015-11-03 07:57:59

标签: javascript firefox audio

目前我正在为我自己的网站搞一个嵌入式播放器,代码可以在下面找到。

<script type="text/javascript">
$(document).ready(function() {
$("#player4").flatie({
media: {
   mp3: "http://lynxshare.com/mp3embed-2rlcsyplnse1.mp3"
},

   swfPath: "http://www.wubstub.com/embed/js/Jplayer.swf"

});

});
</script>   
</head>
<body>
<div id="player4" class="jPlayer audioPlayer light"></div>
<div class="test"></div>
<div class="jp-no-solution" style="display: none;">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>

现在有了上面显示的代码片段,我可以让我的音频在Google浏览器上完美播放,当你使用FireFox和Waterfox这样的东西时(我不确定它是否有& #39;任何其他人都没有排除故障。)你在打游戏时听不到声音。

有人可以帮助我找到解决方案吗? View the demo here

1 个答案:

答案 0 :(得分:0)

如果您打开Firefox开发者控制台,您将看到以下错误:

  

HTTP&#34;内容类型&#34; &#34; application / octet-stream&#34;不受支持。   加载媒体资源http://lynxshare.com/mp3embed-2rlcsyplnse1.mp3   失败。

mp3文件的强效类型应为:

  

内容类型:audio / mpeg

我认为问题出在lynxshare网络服务器配置中,因此请尝试将文件上传到其他网络服务器。 我已下载您的文件并将其上传到我的服务器,尝试更改

中的URL
  

http://lynxshare.com/mp3embed-2rlcsyplnse1.mp3

  

http://radio-tochka.com/radio/audio.mp3

我的服务器提供了正确的内容类型标题,您的播放器应该在Firefox中运行。

相关问题