<html>
<head>
<title>
</title>
<script language=\"javascript\">
function objBrowser(){
this.Ie4=(document.all&&!document.getElementById)?1:0;
this.Ie5=(document.getElementById)?1:0;
this.Ns4=(document.layers)?1:0;
this.Ns6=(document.getElementById&&!document.all)?1:0;
this.DOM=(document.getElementById)?1:0;
}
var objBrowser = new objBrowser();
function midibox(liste) {
midfil = liste
if (objBrowser.Ns4 || objBrowser.Ns6 ) {
document.layers[\'player\'].document.open();
document.layers[\'player\'].document.write(\"<embed src=\'\" + midfil + \"\' autostart=true hidden=true volume=100 width=14 height=14 loop=false></embed>\")
document.layers[\'player\'].document.close();
}
if (objBrowser.Ie5 || objBrowser.Ie4 ) {
document.all[\'player\'].innerHTML = \"<embed src=\'\" + midfil + \"\' autostart=true hidden=true volume=100 width=14 height=14 loop=false></embed>\"
}
}
</script>
</head>
<body>
<form>
<select name=\"menu\" onChange=\"midibox(this.options[this.selectedIndex].value);\">
<option value=/>Startside
<option value=annalotte.mp3>Midi fil
<option value=arabmusic.wav>Wave fil
</select>
</form>
<div id=\"player\" style=\"position:absolute; top: 100px; left: 200px;\"></div>
</body>
</html>
Anyway ville et nok være federe at implementer Mediaplayer Direkte fremfor at \"bare\" at embedde den på siden.
Jeg begyndte lidt at eksperimentere med koden her.
<OBJECT ID=\"wmp\" WIDTH=1 HEIGHT=1 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=\"minLyd.wav\">
<PARAM NAME=\"ShowControls\" VALUE=\"0\">
<PARAM NAME=\"ShowDisplay\" VALUE=\"0\">
<PARAM NAME=\"ShowStatusBar\" VALUE=\"1\">
<PARAM NAME=\"AutoSize\" VALUE=\"1\">
<PARAM NAME=\"AutoStart\" VALUE=\"1\">
<EMBED TYPE=\"video/x-ms-asf-plugin\"
PLUGINSPAGE=\"
http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/\";;; SRC=\"minLyd.wav\";
name=\"wmp\" SHOWCONTROLS=1 SHOWDISPLAY=1 SHOWSTATUSBAR=1 autosize=1
autostart=1 width=192 height=144 displaybackcolor=black>
</EMBED>
</object>
Nu får man pludseligt helt andre muligheder for at \"lege\" med Mediaplayer og dets CallBacks.