Please help, I trying to set-up a media player w/ playlist. I got the javascript part taken care of, I can't get the player to connect to the files... below is the code. tell me where I went wrong?
thanks....
thanks....
Code:
<html>
<head>
<title>Homies PlayList.</title>
<script>
var songs = new Array(
"File://Http://www.homiesworldwide.com/music/la Saporita-Jaime.mp3",
"La Saporita-Jaime Y Los Chamacos"
);
function switchSongs(i)
{
var file = songs[i * 2];
var title = songs[i * 2 + 1];
var element = document.getElementById('mysound_wrapper');
element.innerHTML = embedSound(file);
var element = document.getElementById('songtitle');
element.innerHTML = title;
var selector = document.getElementById('song_selector');
selector.selectedIndex = i;
return;
}
function embedSound(sound)
{
return '<embed src="' + sound + '" autostart="true" ' +
'width="320" height="32">';
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #000000}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style2 {
font-family: "Times New Roman", Times, serif;
font-style: italic;
color: #FFFFCC;
font-weight: bold;
font-size: 24px;
}
.style4 {
color: #FFFFCC;
font-family: "Times New Roman", Times, serif;
font-style: italic;
font-size: 18px;
}
-->
</style>
</head>
<body bgcolor="#FFFFCC" text="#800000" onLoad="switchSongs(0)">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="340" height="200" id="AutoNumber1" background="mexico.gif">
<tr>
<td height="48" align="center" background="../dgrey047.jpg"><p align="center"><span class="style2">Homies' Music </span></p>
<p align="center"></td>
</tr>
<tr>
<td height="103" align="right" background="../dgrey047.jpg">
<p align="center">
<select name="song_selector" id="song_selector"
onChange="switchSongs(selectedIndex)">
<script>
for (i = 0; (i < songs.length); i += 2) {
var file = songs[i];
var title = songs[i + 1];
document.write('<option value="' +
i + '">' +
title + '</option>\n');
}
</script>
</select></p>
<p align="center"><font face="Arial Black"><b><br>
</b></font><b><span class="style4">Now Playing</span></b></p>
<div id="mysound_wrapper" align="center">
<div align="center">
<noscript>
<span class="style1">The music player requires that you enable JavaScript in your
web browser's preferences</span>.
</noscript>
</div></td>
</tr>
</table>
</center>
</div>
</body>
</html>