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?
All Replies (14)
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
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.
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">
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.
Ezalaki modifié
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.
Ezalaki modifié
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.
Ezalaki modifié
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
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
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>
Ezalaki modifié
Note that what matters is how the server is configured to send files.
Here's an answer nobody will like. Firefox has really let me down, with so many errors and bugs - and now Version 28.0 won't play HTML5 videos from an XP platform. The easiest solution? Get Google Chrome. I am NOT a fan of Google - the company - or Chrome, but at least it plays the videos flawlessly. Which means the problem is NOT with the server, or the system. And that's the final straw. Firefox & Mozilla would never admit to making a mistake or having an 'issue.' If Firefox ever comes up with a version that will work with HTML5 (without installing 3rd party add-ons or Silverlight) let me know.
Hi Ian Millard, I replied in another thread to you, but since you are posting in multiple threads, I'll repeat myself.
Unlike proprietary browsers, Firefox does not include the patented technology to decode MPEG media. Instead, components on the system are used.
On Windows, XP is a special case. Windows Vista and later ship with Media Foundation. Microsoft does not ship Media Foundation for Windows XP, so recent versions of Firefox use DirectShow to play MPEG encoded media on Windows XP.
If you are concerned that visitors to your site will not be able to play MPEG encoded media, either because they do not have the necessary system software or because they have disabled Firefox's ability to do it (users who want to more easily download MP3s sometimes disable Firefox's built-in player), then you can provide a fallback. Either you can transcode the media to an open format, or you can add object tags and let a plugin such as QuickTime or Windows Media Player handle the MP4.
All snarky multi-thread comments aside, it looks like there is no fix for this omission. And getting a straight answer is getting more difficult.
From your reply I gather that Google (Chrome) owns the patent on MP4 codecs, because they are using it and you are not.
So I have to convert hours of video from the web standard of MP4 to webm - at an average speed of 15 minutes processing time for each minute of video. Thrilling.
And I have to junk up my page code with work-arounds and fall-backs to accommodate 20% of the market, when the whole point of using HTML5 video was to simplify coding and provide a standard that everybody could use.
I'm not surprised that I.E. doesn't work - it never does - but you guys were supposed to be on the ball.
No wonder your market share is decreasing.
Hi Ian Millard, I think I gave you a straight answer, but I have two more suggestions:
(1) This problem is solved for Windows users who have the usual components installed and enabled on their systems. Can you check whether your XP is missing any media-related updates, or if you have disabled DirectShow.
(2) Here's a third possible workaround: you could take advantage of a free hosting platform to serve users who can't or don't want to use a native HTML5 video player. For example, upload your MP4 to your Youtube channel, and Youtube will do the transcoding for you and provide a player adapted to the user's system capabilities. I think you could use a link, iframe, or embed within your <video> tag if you prefer users to play the version you host.