2

I found a nice way to use the audio tag, Audio for everybody. It tries first to use the html5 player, then wmp, then flash, then an image.

Unfortunately, the mp3 format isn't supported on firefox even if it's supported by the os, and it displays an X instead of degrading to the flash player.

There's a way to let firefox ignore the html5 player?

ps: converting all my mp3s to ogg it's not an option

Magnetic_dud
  • 1,506
  • 2
  • 22
  • 36
  • Have you read this great piece on Audio? http://mir.aculo.us/2011/03/16/how-to-play-a-sound-in-a-web-browser-it-aint-easy/ – Matijs Mar 24 '11 at 21:38
  • You must be doing something wrong because the mp3 piece on that site works in Firefox for me. – Rob Mar 24 '11 at 23:08
  • are you sure it's the mp3 and not the ogg? mp3 does not work on firefox by design – Magnetic_dud Mar 26 '11 at 20:19

1 Answers1

2

I solved using this code: Quick Guide to Implementing the HTML5 Audio Tag (with Fallback to Flash)

The js code will detect lack of mp3 support in opera/firefox, hide the audio and create a flash player

edit: their solution to hide the controls does not work in my firefox, change

document.getElementsById('audio_with_controls').style.display = 'none';

with

var audio = document.getElementById("audio_with_controls");
audio.removeAttribute("controls");
Magnetic_dud
  • 1,506
  • 2
  • 22
  • 36
  • that edit code comes from here: http://stackoverflow.com/questions/5399412/html5-video-show-hide-controls-programtically – Magnetic_dud Mar 27 '11 at 18:05