Click to See Complete Forum and Search --> : music...


xataku_nakusute
07-28-2003, 11:31 PM
how can i make a link thatll open up a page thatll have a <select> list with a buncha <option>s and when i select one, and press play, i play the corresponding song, and when i press stop, well...it stops?

ive tried using this:

<html>
<body>
<script type="text/javascript">
sound = document.slist.stitle.value;
play = window.open("","play_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=1, height=1");
function play()
{
play = window.open("","play_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=1, height=1");
play.document.write("<html>"+"<body>"+"<bgsound src='"+sound+"'>"+</body>"+"</html>");
}
function stop()
{
play = window.open("","play_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=1, height=1");
play.document.write("<html>"+"<body>"+"<bgsound src=''>"+</body>"+"</html>");
}
</script>
<select id="slist">
<option value=song1.wav>Song 1</option>
<option value=song2.wav>Song 2</option>
<option value=song3.wav>Song 3</option>
</select>
<br>
<input type="button" onclick="play()" value="Play">

<input type="button" onclick="stop()" value="Stop">
</body>
</html>

gil davis
07-29-2003, 07:00 AM
Playing music on a web page depends on the client's configuration. If you asume that the client has Windows MediaPlayer installed with Internet Explorer and you use the correct syntax for the scripts, you can get it to play. If the client has Netscape 4 or 6, your script will be so much text. There are no standards for web pages playing music.