0
votes

I have the following code:

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
    <audio controls>
        <source src="_music/mysong.mp3" type="audio/mpeg" />
        <source src="_music/mysong.ogg" type="audio/ogg" />
        Your browser does not support audio playback
    </audio>
</body>
</html>

It works fine in Chrome. When I try to play in Firefox, it does nothing and the console gives the error "All candidate resources failed to load. Media load paused."

The MIME types in IIS are set to "audio/mpeg" for .mp3 files and "video/ogg" for .ogg files.

What can I do to play audio in Firefox ?

1
Just thought I would mention that it works on the Android version of Firefox, and that I am currently using the ESR version of Firefox version 52.9.0 (64-bit).Richard Martin
possible of duplicate of stackoverflow.com/questions/8831625/… )Nisarg
I am looking into the above link. I should mention that I checked quite a few jQuery audio plugins that use HTML5 with Flash fallback, and every one of them plays no sound in FF.Richard Martin
@RichardMartin It can be caused due to caching. Check this codeproject.com/Questions/834222/…. Also, what happens if you try to access the audio file directly in firefox browser tab?Mohsin Mehmood

1 Answers

0
votes

you can use

<audio controls>
      <source src="horse.ogg" type="audio/ogg">
      <source src="horse.mp3" type="audio/mpeg">
    Your browser does not support the audio element.
</audio>

or you update the browser