5/06/2013

Liferay, MP3 and Internet Explorer

When you are using HTML5 libraries to play video and audio in Internet Explorer and you are using liferay in a tomcat to provide your mp3 files you might have noticed that, under certain circumstances, Internet Explorer refuses to play your files.
The cause of this issue might be that IE9 (and earlier) have a problem with the audio/x-mpeg content type. Tomcat uses audio/x-mpeg as standard content type for all MP3 files. To change it you need to open the web.xml file you will find under $tomcat-dir/conf .
Replace

<mime-mapping>
        <extension>mp3</extension>
        <mime-type>audio/x-mpeg</mime-type>
</mime-mapping>
with
<mime-mapping>
        <extension>mp3</extension>
        <mime-type>audio/mpeg</mime-type>
</mime-mapping>

and it should work.


If you like this tutorial it would be very nice, if you could click on some of the google ads you see on the right side. It helps me run this block and motivates me ;)

If you have any questions, feel free to leave a comment.