12, HTML5 hidden player play background music

Source: Internet
Author: User
HTML5 Add a page background music a customer asked to add a background music to the site, I use the HTML5 to add the page background music code, in this record later useful. HTML5 method One: <audio autoplay= "" loop= "" ><source src= "Http://mi.0w0.im/Letter_Song.mp3
></audio> does not show the player. HTML5 method Two: <video controls= "" autoplay= "" name= "Media" ><source src= "I Am Music" type= "Audio/mpeg" ></video > will display the player. Method Three: Support all players: <embed src= "/uploadfile/m.mp3" autostart= "true" loop= "true" hidden= "true" ></embed> this method I am using. Method Four: <bgsound src= background music address loop=-1> I use the code of method three, support all browsers, methods 1 and 2 are HTML5 code, and some browsers do not support HTML5 so use caution. Special attention is the use of Method 3 code, it is best to upload mp3 to their own space, online looking for the outside chain, may appear automatically download the situation.

12, HTML5 hidden player play background music

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.