скрипт для прослушивания midi файлов:
Код:
<SCRIPT LANGUAGE="JavaScript"> songNum = new Array(); songNum[0] = "#"; songNum[1] = "http://www.woweb.ru/whiskey.mid"; songNum[2] = "http://www.woweb.ru/aeroplane.mid"; songNum[3] = "http://www.woweb.ru/christina.mid"; songNum[4] = "http://www.woweb.ru/hell.mid"; var music = null; var track = 0; var ver = navigator.appName; function audioCheck(plugName) { for (var i = 0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.toLowerCase() == plugName.toLowerCase()) { for (var j = 0; j < navigator.plugins[i].length; j++) { if (navigator.plugins[i][j].enabledPlugin) { return true; } } return false; } } return false; } function chooseSong(s) { // ie track = s.options[s.selectedIndex].value; if (ver == "Microsoft Internet Explorer") { document.all.music.src = songNum[track]; } else { songPlay('play'); } } function songPlay(cmd) { // netscape if (audioCheck("LiveAudio")) { if (cmd == 'play') { document.musicSource.play(false, songNum[track]); } } else { alert("You Do Not Have The Correct Plugin"); } } // End --> </script> <!-- HEAD END HERE --> </head> <body bgcolor="#EDEDED" text="#000000" link="#000000" topmargin="0" leftmargin="0"> <center> <!-- BODY START HERE --> <form name=choose> <select size=1 name=track onChange="chooseSong(this);"> <option value="0">Click For Music</option> <option value="1">Whiskey In A Jar</option> <option value="2">Aeroplane</option> <option value="3">Genie In A Bottle</option> <option value="4">Hell</option> </select> <input type=button onMouseDown="chooseSong(document.choose.track)" value=" Play "> </form> <script language="JavaScript"> <!-- Begin var ver = navigator.appName; if (ver == "Microsoft Internet Explorer") { document.write('<bgsound src="#" ID=music loop=1 AUTOSTART=true>'); } else { document.write('<embed type="audio/midi" src="aeroplane.mid" AUTOSTART=false hidden=true VOLUME="90" name="musicSource" MASTERSOUND></EMBED>'); } // End --> </script> <p align="center"> Ê ñîæàëåíèþ Midi ôàéëîâ íåò, ïîýòîìó ñëóøàòü íå÷åãî. <p> </p> <p align="center"> </p> <div align="center"> <center> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100%"> <p align="center"><!--#exec cgi="/cgi-bin/inside/ads/ads.cgi" --> </td> </tr> </table> </center> </div>