Current location - Training Enrollment Network - Books and materials - How to add the online player code of background music to a webpage?
How to add the online player code of background music to a webpage?
The simplest way is

Where: add the address of the background music you want to join in "xxx", and the value in "loop" is the number of music cycles, which can be set as any positive integer. If it is set to "-1", the music will loop forever.

The other method is a little more complicated, but it can set more parameters. This time we have

& ltEMBED src = "/Home/XXX " auto start = " true " loop = " true " width = " 80 " height = " 20 " & gt;

The difference is that we can set more contents here, and the following are specific instructions:

The path of src background music.

autostart

Whether to play music automatically, "True" means to play music files immediately after reading, "False" means not to play them immediately, and the default value is "False".

Cycle number, set to "true" to loop forever, and "false" to play only once, set to the number of times any positive integer will be input circularly.

Volume Set the volume in the range of "0- 100", and the default value is the current volume of the system.

Starttime sets the time when the music starts to play. The format is "minutes: seconds", for example, starttime = "00: 10 ",which means that the music starts to play from the 10 second.

Endtime sets the time when the music ends playing. The specific format is as above.

Width Sets the width of the music playback control panel.

Height Sets the height of the music playback control panel.

Controls sets the appearance of the music playback control panel, and the "console" is a normal panel; A "mini console" is a small panel. "Play button" is whether to display the play button; "Pause button" is whether to display the pause button; "stopbutton" indicates whether to display the stop button; "volumelever" is whether to display the volume adjustment button, for example:

Controls= "Console/Mini Console/Play Button/

Pause button/stop button/volume lever.

Hidden sets whether to display the music playback control panel, with "false" indicating display and "true" indicating hiding.

Now, you can have a try. However, it should be noted that the volume of music files should not be too loud, otherwise the page will be open for a long time and the music has not been finished.

Step 1: upload your favorite music to the blog (of course, it can also be other link addresses).

Step 2: Paste all the uploaded music addresses into Notepad without adding any code.

For example:

Http:// link address

Http:// link address

Step 3: Save Notepad as: music.jpg, which is a file in picture format, and then upload it to the blog space. Remember the upload address after uploading.

Step 4: When posting, select HTML mode, and then add the following code at the bottom.

< div align = " center " > < embedded src = " music address " width = " 180 " height = " 50 " hidden = " true " type = " audio/mpeg/WMA " auto start = " true " loop = " true "/>

Tip: autostart="true "Autoplay option: true No Autoplay option: false.

Loop="true "Loop playback option: true No loop playback option: false.

Hidden="true "Hide player option: true Show player option: false