简体   繁体   中英

MP3 audio not playing in FireFox

currently I am messing around with an embed player for my own site the code can be found below.

<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>

Now with the snippet of code that is shown above, I am able to get my audio to play perfectly fine on a google browser how ever when you're using something such as FireFox and Waterfox (Not sure if it doesn't work on any others have not troubleshooted yet.) you can not hear the audio when hitting play.

Can someone help me out in finding a solution to this? View the demo here

If you open Firefox developer console, you will see the following error:

HTTP "Content-Type" of "application/octet-stream" is not supported. Load of media resource http://lynxshare.com/mp3embed-2rlcsyplnse1.mp3 failed.

The cotent type for mp3 files should be:

Content-Type: audio/mpeg

I think the problem is in lynxshare web server configuration, so try uploading your files somewhere to another web server. I have downloaded your file and uploaded it to my server, try changing the URL from

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

to

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

My server gives proper content-type header and your player should work in Firefox.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM