<SCRIPT LANGUAGE="VBScript">
dim lngMP70
function Listen(str) //str是歌曲路径
On Error Resume Next
lngMP70 = IsObject(CreateObject("WMPlayer.OCX"))
lngMP70 = false
' Windows Media Player 7 Code
If (lngMP70) Then
document.write "<OBJECT ID=MediaPlayer "
document.write " CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
document.write " standby=""Loading Microsoft Windows Media Player components..."" "
document.write " TYPE=""application/x-oleobject"" width=""310"" height=""64"">"
document.write "<PARAM NAME=""url"" VALUE=""" + str+ """>"
document.write "<PARAM NAME=""AutoStart"" VALUE=""true"">"
document.write "<PARAM NAME=""ShowControls"" VALUE=""1"">"
document.write "<PARAM NAME=""uiMode"" VALUE=""full"">"
document.write "</OBJECT>"
' Windows Media Player 6.4 Code
Else
document.write "<OBJECT ID=MediaPlayer "
document.write " CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
document.write "CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
document.write " standby=""Loading Microsoft Windows Media Player components..."" "
document.write " TYPE=""application/x-oleobject"" width=""310"" height=""64"">"
document.write "<PARAM NAME=""FileName"" VALUE=""" + str+ """>"
document.write "<PARAM NAME=""ShowDisplay"" VALUE=""false"">"
document.write "<PARAM NAME=""AutoStart"" VALUE=""true"">"
document.write "<PARAM NAME=""ShowControls"" VALUE=""1"">"
document.write "<PARAM NAME=""PlayCount"" VALUE=""3"">"
document.write "<PARAM NAME=""ShowStatusBar"" VALUE=""1"">"
document.write "</OBJECT>"
End If
end function
window.focus()
call Listen(str)
</SCRIPT>