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="http://img.xiaonei.com/photos/20060603/1510/orig51097.wma" autostart="true" loop=infinite width=0 height=0>
The link in the middle is the song link;
<EMBED src="http://whjkm.qiniudn.com/%E6%9C%80%E9%87%8D%E8%A6%81%E7%9A%84%E5%B0%8F%E4%BA%8B.mp3" 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 http://blog.csdn.net/lin_miao0818/article/details/3381851, 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 = "XXX.com/XXX.mp3" quality = high pluginspage = "www.macromedia.com/...eFlash" type = "application/x-shockwave-flash" width = "1" height = "1"> </embed>
1. mid indicates the audio file
<Embed src = "1.swf" quality = high pluginspage =" www.macromedia.com/..eflash "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