X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

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

Posted

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?

Additional System Details

Installed Plug-ins

  • Next Generation Java Plug-in 10.40.2 for Mozilla browsers
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Shockwave Flash 11.8 r800
  • Adobe PDF Plug-In For Firefox and Netscape 11.0.04
  • Spoon Plugin 3.33
  • SiteAdvisor
  • Bing Bar
  • NPWLPG
  • 4.0.50401.0
  • The plug-in allows you to open and edit files using Microsoft Office applications

Application

  • Firefox 24.0
  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0
  • Support URL: https://support.mozilla.org/1/firefox/24.0/WINNT/es-ES/

Extensions

  • Adblock Plus 2.3.2 ({d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d})
  • InstantFox 2.8.3 (searchy@searchy)
  • Troubleshooter 1.1a (troubleshooter@mozilla.org)
  • Xoda Entertainment 1.5 (a00c98@wips.com)
  • Bing Bar 6.0 (msntoolbar@msn.com) (Inactive)
  • Default Manager 2.2 ({3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}) (Inactive)
  • McAfee SiteAdvisor 3.6.2 ({4ED1F68A-5463-4931-9384-8FFF5ED91D92}) (Inactive)
  • Search Helper Extension 1.0 ({27182e60-b5f3-411c-b545-b44205977502}) (Inactive)

Javascript

  • incrementalGCEnabled: True

Graphics

  • adapterDescription: Intel(R) HD Graphics
  • adapterDescription2:
  • adapterDeviceID: 0x0046
  • adapterDeviceID2:
  • adapterDrivers: igdumd64 igd10umd64 igdumdx32 igd10umd32
  • adapterDrivers2:
  • adapterRAM: Unknown
  • adapterRAM2:
  • adapterVendorID: 0x8086
  • adapterVendorID2:
  • direct2DEnabled: True
  • directWriteEnabled: True
  • directWriteVersion: 6.1.7600.16972
  • driverDate: 1-30-2013
  • driverDate2:
  • driverVersion: 8.15.10.2993
  • driverVersion2:
  • info: {u'AzureCanvasBackend': u'direct2d', u'AzureFallbackCanvasBackend': u'cairo', u'AzureContentBackend': u'direct2d'}
  • isGPU2Active: False
  • numAcceleratedWindows: 1
  • numTotalWindows: 1
  • webglRenderer: Google Inc. -- ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)
  • windowLayerManagerRemote: False
  • windowLayerManagerType: Direct3D 10

Modified Preferences

  • accessibility.typeaheadfind.flashBar: 0
  • browser.cache.disk.capacity: 25600
  • browser.cache.disk.smart_size.enabled: False
  • browser.cache.disk.smart_size.first_run: False
  • browser.cache.disk.smart_size.use_old_max: False
  • browser.cache.disk.smart_size_cached_value: 358400
  • browser.cache.memory.capacity: 40000
  • browser.places.smartBookmarksVersion: 4
  • browser.privatebrowsing.autostart: True
  • browser.startup.homepage: https://www.google.es/
  • browser.startup.homepage_override.buildID: 20130910160258
  • browser.startup.homepage_override.mstone: 24.0
  • dom.mozApps.used: True
  • extensions.lastAppVersion: 24.0
  • font.internaluseonly.changed: True
  • gfx.direct3d.last_used_feature_level_idx: 1
  • media.webaudio.enabled: True
  • network.cookie.prefsMigrated: True
  • places.database.lastMaintenance: 1381232876
  • places.history.expiration.transient_current_max_pages: 98744
  • plugin.disable_full_page_plugin_for_types: application/pdf
  • plugin.importedState: True
  • privacy.donottrackheader.enabled: True
  • privacy.sanitize.migrateFx3Prefs: True
  • storage.vacuum.last.index: 1
  • storage.vacuum.last.places.sqlite: 1380287336

Misc

  • User JS: No
  • Accessibility: No
cor-el
  • Top 10 Contributor
  • Moderator
10776 solutions 96959 answers

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

Helpful Reply

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.

cor-el
  • Top 10 Contributor
  • Moderator
10776 solutions 96959 answers

Helpful Reply

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">
jscher2000
  • Top 10 Contributor
2375 solutions 21032 answers

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.

Modified by jscher2000

Question owner

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.

Modified by DaRk_St0rM

rgj1 0 solutions 3 answers

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.

Modified by cor-el

cor-el
  • Top 10 Contributor
  • Moderator
10776 solutions 96959 answers

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
jscher2000
  • Top 10 Contributor
2375 solutions 21032 answers

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

rgj1 0 solutions 3 answers

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>

Modified by cor-el

cor-el
  • Top 10 Contributor
  • Moderator
10776 solutions 96959 answers

Note that what matters is how the server is configured to send files.

Ian Millard 0 solutions 8 answers

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.

jscher2000
  • Top 10 Contributor
2375 solutions 21032 answers

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.

Ian Millard 0 solutions 8 answers

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.

jscher2000
  • Top 10 Contributor
2375 solutions 21032 answers

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.