Here is the HTML:
<audio controls="controls" tabindex="0">
<source type="audio/ogg" src="/Public/audio/ding.ogg"></source>
<source type="audio/mp3" src="/Public/audio/ding.mp3"></source>
Your browser does not support the audio element.
</audio>
The player displays just fine in the latest version of Chrome (18).
Whereas in Firefox 12, the player flashes on initial page load and just fades out.
Here’s are the error messages I see when inspecting via Firebug:
HTTP “Content-Type” of “application/octet-stream” is not supported. Load of media >resource http://localhost:18214/Public/audio/ding.ogg failed.
Specified “type” of “audio/mp3” is not supported. Load of media resource /Public/audio/ding.mp3 failed.
All candidate resources failed to load. Media load paused.
How can I play an audio file in Firefox 12?
Ensure that your server sends the proper content type for the .ogg file. According to the error your server sent
application/octet-streamwhile it should beapplication/ogg(or maybeaudio/ogg).Since you are using ASP.MVC3 with IIS7, don’t forget to add the MIME type for .ogg files.
http://technet.microsoft.com/en-us/library/cc725608%28v=ws.10%29.aspx
application/oggAfter you add that MIME type, IIS will serve your .ogg files correctly and the player will work.