1. <bgsound> is used to insert background music, but only applies to IE.
<Bgsound src = "" autostart = "true" loop = "-1"/>
Parameter description:
Parameters |
Description |
Src |
Set the midi path, which can be relative or absolute. |
Autostart |
Whether to play the video automatically after the music is downloaded. True Yes, false no (default) |
Loop |
Whether to enable automatic replay. Loop = 2 indicates repeated twice, loop =-1 indicates infinite Loops |
2. <embed> is used to insert various multimedia files in the format of midi, wav, aiff, and au.
<Embed src = "" autostart = "true" loop = "true" hidden = "true"/>
Parameter description:
Parameters |
Description |
Src |
Path |
Autostart |
Whether to play the video automatically after the music is downloaded. True Yes, false no (default) |
Loop |
Whether to enable automatic replay. Loop = 2 indicates Repeat twice, true is, false is not. |
Hidden |
Whether the control screen is completely hidden. True: Yes; false: No. |
Starttime = "minute: second" |
Set the start time of the song. For example, starttime = "" indicates that playback starts from 30th seconds. |
Volume |
Set the volume. The value ranges from 0 to 100. The internal setting is the system's own setting. |
Width = "integer" and high = "integer" |
Set the height and width of the Control Panel |
Align |
Sets the alignment of the control panel and text next to it. The values can be top, bottom, center, baseline, left, right, texttop, middle, absmiddle, and absbottom. |
Controls |
Set the control panel appearance. The default value is console. Console: normal Panel; smallconsole: smaller panel; playbutton: show only the playback button; pausecutton: show only the pause button; stopbutton: show only the stop button; volumelever: only the volume adjustment button is displayed; |
Units |
Unit: pixels or en |
Name |
Object Name |
Title |
Description |
Palette |
Foreground color and background color. Syntax: palette = "color | color" |
Example 1:
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> No title page </title>
<Script language = "javascript" type = "text/javascript">
// Use javascript to control audio playback
Function ManageSoundControl (action ){
Var soundControl = document. getElementById ("soundControl ");
If (action = "play "){
SoundControl. play ();
}
If (action = "stop "){
SoundControl. stop ();
}
}
</Script>
</Head>
<Body>
<Form id = "form1" runat = "server">
& Lt; table width = "100%" & gt;
<Tr>
<Td>
<Embed id = "soundControl" src = "*. mp3" mastersound hidden = "true" loop = "false" autostart = "false"> </embed>
<Input id = "btPlay" type = "button" value = "play" onclick = "ManageSoundControl ('play')"/>
<Input id = "btStop" type = "button" value = "stop" onclick = "ManageSoundControl ('stop')"/>
</Td>
</Tr>
</Table>
</Form>
</Body>
</Html>