第一種方式采用wmplayer控件
<object name=wmplayer classid=CLSID:DFBFDABCCE width= height=
codebase= activex/controls/mplayer/en/nsmpinfcab# Version=
height= id=MIDIPlayer type=application/xoleobject VIEWASTEXT standby= 加載 Microsoft Windows Media Player 組件>
<param name=FileName value= >
<param name=AutoStart value=true>
<param name=AutoRewind value=>
<param name=AnimationAtStart value=false>
<param name=ShowControls value=false>
<param name=ClickToPlay value=false>
<param name=EnableContextMenu value=true>
<param name=EnablePositionControls value=false>
<param name=Balance value=>
<param name=ShowStatusBar value=false>
<param name=AutoSize value=>
<embed type=application/xmplayer
pluginspage=yer/
filename src autostart=false enablecontextmenu=false clicktopla
y=false enablepositioncontrols=false showcontrols= showstatusbar= showdisplay=>
</object>
第二種方式html標簽似乎更簡單
<bgsound id=bgsound src= loop= >
<input type=button value=停止 onclick=_stop()>
<input type=button value=開始 onclick=_start()>
<script language=JavaScript>
function _start() {
bgsoundsrc = ;
}
function _stop(){
bgsoundsrc = ;
}
</scrip>
From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25375.html