问题
I have this code that I'm using to play an MP3:
<p>Current Recording<br><br>
<audio controls='controls'><source src='".$rec_url."' type='audio/mp3' />
<a href='".$rec_url."'>Click to Download the Current Recording</a>
</audio></p>
I can see the Audio player in Chrome, and I can download the link in IE8. My problem is I just see a black box with an X in it on Firefox. I don't need to play it in this player in Firefox, I am aware that Firefox doesn't support the playing of MP3s.
But how do I get the link to show up?
Thanks!
UPDATE: This is what I see

回答1:
Firefox does only support ogg and wave. You can do this:
<audio controls='controls'>
<source src='".$rec_url."' type='audio/mp3' />
<source src='".$rec_ogg_url."' type='audio/ogg' />
<a href='".$rec_url."'>Click to Download the Current Recording</a>
</audio>
回答2:
I checked the error.code property of the element and then removed the entire tag and replaced it with a link if it had a value of 4.
来源:https://stackoverflow.com/questions/7492163/mp3-in-audio-tag-in-firefox