zoukankan      html  css  js  c++  java
  • 网页中播放音乐的实现方法代码

    第一种方式:采用wmplayer控件

    <object name="wmplayer" classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 width=0 height=0
    codebase=http://activex.microsoft.com/ activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701
    height=180 id=MIDIPlayer type=application/x-oleobject VIEWASTEXT standby=" 加载 Microsoft Windows Media Player 组件...">

    <param name="FileName" value=" http://yourURL/xxx.wma">
    <param name="AutoStart" value="true">
    <param name="AutoRewind" value="-1">
    <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="0">
    <param name="ShowStatusBar" value="false">
    <param name="AutoSize" value="0">

    <embed type="application/x-mplayer2"
    pluginspage="http:// www.microsoft.com/Windows/ Downloads /Contents/Products/MediaPlayer/"
    filename src autostart="false" enablecontextmenu="false" clicktopla
    y="false" enablepositioncontrols="false" showcontrols="0" showstatusbar="1" showdisplay="0">

    </object>

    第二种方式:html标签,似乎更简单

    <bgsound id='bgsound' src="http://yourURL/xxx.mid" loop=-1 >
      <input type="button" value="停止" onclick="_stop()">
      <input type="button" value="开始" onclick="_start()">
      <script language="JavaScript">
      function _start() {
       bgsound.src="http://yourURL/xxx.mid";
      }
      function _stop(){
       bgsound.src="";
      }
      </scrip>

  • 相关阅读:
    Delphi公用函数单元
    Delphi XE5 for Android (十一)
    Delphi XE5 for Android (十)
    Delphi XE5 for Android (九)
    Delphi XE5 for Android (八)
    Delphi XE5 for Android (七)
    Delphi XE5 for Android (五)
    Delphi XE5 for Android (四)
    Delphi XE5 for Android (三)
    Delphi XE5 for Android (二)
  • 原文地址:https://www.cnblogs.com/88223100/p/1282361.html
Copyright © 2011-2022 走看看