The OBJECT tag is used to embed ActiveX objects into a Web page. The following example shows how to use the OBJECT tag to insert the Windows Media Player (WMP) control.<OBJECT ID="MediaPlayer"
  CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
  TYPE="application/x-oleobject"
  WIDTH="320"
  HEIGHT="240"
  STYLE="position:absolute;
      left:50px;
      top:50px;"
>
<PARAM NAME="FileName" 
               VALUE="http://example.microsoft.com/media/sample.asf">
  <PARAM NAME="ShowControls" VALUE="1">
  <PARAM NAME="ShowStatusBar" VALUE="1">
  
</OBJECT>

解决方案 »

  1.   

    <object id="jnkcPlayer" width=280 height=240 classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
                  <param name="FileName" value="这里是MP3网址">
                  <param name="ShowControls" value="1">
                  <param name="ShowStatusBar" value="0">
                  <param name="ShowDisplay" value="0">
                  <param name="AutoStart" value="1">
                  <param name="TransparentStart" value="0">
                  <param name="AutoSize" value="1">
                </object>
      

  2.   

    谢谢两位!
    我还想问一下:
    如果想播放wav,rm,asf,avi等其他媒体文件时,又该如何写呢?
    另外,哪里有这些<object>的乱七八糟属性(如:<PARAM NAME="ShowControls" VALUE="1">
    )的说明或帮助文档?
      

  3.   

    <param name="FileName" value="http://xxxx.avi">msdn上有
      

  4.   

    最好下载个Media Player的 sdk
      

  5.   

    File like *.rm must play with other Activex Control, media play can NOT do that. If a PC had been Installed RealPlayer, the Control can be automaticlly installed by the RealPlayer Installer. In order to play real media files on web pages, we can use js to access the control.Also, using "try{...} catch(e){...}", we can detect whether the Control is installed.