Web page background Music code

Source: Internet
Author: User
Tags relative

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML>
<HEAD>
<TITLE> Insert Music in Web pages </TITLE>
<meta name= "generator" content= "EditPlus" >
<meta name= "Author" content= "" >
<meta name= "Keywords" content= "" >
<meta name= "Description" content= "" >
<script language=jscript>
function RunCode (obj)//To define the functions that run the code,
{
var code=obj.value;//is the code to run.
var newwin=window.open (', ', ', '); Opens a window and assigns it to the variable newwin.
Newwin.opener = NULL//Prevent code to talk about page modification
Newwin.document.write (code); Write code to this open window, which enables you to run the code function.
Newwin.document.close ();
Newwin.close ();
}
</script>
</script>
</HEAD>
<body topmargin=0>
<bgsound id= ' bgsnd ' src= ' Autostart=false >
<table border= "1" width= "100%" id= "table1" >
<tr>
<td> You can insert a music player in a Web page:</td>
<td><textarea cols= "rows=" name= "em" tabindex= "1" >
<body>
<embed src= "Yssa.mp3" width=200 height=50 type=audio/mpeg loop= "true" autostart= "true" > </embed>
Supported music formats: WMA, MP3, RM, RA, RAM, ASF, as far as possible to choose a high connectivity of the music link to ensure that music can be played smoothly; <br>
Width and height are the player widths and heights that can be set flexibly; <br>
Autostart= "True" indicates AutoPlay,<br>
Autostart= "False" indicates that;<br> is not played automatically
Loop= "true" means continuous loop playback,<br>
Loop= "false" means not looping, and the loop can also be set to an integer, such as loop= "3", which means that the music loops play 3 times;
</body>
</tr>
<tr>
<td> </td>
<td>
<p><input type= "button" value= "Run Code" name= "B3" onclick= "RunCode (Document.all.em);" ></p></td>
</tr>
<tr>
<td> You can insert a music player in a Web page:</td>
<td><textarea cols= "rows=" name= "EMB" tabindex= "2" ><body bgproperties= "fixed" bgcolor= "#000000" >
<object Classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 codebase=http://activex.microsoft.com/activex/  controls/mplayer/en/nsmp2inf.cab#version=6,4,05,0809 height=256 id=nsoplay Type=application/x-oleobject width=245  standby= "Connecting with Live Event. Please wait patiently ... ">
<param name= "Audiostream" value= "-1" >
<param name= "AutoSize" value= "-1" >
<param name= "AutoStart" value= "-1" >
<param name= "Animationatstart" value= "-1" >
<param name= "Allowscan" value= "-1" >
<param name= "Allowchangedisplaysize" value= "-1" >
<param name= "Autorewind" value= "-1" >
<param name= "Balance" value= "-1" >
<param name= "BaseURL" value= "" >
<param name= "Bufferingtime" value= "5" >
<param name= "Captioningid" value= "-1" >
<param name= "Clicktoplay" value= "-1" >
<param name= "CursorType" value= "-1" >
<param name= "currentposition" value= "-1" >
<param name= "Currentmarker" value= "-1" >
<param name= "Defaultframe" value= "Content" >
<param name= "Displaybackcolor" value= "0" >
<param name= "Displayforecolor" value= "16777215" >
<param name= "DisplayMode" value= "0" >
<param name= "Displaysize" value= "4" >
<param name= "Enabled" value= "-1" >
<param name= "Enablecontextmenu" value= "-1" >
<param name= "Enablepositioncontrols" value= "-1" >
<param name= "Enablefullscreencontrols" value= "-1" >
<param name= "Enabletracker" value= "-1" >
<param name= "Filename" value= "Yssa.mp3" >
<param name= "Invokeurls" value= "-1" >
<param name= "Language" value= "-1" >
<param name= "Mute" value= "0" >
<param name= "Playcount" value= "-1" >
<param name= "PreviewMode" value= "0" >
<param name= "Rate" value= "1" >
<param name= "Samilang" value= "" >
<param name= "Samistyle" value= "" >
<param name= "Samifilename" value= "" >
<param name= "SelectionStart" value= "-1" >
<param name= "Selectionend" value= "-1" >
<param name= "sendopenstatechangeevents" value= "-1" >
<param name= "sendwarningevents" value= "-1" >
<param name= "senderrorevents" value= "-1" >
<param name= "sendkeyboardevents" value= "0" >
<param name= "sendmouseclickevents" value= "-1" >
<param name= "sendmousemoveevents" value= "-1" >
<param name= "sendplaystatechangeevents" value= "-1" >
<param name= "showcaptioning" value= "0" >
<param name= "Showcontrols" value= "-1" >
<param name= "Showaudiocontrols" value= "-1" >
<param name= "Showdisplay" value= "-1" >
<param name= "Showgotobar" value= "0" >
<param name= "Showpositioncontrols" value= "-1" >
<param name= "ShowStatusBar" value= "-1" >
<param name= "Showtracker" value= "-1" >
<param name= "Transparentatstart" value= "-1" >
<param name= "videoborderwidth" value= "0" >
<param name= "Videobordercolor" value= "0" >
<param name= "Videoborder3d" value= "0" >
<param name= "Volume" value= " -450" >
<param name= "Windowlessvideo" value= "0" >
<embed type= "Video/x-ms-asf-plugin" pluginspage= "http://www.microsoft.com/goto/mscom/windows/mediaplayer/ Default.asp "Filename=" Yssa.mp3 "
Name= "Nsoplay"
Width= "286"
height= "172"
Defaultframe= "Content"
animationatstart= "-1"
autorewind= "-1"
autostart= "-1"
Autosize= "-1"
Controltype= "-1"
Displaysize= "6"
showaudiocontrols= "-1"
showcontrols= "-1"
showdisplay= "-1"
Showgotobar= "-1"
showpositioncontrols= "-1"
Showstatusbar= "-1"
Showtracker= "-1"
transparentatstart= "-1" >
</EMBED>
</OBJECT>
<br/>
<input onclick= "Document.all.NSOPlay.pause ()" Type=button value= "Stop" >
<input onclick= "Document.all.NSOPlay.play ()" Type=button value= "Play" >
<input onclick= "document.all.nsoplay.showstatusbar= ' 0" Type=button value= "no status bar" >
<input onclick= "Document.all.nsoplay.volume= ' -1000" "Type=button value=" reduce sound ">
<input onclick= "document.all.nsoplay.volume= ' 0" "Type=button value=" Increase sound ">
<input onclick= "Document.all.NSOPlay.Stop ();d Ocument.all.nsoplay.currentposition=0;document.all.nsoplay.play () "Type=button value=" Playback >
<input onclick= "document.all.NSOPlay.Previous ()" Type=button value= "Previous" >
<input onclick= "Document.all.NSOPlay.Next ()" Type=button value= "Next" >
<input onclick= "Document.all.NSOPlay.FastForward ()" Type=button value= "Fast Forward" >
</body>
</textarea></td>
</tr>
<tr>
<td> </td>
<td>
<p><input type= "button" value= "Run Code" name= "B3" onclick= "RunCode (DOCUMENT.ALL.EMB);" ></p></td>
</tr>
<tr>
<td> can control background music in Web pages:</td>
<td><textarea cols= "rows=" name= "BG" tabindex= "3" ><body>
<bgsound src= "A.mp3" loop=-1>
"BGSOUND" is used to insert background music, but only for IE, its parameters are not set much. As follows
<pre><bgsound src= "Your.mid" Autostart=true loop=infinite> </pre>
Src= "Your.mid"
Set MIDI files and paths that can be relative or absolute.
Autostart=true
Whether it will play automatically after the music file has been downloaded. True is, False no (default).
Loop=infinite
Whether to play it again and again automatically. loop=2 says repeat two times, Infinite means repeat several times.
<embed>:
Embed> is used to insert a variety of multimedia, format can be Midi, Wav, AIFF, AU and so on, Netscape and the new version of IE are supported. Its parameters are set more. The following
<embed src= "Your.mid" autostart= "true" loop= "true" hidden= "true" >
Src= "Your.mid"
Set MIDI files and paths that can be relative or absolute.
Autostart=true
Whether it will play automatically after the music file has been downloaded. True is, False no (default).
Loop= "true"
Whether to play it again and again automatically. loop=2 says repeat two times, true Yes, false No.
Hidden= "true"
Whether to completely hide the control screen, True is, no is no (default).
Starttime= "Minutes: Seconds"
Set the time when the song starts to play. such as starttime= "00:30" indicates that playback starts at 30th seconds.
Volume= "0-100"
Set the volume size, which is between 0 and 100. The default is to use the system itself settings.
Width= "integers" and high= "integers"
Set the height and width of the control panel. (If hidden= "no")
align= "Center"
Sets the alignment of the control panel and side text, which can be top, bottom, center, baseline, left, right, Texttop, middle, absmiddle, absbottom
Controls= "Smallconsole"
Sets the appearance of the control Panel. The preset value is the console.
Console General normal panel
Smallconsole smaller panel
PlayButton Show only play buttons
Pausecutton Only Show pause button
Stopbutton Show Stop button only
Volumelever only show volume adjustment press
</pre>
</body>
</tr>
<tr>
<td> </td>
<td>
<p><input type= "button" value= "Run Code" name= "B7" onclick= "RunCode (document.all.bg);" ><input type= "button" value= "Play background music" name= "B6" onclick= "Document.all.bgsnd.src=document.all.d1.value" > <select size= "1" name= "D1" >
<option selected value= "A.mp3" > First song </option>
<option value= "Yssa.mp3" > Second song </option>
</select><input type= "button" value= "Stop background music" name= "B5" onclick= "document.all.bgsnd.src=" "></p> </td></tr>
</table>
</BODY>
</HTML>

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.