简体   繁体   中英

Firefox plays no M4A audio file from the internet, localhost is working

I have a strange problem and already lost several hours on it:

When I try to play any M4A audio file from a web location in Firefox I get an error message that the video format or mime type is not supported. But when I download the same M4A file an play it locally from disk in Firefox it is working.

I tried it with this file: http://techslides.com/demos/samples/sample.m4a

In Chrome and IE everything works. I use Firefox 53, 32-bit version.

Has anyone an idea how I can solve this in Firefox?

UPDATE:

I set up a test page to clarify the differences in Firefox:

http://123-bb.de/tests/audiotest

The result is interesting: The first M4A file is played without problems if called from a link directly, but doesn't play when called as Javascript Audio. The second file is the opposite.

So the question is, how can I get Firefox to set the mime type correctly when loaded as a Javascript Audio Element?

The issue with Firefox and m4a format is due to licensing. Browser is using built-in OS libraries to play the file to not pay the license fee. The m4a file to be played needs to be in mp4 container - it needs to have audio/mp4 MIME type .

The file you have linked when played from the link has - audio/mpeg . When I tried embeding it in JSFiddle firefox detect it correctly as - audio/mp4 due to server configuration. You can control the MIME type of a file but only on your server, more on that here .

I got the answer to my question from the Firefox team:

https://bugzilla.mozilla.org/show_bug.cgi?id=1362358

In short: There are 2 different ways how Firefox looks up the mime type. When the audio file is called from a Javascript audio object, Firefox ignores the mime type from the http response and detects it by sniffing into the audio file. My M4A files have a 3gpp encoding and this codec is not supported by Firefox.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM