BossTweed41
Technical User
I would like to know how one puts multiple music files on a site where visitors can choose the one the want to listen to. Like a juke box I guess?
Thanks, Boss
Thanks, Boss
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Title here</title>
</head>
<body>
<p align="Center">
<script language="javascript">var streams = new Array();
streams[0] = new makeStream("one.wav", "1...Song Title One");
streams[1] = new makeStream("two.wav", "2...Song Title Two");
streams[2] = new makeStream("three.wav", "3...Song Title Three");
streams[3] = new makeStream("four.wav", "4...Song Title Four");
function makeStream(url, name) {
this.url = url;
this.name = name;
}
function handleControlsOnOffClick() {
if (document.mediaPlayer.showControls == true) {
document.mediaPlayer.showControls = false;
document.playerCtrl.controls.value = " :.SHOW PLAYER.:";
}
else {
document.mediaPlayer.showControls = true;
document.playerCtrl.controls.value = " :.HIDE PLAYER.: "
}}
function handlePlayOrPauseClick(){
var state;
playerStatus = document.mediaPlayer.playState;
if (playerStatus == 6) {
document.mediaPlayer.play();
document.playerCtrl.playOrPause.value = " :.PAUSE.: ";
}
else if (playerStatus == 1) {
document.mediaPlayer.play();
document.playerCtrl.playOrPause.value = " :.PAUSE.: ";
}
else if (playerStatus == 2) {
document.mediaPlayer.pause();
document.playerCtrl.playOrPause.value = " :.PLAY.: ";
}
}
function changeSize(newSize) {
document.mediaPlayer.displaySize = newSize;
}
function change() {
var list = document.playerCtrl.streams;
var streamURL = list.options[list.selectedIndex].value;
document.mediaPlayer.stop();
document.playerCtrl.playOrPause.value = " :.PAUSE.: ";
document.mediaPlayer.fileName = streamURL;
}
</script>
<object id="mediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="[URL unfurl="true"]http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"[/URL]
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject" width="239" height="179">
<param name="fileName" value="sounds/bestieverhad.wav">
<param name="animationatStart" value="false">
<param name="transparentatStart" value="true">
<param name="autoStart" value="true">
<param name="loop" value="true">
<param name="showControls" value="false">
</object>
<form name="playerCtrl">
<input type="button" value=" :.PAUSE.: " name="playOrPause"
onclick="handlePlayOrPauseClick()" style="font-family:courier"> <input
type="button" value=" :.SHOW PLAYER.: " name="controls"
onclick="handleControlsOnOffClick()" style="font-family:courier">
<script language="javascript">
with (document) {
writeln('<select name="streams" onChange="change()">');
for (var i = 0; i < streams.length; i++) {
writeln('<option value="', streams[i].url, '">', streams[i].name);
}
writeln('</select>');
}
</script>
</form>
</p>
</body>
</html>