0

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 ?

Richard Martin
  • 131
  • 1
  • 9
  • 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 Aug 15 '18 at 15:20
  • possible of duplicate of https://stackoverflow.com/questions/8831625/html5-audio-not-working-on-firefox ) – Nisarg Aug 15 '18 at 15:33
  • 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 Aug 15 '18 at 15:45
  • @RichardMartin It can be caused due to caching. Check this https://www.codeproject.com/Questions/834222/Firefox-cannot-play-streamed-mp-in-audio-tag. Also, what happens if you try to access the audio file directly in firefox browser tab? – Mohsin Mehmood Aug 15 '18 at 21:26

1 Answers1

0

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