Web Bgsound background Music Code

Source: Internet
Author: User


<object id= "Aboutplayer" classid= "Clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height=150 Width=200><param Name= "Uimode" value= "None" ></OBJECT>
<table height=100 width=200 border=3 bordercolor=blue>
<tr align=center>
&LT;TD Bgcolor=white><font color=olive Size=2>smi Demo </font></td>
</tr>
<tr height=75>
&LT;TD bgcolor= "Green" ><div id=captext></div></td>
</tr>
</table>
<table width=200>
<tr>
&LT;TD align=center><input type= "button" value= "Play" onclick= "Play ()" ></td>
&LT;TD align=center><input type= "button" value= "Stop" onclick= "Stop ()" ></td>
</tr>
</table>
<script>
function Play ()
{
Aboutplayer.closedCaption.CaptioningID = "Captext";
Aboutplayer.closedCaption.SAMIFileName = "Http://lrc.aboutplayer.com/goodbye.smi";;
Aboutplayer. URL = "http://www.111cn.net/wma/g00146001/g0014600101.wma";;
Aboutplayer.controls.play ();
}
function Stop ()
{
Aboutplayer.controls.stop ();
}
</script>

The crux of the matter is the following three sentences:

Aboutplayer.closedCaption.CaptioningID = "Captext";

The location ID of the lyrics displayed on the Web page

Aboutplayer.closedCaption.SAMIFileName = Http://lrc.aboutplayer.com/goodbye.smi;

SMI Lyrics File Address

Aboutplayer. URL = http://www.111cn.net/wma/g00146001/g0014600101.wma;

Media file Address

Put in Aboutplayer.controls.play (); The front. Where the SMI file address is best to use absolute address (with the media file address is absolute, relative and change). If the media file and SMI file naming the same path, the SMI file address can be omitted not to write.

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.