熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Javascript >> 正文

網頁中播放音樂的實現方法代碼

2013-11-23 17:55:44  來源: Javascript 

  第一種方式采用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
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.