[cocos2d-html5 v2.1.1] Why loading .mp3 files makes Firefox load .ogg files?


#1

I have a series of .mp3 files inside a game (sound effects and music), and when I load the game in Firefox, the game insists in loading the same files, but with .ogg extension. I’m even getting this error when loading the music:

The “text/plain” HTTP “Content-Type” is not compatible. The media resource loading has failed http://[url-to-file]/tv-noise.ogg

Update: please note that all .mp3 files have their corresponding .ogg and both are present in the same directory.


#2

Because FF currently does not support mp3 and engine try to load ogg version if it exists instead of mp3. If you want to support all browsers then provide two formats ogg and mp3.
See more http://en.wikipedia.org/wiki/HTML5_Audio .


#3

Are you using IIS as server? if IIS does not recognize .ogg filetype, a 404 will be served which is in the form off “text/plain” HTTP “Content-Type”


#4

Hao Wu wrote:

Are you using IIS as server? if IIS does not recognize .ogg filetype, a 404 will be served which is in the form off “text/plain” HTTP “Content-Type”

No, in both cases we are using Apache httpd. I have yet to check content type settings, though.