Search code examples
htmlfirefoxmp3html5-audio

Firefox does not support MP3 - workaround for a userscript / extension?


As stated in Why doesn't Firefox support the MP3 file format in <audio>, Firefox does not support MP3 for <audio>. For some reason, a third-party website does not host files other than mp3, and uses code like the below for embedding mp3 files:

<object CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
        width="1" height="1">
    <param name="URL" value="media/audio.mp3">
    <param name="autoStart" value="true">
</object>

Since my computer-illiterate client does not use Windows but Ubuntu, this obviously does not work. Now since I have no access to the files on that server, I tried to create a Greasemonkey script that replaces all of these scripts by an <audio> script, but then Firefox 12 complains that MP3 files cannot be played with <audio>. Chromium cannot play it either.

As a workaround I tried replacing it by <embed> and using the VLC plugin, but this time Firefox crashes due to a segmentation fault.

So, I am looking for a method that allows the audio from MP3 files being played in the Firefox or Chromium browser from a userscript or extension. Any ideas?


Solution

  • Honestly, audio playback is still one of the cases where (most unfortunately) Flash is a very good answer. The code for playing back audios in Flash is straight-forward, and every Flash implementation (not just Adobe's, including the FOSS alternatives available on Ubuntu) can handle it just fine.