cancel
Showing results for 
Search instead for 
Did you mean: 

I can't play MP3 audio directly or with HTML5 on Firefox

Highlighted
New User

I can't play MP3 audio directly or with HTML5 on Firefox

I have a laptop with Windows 7 Home Premium x64, which I had to reinstall recently because of some hard drive problems. I used to be able to play MP3 audio files directly on Firefox, when I clicked a link to a MP3 file a new tab would open and the audio would start playing. But now I get a window asking me whether I want to open it (with Windows Media Player by default), or save it, and I can't play MP3 files with HTML5 <audio> tag, supposedly my browser doesn't support it. I've read that in Windows 7 Firefox plays both H.264 and MP3 through Media Foundation, and I can play H.264 videos without problems, so I guess it's some problem with my MP3 codecs or something, though I can play MP3 files with Windows Media Player. Also, media.windows-media-foundation.enabled is set to `true' in about:config, so it's supposed to work, but it doesn't.

What can I do?

14 REPLIES
Site Moderator

Re: I can't play MP3 audio directly or with HTML5 on Firefox

It is possible that it doesn't work in case the file is send with a wrong MIME type by the server.

Is this a problem with a direct link or with a media file that is played via an audio tag?

Both these work for me with Nightly on Linux (the current release doesn't support MP3 on Linux).
Paste the data URI code in the location bar.

data:text/html,<audio src="http://vll.csumb.edu/html/sound/u01m02ppt002t01x.mp3" controls>
http://vll.csumb.edu/html/sound/u01m02ppt002t01x.mp3
New User

Re: I can't play MP3 audio directly or with HTML5 on Firefox

Thank you for your answer. My problem is with a direct link, this one .

The data URI seemed to work but just while it's loading, when the page loads the player disappears. The direct link doesn't work at all, just like with mine, that window pops up.

Site Moderator

Re: I can't play MP3 audio directly or with HTML5 on Firefox

That is an audio/mpeg file and plays fine for me with the HTML5 media player on Linux, so I assume that this should be working on Windows as well. Are there any error visible in the Web Console (Firefox/Tools > Web Developer;Ctrl+Shift+K)?


Does this file play with the object tag in the Windows Media Player if you install (enable) this plugin?

data:text/html,<object type="application/x-mplayer2" data="http%3A%2F%2Fwww.vocacionpasionista.com%2FNovedades%2FUn%2520deseo%2520de%2520paz.mp3" width="300" height="45">
SUMO Contributor

Re: I can't play MP3 audio directly or with HTML5 on Firefox

Edit: By the time I listened to that song I forgot you already checked the preference added in Firefox 21, but maybe the new one is relevant?

On Windows, Firefox uses various operating system components to play MPEG media (due to patent issues). It's possible that you've got that disabled (some users disable it so they can more easily download MP3 files). To check:

(1) In a new tab, type or paste about:config in the address bar and press Enter. Click the button promising to be careful.

(2) In the filter box, type or paste media and pause while the list is filtered

(3) If media.windows-media-foundation.enabled is in bold type and "user set" to false, double-click to switch its value back to true. Then try reloading the tab with the MP3.

Any luck?

Also, there seems to be a new preference in Firefox 24 relating to MPEG media that are opened directly in a tab instead of embedded in a document, so check this one too: media.windows-media-foundation.play-stand-alone.

New User

Re: I can't play MP3 audio directly or with HTML5 on Firefox

When using the data URI if I open the Web Console I get (not the actual text, I translated it from Spanish):

-[10:49:47.512] The character encoding of the HTML document has not been declared. The text document will display "garbage" in some browser configurations if the document contains characters outside the US-ASCII range. The character encoding of the page should be declared in the document or in the transfer protocol. @ Data: text / html, <audio%20src="http://vll.csumb.edu/html/sound/u01m02ppt002t01x.mp3"%20controls>

-[10:49:47.513] Using getUserData () or setUserData () is deprecated. Instead, use WeakMap or element.dataset

-[10:49:47.688] GET http://vll.csumb.edu/html/sound/u01m02ppt002t01x.mp3 [HTTP/1.1 206 Partial Content]

-[10:49:48.007] The "Content-Type" HTTP "audio / mpeg" not supported. Load failed http://vll.csumb.edu/html/sound/u01m02ppt002t01x.mp3 media resource. @ Data: text / html, <audio%20src="http://vll.csumb.edu/html/sound/u01m02ppt002t01x.mp3"%20controls>

I'll try Windows Media Player later.

media.windows-media-foundation.play-stand-alone is also enabled.

I'm also having the same problem on another laptop with Win 7 Ultimate x86 and Firefox 24 too.

EDIT: It plays correctly with the Windows Media Player plugin.

A friend of mine tried it in his desktop with Windows 7 x64 and Firefox 24 too and it worked for him.I'm really confused about it.

New User

Re: I can't play MP3 audio directly or with HTML5 on Firefox

I'm reading an HTML5 book that talks about patent issues making big companies like Apple and Adobe open mp3 files, while Mozilla, an open-source group, would have to pay to open them, hence the recommendation for developers to use both the .ogg file format--supported by Firefox--and .mp3 for the same sound file on the same web page:

<audio controls>
  <source src="oksong.ogg">
  <source src="oksong.mp3">
</audio>

In spite of that, my FF v. 27.0.1 opens my mp3 files without asking anything, so maybe FF now supports the format.

Site Moderator

Re: I can't play MP3 audio directly or with HTML5 on Firefox

Yes, current Firefox releases can play MP3 files via support for Windows Media Foundation.

You can set the Boolean pref media.windows-media-foundation.enabled to false on the about:config page to disable the built-in HTML5 media player.

  • bug 799315 - Windows Media Foundation backend for media playback
SUMO Contributor

Re: I can't play MP3 audio directly or with HTML5 on Firefox

Hi rgj1, for best results, please specify a content type (type attribute) for your audio sources in your HTML. Firefox will compare with the content type header sent by the server and use the first supported stream.

https://developer.mozilla.org/en-US/docs/HTML/Supported_media_formats

New User

Re: I can't play MP3 audio directly or with HTML5 on Firefox

You're right, I copied the code from the book I'm reading, but on the page I mentioned that works with FF I used <source type="audio/mp3" src="oksong.mp3"></source>