Problem with audio in web application with tomcat7 deployment

Asked

Viewed 72 times

0

Hello,

I’ve developed a web application that requires audio. I use a javascript code to control this audio call. With the application ready, I transferred to another computer deploying in tomcat7. Everything works perfectly except the audio execution and firefox returns these messages:

The "Content-Type" HTTP attribute of "audio/mpeg" is not supported. Loading the media resource http://localhost:8080/-path--/audio.mp3 failed

Unable to run media. No decoders for requested formats: audio/mpeg

I have already checked that my Ubuntu has the necessary codecs. Any audio outside the application runs perfectly and the application without deploy also runs audio.

Additional information: Use HTML, CSS and Javascript for the page. Use of Servlets in Java for connection to the Mysql database. Connection works perfectly.

Thank you in advance.

  • you can set fallback files in other formats

1 answer

0

You have already tried to configure in the application’s web.xml?

<mime-mapping>
    <extension>mp3</extension>
    <mime-type>audio/mpeg</mime-type>
</mime-mapping>
  • That didn’t work. This configuration already had it on the Tomcat web.xml and even putting it on the Servlet web.xml didn’t work. But thanks for the answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.