HTML5 IE9 + audio tag playing sound

Source: Internet
Author: User

 


 

 

There seems to be fewer and fewer ACC encoding formats to store music, although it is better than almost all traditional encoding methods with the same specification.

I personally feel that IE has always been quite amazing, and it is indeed very personal. Other mainstream browsers support the wav encoding format, which is decisively ignored. But we can't help it either. There are too many people using it. With the trend of win7, there will be more and more users using IE9, so we still have to let him go. In addition, firefox 2.4 now supports audio files in mp3 encoding formats.

I use this label as long as it is based on its events, the requirement is to play a sequence of Audio-ordered files in order, html5 media tag onended event (when the media has reached the end of the script) it can be easily done; coding does not take long. During the test, there was no problem in chorm, firefox, and 360, but on IE, there was no sound and the sound file was not played, the onended event will certainly not be triggered. Compared with the examples in the official documentation, I did not find any difference. Then I changed the test audio file to the url on the document, and the sound was amazing, and the event was triggered completely fine. The normal operation of other browsers indicates that the audio files are okay. However, files on the google server are available while the audio files on the local server are unavailable, and the problem may occur on the local server. Find the following information on the Internet and find that there is a problem with the MP3 configuration of the tomcat extension. Find the web. xml file under conf.

Original Configuration:

 

         
  
   mp3
          
  
   audio/x-mpeg
      
 
Modify:
         
  
   mp3
          
  
   audio/mp3
      
 
In this way, the audio files on the local server can be normally run on IE (supported by other browsers ).

 

We hope that the IE browser can provide better support for HTML5 and CSS3, saving us some trouble.


 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.