Add music to webpages and music to webpages

Source: Internet
Author: User

Add music to webpages and music to webpages

Recently, I am tossing a Web page. For a person with obsessive-compulsive disorder, I want to insert music (as background music) into the web page, and then I have Baidu many materials; here is a summary:

Step 1:

We need to add some code on the webpage. I don't like the code that is too long. I just sorted it out. Here I added single (the Single Loop ), when I added multiple background music and the code was too long, I didn't make any effort. (In fact, I gave up a method. If I didn't make it, I gave up );

First code:

<EMBED src="" autostart="true" loop=infinite width=0 height=0>

The link in the middle is the song link;

<EMBED src="" width="0" height="0" border=0 autostart="ture" loop="true"></EMBED>

Volume indicates the Volume, and loop = infinite indicates loop playback without stopping. The following width and height are the size of the player. This Code cannot see the player.

Some code can be added in the middle;

-Hidden = "true" indicates hidden playback, that is, the appearance of the player is not displayed. to display the video, replace "true" with "false". By default, playback is minimized, if you want to display the player size, add height = "height" width = "width.
------- Autostart = "true" indicates automatic playback when the current page is loaded. If you do not want to play the video, change it to autostart = "false ";
------ Loop = "true" indicates Infinite loop Playing of music until the current page is closed. If you do not want loop Playing to be replaced by loop = "false", it will be OK;

Step 2:

Here we have already added the code, and what we need is the link of the song. Here it is also good. The song I want to add has not found the external link, I want to directly create an external chain. Baidu has many methods that are not applicable. I also thought that this is the cloud computing era. I want to save it directly through the cloud and then release the external chain, then I tried some online storage disks, which were not suitable for me. When I was engaged in the hexo blog yesterday, I saved all the images there through qiniu, then I thought about whether I could use qiniu to save the music and then release the external chain. The method is the same as that used to reference the image. I strongly recommend qiniu, the speed is also quite fast. As a cloud platform for storing some pictures and music, it is very good. Then we made the outer link of the song, and then we replaced the above Code with the outer link of the music we made ourselves. Then we can try the effect ~;

Here I refer to the content of this blog, which is also very detailed, but that add multiple methods, I did not succeed, there is to be improved; only constant exploration, in this way, we can continue to improve.

Insert music into webpages

Webpage background music code:

Insert this code into your When you open the website, you can hear the background music:
<Bgsound src = china. mid loop = "-1">
The concert disappears when the web page is minimized.

Webpage background music code:

<Embed src = "" quality = high pluginspage = "" type = "application/x-shockwave-flash" width = "1" height = "1"> </embed>
1. mid indicates the audio file
<Embed src = "1.swf" quality = high pluginspage =" "type =" application/x-shockwave-flash "width =" 1 "height =" 1 "> </embed>

The above webpage background music code can be added to the absolute address (or relative address) of the FLASH animation)

<Embed width = 1 height = 1 autostart = "true" loop = "true" controls = PlayButton console = clip1 nolabels = true type = "audio/x-pn-realaudio-plugin" src = "1.ram"> </embed>
Background Music code for a music file in ram format:
<Embed src = "1.mid" align =" center "border =" 0 "width =" 1 "height =" 1 "width =" 100 "autostart =" true "loop =" true "">
Specify the player size (width, heigh), whether it is from... the remaining full text>

How to add background music to a webpage

<Bgsound src = "Music address" loop = "-1"/>

Add the code to html to loop the music that the music address points

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: 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.