Fix ogg/oga not play in Firefox 3.6

Native audio support was introduced in since Firefox 3.5 . Ogg is one of the media format supported by Firefox. However, sometimes you may find it doesn’t work even if you set the right source path. And you just check the network status of audio element:

document.getElementsByTagName(“audio”)[0].networkState

Then you get the constant of a 4, which is HTMLMediaElement.NETWORK_NO_SOURCE.

This is because firefox checks the Content-Type header to make sure it’s a media file. (Webkit based browsers don’t have this restriction.) However, ogg format is not configured on most http servers. You can check the content type by:
curl -I <url-to-media-file>

Take Apache as example, you can add following content to your configuration file:
AddType audio/ogg .oga
AddType video/ogg .ogv .ogg

For more, check this article:
https://developer.mozilla.org/en/Configuring_servers_for_Ogg_media

很山寨

经常访问GNU的网站你会发现一些很神奇的东西,比如gNewSense,又比如最新的:
IceCat

怎么样,够震撼啊,GNUzilla套件里的第一个发布,IceCat。IceCat是嘛?你知道Firefox吧,那拉开冰箱门,把Firefox塞进去,带上冰箱门,嗯,那就是IceCat了。当然是开玩笑了,GNU IceCat is the GNU version of the Firefox browser. Its main advantage is an ethical one: it is entirely free software.

现在已经可以在Ubuntu中使用这个病猫,哦不,冰猫了:

sudo add-apt-repository ppa:gnuzilla-team/ppa
sudo apt-get update
sudo apt-get install icecat