<html> <head> <title>音乐播放器</title> <script language="javascript"> function Play() {wmp.controls.play();} function Stop() {wmp.controls.stop();} function Pause() {wmp.controls.pause();} function setVolume(act) { currentVol = wmp.settings.volume; if (act == "up") { targetVol = currentVol + 5; if(targetVol >= 100) targetVol = 100; } else if (act == "down") { targetVol = currentVol - 5; if (targetVol <= 0) targetVol = 0;} else if(act <= 100) {targetVol = act;} wmp.settings.volume = targetVol; } </script> </head> <body> <form> <p><center><font color="red">音乐播放器</font></center></p>
<OBJECT id="wmp" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" height=70> <PARAM NAME="URL" VALUE="tada.wav"> <PARAM NAME="autoStart" VALUE="1"> <PARAM NAME="volume" VALUE="50"> </OBJECT> <input type=button value="播放" onclick="Play()"> <input type=button value="暂停" onclick="Pause()"> <input type=button value="停止" onclick="Stop()"> <input type=button value="音量+" onclick="setVolume('up')"> <input type=button value="音量-" onclick="setVolume('down')">
</form> </body> </html>
上面程序在IE打开时出错,提示为“wmp未定义”
我在注册表编辑器里查找了下键值:6BF52A52-394A-11d3-B153-00C04F79FAA6 但是注册表编辑器找不到,那个wmp是不是代表媒体播放器???
我用的是win98,在“程序——》附件——》娱乐 ”里有媒体播放器啊???