Background Music code

Source: Internet
Author: User

ToArticleInsert Flash in (I don't know if I can do it here...). I found something and wrote it down first ......
1. How to paste RM, Ra, Ram-type music,CodeAs follows:
<Embed width = "0" Height = "0" type = "audio/X-PN-RealAudio-plugin" autostart = "true" controls = "controlpanel" src = "http://guest.anyp.cn/uploads/01.rm" ;>

2. How to paste the Midi, ASF, WMA, and ASX types of music, the Code is as follows:
<Embed autostart = "true" loop = "-1" controls = "controlpanel" width = "0" Height = "0" src = "http://guest.anyp.cn/uploads/01.mid";>

You only need to copy the entire code segment to the Article (when editing the article, click the HTML code mode and then paste the Code; otherwise, the code will be displayed in text format and cannot be executed ), use the URL (URL) of your favorite and available music files to replace the red music address code shown above.

Most of the reasons that cause music to fail to be played:
A: The music file is incorrect. It is possible that this file is not a music file, but a common HTML page.
B: The music file address is incorrect. This music file does not exist.
C: No related playing software is installed.

Test method: Enter the music file address in the IE column. If you are prompted to save the file, the saved file type is RM, Ram, Midi, and other files, that is, the music file. If the file is opened and the music is automatically played or other content is displayed, no.

Add the flash with music, and then enter your flash Address in the pop-up window, note the post stamp Name: http://xxxxx.xxxx.swf, size can be adjusted to, 1*1, in this way, you can play music without displaying falsh, but remember to play it automatically. do not find the flash that needs to start.

Add an online music play code, recommended: <IFRAME marginheight = 0 src = "http://www.yqchina.com/play.htm "; frameborder = 0 noresize width = 540 scrolling = No Height = 25> place the code in a proper place on the website and play the song 24 hours a day. The code is provided by Qingfeng network radio.

The following code is provided by [Autumn wind]: First open my article, enter the editing status, select HTML format, and then enter it. Next let's look at the code. First, let's look at the first one, relatively simple:

<Bgsound src = "url" loop =-1>

"Url" is still the path name, loop indicates the number of loops, and-1 indicates that the loop is always

Let's look at the second one:

<Embed src = "music. Mid" autostart = "bool" loop = "N" width = "M" Height = "K">

The meaning of each attribute is as follows:

SRC: music file path
(Optional) autostart: automatic playback after the music file is uploaded. True indicates playback, and false indicates no.
Loop: Set "true" to "Automatic loop", "false" to "no loop", and "Number" to "count ".
Width and height are the width and height of the playback control panel,
Other attributes include:
Volume: The value ranges from 0 to 100. Set the volume. The default value is the volume of the system.
Starttime: "minute: Second", set the start time of the song, for example, starttime = "", starting from 10th seconds
Endtime: "minute: Second", set the end time of the song
Controls: Control Panel exterior controls = "console/smallconsole/playbutton/pausebutton/stopbutton/volumelever" · normal console size panel
· Small smallconsole panel
· Playbutton: display the playback button
· Pausebutton: display the pause button
· Stopbutton: displays the stop button.
· Volumelever display volume adjustment button
Hidden: If this parameter is set to true, the Panel can be hidden.

-- The following code is provided by [fengzhiwu:
Simplified background music code
1. <embed src = "den =" true "autostart =" true "loop =" true ">

-------- 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"
You can...

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

2. <embed src = "" autostart = "true" loop = "-1" controls = "controlpanel" width = "0" Height = "0">

----------- Loop = "-1" indicates infinite loop playback. You can set the number of playback times and use a specific number instead. For example, if you want it to play twice, loop = "2"

--------- Controls = "controlpanel" can be omitted

-------- Width = "0" Height = "0" indicates hiding the playback, which is the same as the previous one.
To set the appearance of the player, replace it with a specific value, for example, width = "123" Height = "100"

--------------------------------------------------
In fact, the following code is the simplest to describe the code for playing background music. --->

<Embed src = "">
-----------------------------------------------------

In addition, bgsound src = "background music path" loop = "-1">

This function only supports Internet Explorer and starts playing after the download is complete. Unlike the preceding format, it can be played while buffering. This is generally used for mid music or small MP3 or WAV music. If it is a large file, use the format mentioned above ~~
<Bgsound src = "background music path" loop = "-1"> this function is played as the browser opens. When the window is minimized, the function stops playing. When the window is maximized, the function starts playing again.
However, <embed src = "" autostart = "true" loop = "-1" controls = "controlpanel" width = "0" Height = "0"> commonly used in mid,, WAV and MP3 types of music.

This will always be played regardless of whether the window is minimized until the current window is closed ~~

Supported music file types: only supported music formats supported by the MP player, such as MP3, ASF, WMA, and ASX.
Rm, Ram ....

The video file insertion method is also the same as described above.

Music code explanation
<Embed autostart = "true" loop = "-1" controls = "controlpanel" width = "0" Height = "0" src = "http://guest.anyp.cn/uploads/01.mid">
Explanations:

Autostart = "True/false"
Whether to automatically play the music after the music file is uploaded. True is required
False indicates no, and the specified value indicates no.

Loop = "True/false/Integer"
Sets whether to automatically repeat playback. Loop = 2 indicates repeated playback twice. If you want to repeat playback for an unlimited number of times, you can use loop = "true"

Width and high = "integer"
Set the width and height of the Control Panel

Controls = "console/smallconsole/
Playbutton/pausebutton/stopbutton/
Volumelever"
Set the control panel. The default value is console.

Normal console panel
Small smallconsole panel
Playbutton only displays the play button
Pausebutton: only the pause button is displayed.
Stopbutton: only show the stop button
Volumelever only displays the volume adjustment button

Various player code http://bbs.anyp.com/BBS/ViewTopic.Aspx? Topicid = 14380 & boardid = 26 & pageno = 1

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.