Musikschleife?

T

thebvbdom

Hi,

ich programmiere zurzeit eine Homepage und möchte Hintergrundmusik laufen lassen. Am Anfang wird zufällig aus einem Ordner ausgewählt, welche Datei abgespielt werden soll. Ist es dann irgendwie möglich, die nächste Datei abspielen zu lassen, wenn das Lied zu Ende ist?

Hier mal mein JavaScriptdoc:

<script language="JavaScript">
<!--
x=Math.round(17*Math.random()+1);
x=parseInt(x);
switch (x)
{
case 1:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/1.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>1.SEEED - RESPECTNESS</div>");
break;
case 2:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/2.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>2.SPORTFREUNDE SCHILLER - ANTI BUND</div>");
break;
case 3:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/3.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>3.SILBERMOND - IN ZEITEN WIE DIESEN</div>");
break;
case 4:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/4.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>4.FREUNDESKREIS - FK 10</div>");
break;
case 5:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/5.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>5.MUFF POTTER - PUNKT 9</div>");
break;
case 6:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/6.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>6.KAIN - KAFFEE ZUM MITNEHMEN</div>");
break;
case 7:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/7.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>7.WIR SIND HELDEN - PANIQUE(FRANZ: VERSION)</div>");
break;
case 8:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/8.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>8.REVOLVERHELD - ALARM</div>");
break;
case 9:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/9.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>9.CULCHA CANDELA - UNION VERDADERA</div>");
break;
case 10:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/10.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>10.DIE TOTEN HOSEN - MADELAINE</div>");
break;
case 11:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/11.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>11.DIE FANTASTISCHEN VIER - DU MICH AUCH</div>");
break;
case 12:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/12.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>12.BEATSTEAKS - E-G-O</div>");
break;
case 13:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/13.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>13.GENTLEMAN - DIFFERENT PLACES</div>");
break;
case 14:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/14.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>14.MADSEN - DU SCHREIBST GESCHICHTE</div>");
break;
case 15:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/15.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>15.VIRGINIA JETZT - ICH KANN NICHT WIE DIE ANDEREN</div>");
break;
case 16:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/16.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>16.JOY DENALANE - CHANGE</div>");
break;
case 17:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/17.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>17.DIE ÄRZTE - SCHREI NACH LIEBE (LIVE)</div>");
break;
case 18:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/18.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>18.SÖHNE MANNHEIMS - TRAURIGE LIEDER</div>");
break;
default:
document.write("<div id='ton'><embed type='audio/x-midi' autostart='true' src='musik/1.mp3' width='100' height='16' loop='true'></embed></div>");
document.write("<div id='musik'>1.SEEED - RESPECTNESS</div>");
}

//-->
</script>


Danke Schonmal im Voraus


Dom
 

Neue Beiträge

Zurück