I have made a music player in a pop up with JavaScript. It uses frames to write the object into an unseen page.
Here's an example of the page the user first sees.
[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>User Page</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript" src="songPlayer .js"></script>
<style type="text/css">
* {
margin:0;
padding:0;
color:#fff;
background-color:#000;
}
input {
color:#fff;
background-color:#000;
}
</style>
</head>
<body>
<p>
<input type="button" onclick="songPl ayer()" value="Music Player" />
</p>
</body>
</html>
[/HTML]
Here's the script that makes the pop up.
[CODE=javascript]
function songPlayer() {
var openPage=window .open("songPlay er.html", "Music_Play er", "height=410,wid th=300");
openPage.focus( );
}
[/CODE]
Here's the page that it opens.
[HTML] <html>
<head>
<title>Music Player</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<frameset rows="0%, 40%, 60%" border="0">
<frame src="musicPlaye r.html" name="musicPlay er" />
<frame src="musicPage. html" name="musicPage " />
<frame src="album.html " name="album" />
</frameset>
</head>
</html>
[/HTML]
musicPlayer.htm l is what the script will be writing the object tag onto. album.html is what the script will be writing the album picture, and the name of the song playing onto.
Here's is musicPage.html it's the page that the user will type the song they want to hear into, and it's where the next song, and previous song buttons are.
[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Music Player</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript" src="music.js"> </script>
<style type="text/css">
* {
margin-top:15px;
padding:0;
color:#fff;
background-color:#000;
}
input {
color:#fff;
background-color:#000;
}
#musicPlayer {
text-align:center;
}
</style>
</head>
<body>
<div id="musicPlayer ">
<p>
<input type="text" id="txtSong" />
<input type="button" onclick="txtPla y()" id="play" value="Play" />
<br /><br />
<input type="button" onclick="playPr eviousSong()" id="previousSon g" value="Previous Song" />
<input type="button" onclick="playNe xtSong()" id="nextSong" value="Next Song" />
<br /><br />
</p>
</div>
</body>
</html>
[/HTML]
Now for the fun part. music.js. I used my favorite band for the test run.
code is the variable for the hidden music player, and code2 is for the album photo and name, along with the song title.
So finaly here is my question, is there any way to shorten this? The coding was easy but even with using copy and paste it took me 1 hour and 43 minutes (I timed myself I was really bored). That's way to much work.
Furthermore just to get this out of the way. My user are not expecting a pause/stop button. Also, I will get permision before using any songs, photos, whatever before adding it any where on the site.
Thanks for any help, Death
I couldn't include the music file, but everything else is there.
Here's an example of the page the user first sees.
[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>User Page</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript" src="songPlayer .js"></script>
<style type="text/css">
* {
margin:0;
padding:0;
color:#fff;
background-color:#000;
}
input {
color:#fff;
background-color:#000;
}
</style>
</head>
<body>
<p>
<input type="button" onclick="songPl ayer()" value="Music Player" />
</p>
</body>
</html>
[/HTML]
Here's the script that makes the pop up.
[CODE=javascript]
function songPlayer() {
var openPage=window .open("songPlay er.html", "Music_Play er", "height=410,wid th=300");
openPage.focus( );
}
[/CODE]
Here's the page that it opens.
[HTML] <html>
<head>
<title>Music Player</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<frameset rows="0%, 40%, 60%" border="0">
<frame src="musicPlaye r.html" name="musicPlay er" />
<frame src="musicPage. html" name="musicPage " />
<frame src="album.html " name="album" />
</frameset>
</head>
</html>
[/HTML]
musicPlayer.htm l is what the script will be writing the object tag onto. album.html is what the script will be writing the album picture, and the name of the song playing onto.
Here's is musicPage.html it's the page that the user will type the song they want to hear into, and it's where the next song, and previous song buttons are.
[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Music Player</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript" src="music.js"> </script>
<style type="text/css">
* {
margin-top:15px;
padding:0;
color:#fff;
background-color:#000;
}
input {
color:#fff;
background-color:#000;
}
#musicPlayer {
text-align:center;
}
</style>
</head>
<body>
<div id="musicPlayer ">
<p>
<input type="text" id="txtSong" />
<input type="button" onclick="txtPla y()" id="play" value="Play" />
<br /><br />
<input type="button" onclick="playPr eviousSong()" id="previousSon g" value="Previous Song" />
<input type="button" onclick="playNe xtSong()" id="nextSong" value="Next Song" />
<br /><br />
</p>
</div>
</body>
</html>
[/HTML]
Now for the fun part. music.js. I used my favorite band for the test run.
Code:
/*The Black Parade Album*/ var TBP01; TBP01="Music/My Chemical Romance/The Black Parade/01 The End.wma"; var TBP02; TBP02="Music/My Chemical Romance/The Black Parade/02 Dead!.wma"; var TBP; TBP03="Music/My Chemical Romance/The Black Parade/03 This Is How I Disappear.wma"; var TBP04; TBP04="Music/My Chemical Romance/The Black Parade/04 The Sharpest Lives.wma"; var TBP05; TBP05="Music/My Chemical Romance/The Black Parade/05 Welcome to the Black Parade.wma"; var TBP06; TBP06="Music/My Chemical Romance/The Black Parade/06 I Dont Love You.wma"; var TBP07; TBP07="Music/My Chemical Romance/The Black Parade/07 House of Wolves.wma"; var TBP08; TBP08="Music/My Chemical Romance/The Black Parade/08 Cancer.wma"; var TBP09; TBP09="Music/My Chemical Romance/The Black Parade/09 Mama.wma"; var TBP10; TBP10="Music/My Chemical Romance/The Black Parade/10 Sleep.wma"; var TBP11; TBP11="Music/My Chemical Romance/The Black Parade/11 Teenagers.wma"; var TBP12; TBP12="Music/My Chemical Romance/The Black Parade/12 Disenchanted.wma"; var TBP13; TBP13="Music/My Chemical Romance/The Black Parade/13 Famous Last Words.wma"; var TBP14; TBP14="Music/My Chemical Romance/The Black Parade/14 Blood.wma"; /*Three Cheers For Sweet Revenge*/ var TCFSR01; TCFSR01="Music/My Chemical Romance/Three Cheers For Sweet Revenge/01 Helena.wma"; var TCFSR02; TCFSR02="Music/My Chemical Romance/Three Cheers For Sweet Revenge/02 Give Em Hell Kid.wma"; var TCFSR03; TCFSR03="Music/My Chemical Romance/Three Cheers For Sweet Revenge/03 To the End.wma"; var TCFSR04; TCFSR04="Music/My Chemical Romance/Three Cheers For Sweet Revenge/04 You Know What They Do to Guys Like Us in Prison.wma"; var TCFSR05; TCFSR05="Music/My Chemical Romance/Three Cheers For Sweet Revenge/05 Im Not Okay I Promise.wma"; var TCFSR06; TCFSR06="Music/My Chemical Romance/Three Cheers For Sweet Revenge/06 The Ghost of You.wma"; var TCFSR07; TCFSR07="Music/My Chemical Romance/Three Cheers For Sweet Revenge/07 The Jetset Life Is Gonna Kill You.wma"; var TCFSR08; TCFSR08="Music/My Chemical Romance/Three Cheers For Sweet Revenge/08 Interlude.wma"; var TCFSR09; TCFSR09="Music/My Chemical Romance/Three Cheers For Sweet Revenge/09 Thank You for the Venom.wma"; var TCFSR10; TCFSR10="Music/My Chemical Romance/Three Cheers For Sweet Revenge/10 Hang Em High.wma"; var TCFSR11; TCFSR11="Music/My Chemical Romance/Three Cheers For Sweet Revenge/11 Its Not a Fashion Statement Its a Deathwish.wma"; var TCFSR12; TCFSR12="Music/My Chemical Romance/Three Cheers For Sweet Revenge/12 Cemetery Drive.wma"; var TCFSR13; TCFSR13="Music/My Chemical Romance/Three Cheers For Sweet Revenge/13 I Never Told You What I Do for a Living.wma"; /*Album Pictures*/ var TBP; TBP="<img src='Music/My Chemical Romance/The Black Parade/Folder.jpg' alt='The Black Parade' />"; var TCFWR; TCFSR="<img src='Music/My Chemical Romance/Three Cheers For Sweet Revenge/Folder.jpg' alt='Three Cheers For Sweet Revenge' />";
Code:
function clear() {
document.getElementById("txtSong").value="";
}
var code;
var code2;
var song;
var currentSong;
function txtPlay () {
code="<html>";
code+="<body>";
code+="<object classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95'>";
code+="<param name='FileName' value='";
code2="<html>";
code2+="<head>";
code2+="<style type='text/css'>";
code2+="* { background-color:#000; color:#fff; margin:0; text-align:center; font-size:small; }";
code2+="</style>";
code2+="</head>";
code2+="<body>";
code2+="<p>";
song=document.getElementById("txtSong").value;
if (song == "the end") {
code+=TBP01;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-The End";
currentSong="tbp01";
clear();
} else if (song == "dead") {
code+=TBP02;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Dead!";
currentSong="tbp02";
clear();
} else if (song == "this is how I disappear") {
code+=TBP03;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-This Is How I Disappear";
currentSong="tbp03";
clear();
} else if (song == "the sharpest lives") {
code+=TBP04;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-The Sharpest Lives";
currentSong="tbp04";
clear();
} else if (song == "welcome to the black parade") {
code+=TBP05;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Welcome to the Black Parade";
currentSong="tbp05";
clear();
} else if (song == "I dont love you") {
code+=TBP06;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-I Dont Love You";
currentSong="tbp06";
clear();
} else if (song == "house of wolves") {
code+=TBP07;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-House Of Wolves";
currentSong="tbp07";
clear();
} else if (song == "cancer") {
code+=TBP08;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Cancer";
currentSong="tbp08";
clear();
} else if (song == "mama") {
code+=TBP09;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Mama";
currentSong="tbp09";
clear();
} else if (song == "sleep") {
code+=TBP10;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Sleep";
currentSong="tbp10";
clear();
} else if (song == "teenagers") {
code+=TBP11;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Teenagers";
currentSong="tbp11";
clear();
} else if (song == "disenchanted") {
code+=TBP12;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Disenchanted";
currentSong="tbp12";
clear();
} else if (song == "famous last words") {
code+=TBP13;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Famous Last Words";
currentSong="tbp13";
clear();
} else if (song == "blood") {
code+=TBP14;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Blood";
currentSong="tbp14";
clear();
} else if (song == "helena") {
code+=TCFSR01;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Helena";
currentSong="tcfsr01";
clear();
} else if (song == "give em hell kid") {
code+=TCFSR02;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Give Em Hell Kid";
currentSong="tcfsr02";
clear();
} else if (song == "to the end") {
code+=TCFSR03;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-To The End";
currentSong="tcfsr03";
clear();
} else if (song == "you know what they do to guys like us in prison") {
code+=TCFSR04;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-You Know What They Do To Guys Like Us In Prison";
currentSong="tcfsr04";
clear();
} else if (song == "im not okay") {
code+=TCFSR05;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Im Not Okay"
currentSong="tcfsr05";
clear();
} else if (song == "the ghost of you") {
code+=TCFSR06;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-The Ghost Of You";
currentSong="tcfsr06";
clear();
} else if (song == "the jetset life is gonna kill you") {
code+=TCFSR07;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-The Jetset Life Is Gonna Kill You";
currentSong="tcfsr07";
clear();
} else if (song == "interlude") {
code+=TCFSR08;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Interlude";
currentSong="tcfsr08";
clear();
} else if (song == "thank you for the venom") {
code+=TCFSR09;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Thank You For The Venom";
currentSong="tcfsr09";
clear();
} else if (song == "hang em high") {
code+=TCFSR10;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Hang Em High";
currentSong="tcfsr10";
clear();
} else if (song == "its not a fashion statement its a deathwish") {
code+=TCFSR11;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Its Not A Fashion Statement Its A DeathWish";
currentSong="tcfsr11";
clear();
} else if (song == "cemetery drive") {
code+=TCFSR12;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Cemetery Drive";
currentSong="tcfsr12";
clear();
} else if (song == "I never told you what I do for a living") {
code+=TCFSR13;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-I Never Told You What I Do For A Living";
currentSong="tcfsr13";
clear();
} else {
alert("ERROR!");
}
code+="' />";
code+="</object>";
code+="</body>";
code+="</html>";
code2+="</p>";
code2+="</body>";
code2+="</html>";
var doc;
doc=window.parent.musicPlayer.document;
doc.open();
doc.write(code);
doc.close();
var doc2;
doc2=window.parent.album.document;
doc2.open();
doc2.write(code2);
doc2.close();
}
Code:
function playPreviousSong() {
code="";
code="<html>";
code+="<body>";
code+="<object classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95'>";
code+="<param name='FileName' value='";
code2="";
code2+="<html>";
code2+="<head>";
code2+="<style type='text/css'>";
code2+="* { background-color:#000; color:#fff; margin:0; text-align:center; font-size:small; }";
code2+="</style>";
code2+="</head>";
code2+="<body>";
code2+="<p>";
if (currentSong == "tbp01") {
code+=TBP01;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-The End";
currentSong="";
currentSong="tbp01";
} else if (currentSong == "tbp02") {
code+=TBP01;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-The End";
currentSong="";
currentSong="tbp01";
} else if (currentSong == "tbp03") {
code+=TBP02;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Dead!";
currentSong="";
currentSong="tbp02";
} else if (currentSong == "tbp04") {
code+=TBP03;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-This Is How I Disappear";
currentSong="";
currentSong="tbp03";
} else if (currentSong == "tbp05") {
code+=TBP04;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-The Sharpest Lives";
currentSong="";
currentSong="tbp04";
} else if (currentSong == "tbp06") {
code+=TBP05;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Welcome to the Black Parade";
currentSong="";
currentSong="tbp05";
} else if (currentSong == "tbp07") {
code+=TBP06;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-I Dont Love You";
currentSong="";
currentSong="tbp06";
} else if (currentSong == "tbp08") {
code+=TBP07;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-House Of Wolves";
currentSong="";
currentSong="tbp07";
} else if (currentSong == "tbp09") {
code+=TBP08;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Cancer";
currentSong="";
currentSong="tbp08";
} else if (currentSong == "tbp10") {
code+=TBP09;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Mama";
currentSong="";
currentSong="tbp09";
} else if (currentSong == "tbp11") {
code+=TBP10;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Sleep";
currentSong="";
currentSong="tbp10";
} else if (currentSong == "tbp12") {
code+=TBP11;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Teenagers";
currentSong="";
currentSong="tbp11";
} else if (currentSong == "tbp13") {
code+=TBP12;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Disenchanted";
currentSong="";
currentSong="tbp12";
} else if (currentSong == "tbp14") {
code+=TBP13;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Famous Last Words";
currentSong="";
currentSong="tbp13";
} else if (currentSong == "tcfsr01") {
code+=TCFSR01;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Helena";
currentSong="";
currentSong="tcfsr01";
} else if (currentSong == "tcfsr02") {
code+=TCFSR01;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Helena";
currentSong="";
currentSong="tcfsr01";
} else if (currentSong == "tcfsr03") {
code+=TCFSR02;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Give Em Hell Kid";
currentSong="";
currentSong="tcfsr02";
} else if (currentSong == "tcfsr04") {
code+=TCFSR03;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-To The End";
currentSong="";
currentSong="tcfsr03";
} else if (currentSong == "tcfsr05") {
code+=TCFSR04;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-You Know What They Do To Guys Like Us In Prison";
currentSong="";
currentSong="tcfsr04";
} else if (currentSong == "tcfsr06") {
code+=TCFSR05;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Im Not Okay";
currentSong="";
currentSong="tcfsr05";
} else if (currentSong == "tcfsr07") {
code+=TCFSR06;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-The Ghost Of You";
currentSong="";
currentSong="tcfsr06";
} else if (currentSong == "tcfsr08") {
code+=TCFSR07;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-The Jetset Life Is Gonna Kill You";
currentSong="";
currentSong="tcfsr07";
} else if (currentSong == "tcfsr09") {
code+=TCFSR08;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Interlude";
currentSong="";
currentSong="tcfsr08";
} else if (currentSong == "tcfsr10") {
code+=TCFSR09;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Thank You For The Venom";
currentSong="";
currentSong="tcfsr09";
} else if (currentSong == "tcfsr11") {
code+=TCFSR10;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Hang Em High";
currentSong="";
currentSong="tcfsr10";
} else if (currentSong == "tcfsr12") {
code+=TCFSR11;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Its Not A Fashion Statement Its A Deathwish";
currentSong="";
currentSong="tcfsr11";
} else if (currentSong == "tcfsr13") {
code+=TCFSR12;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Cemetery Drive";
currentSong="";
currentSong="tcfsr12";
} else {
alert("ERROR!");
}
code+="' />";
code+="</object>";
code+="</body>";
code+="</html>";
code2+="</p>";
code2+="</body>";
code2+="</html>";
var doc;
doc=window.parent.musicPlayer.document;
doc.open();
doc.write(code);
doc.close();
var doc2;
doc2=window.parent.album.document;
doc2.open();
doc2.write(code2);
doc2.close();
}
Code:
function playNextSong() {
code="";
code="<html>";
code+="<body>";
code+="<object classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95'>";
code+="<param name='FileName' value='";
code2="";
code2+="<html>";
code2+="<head>";
code2+="<style type='text/css'>";
code2+="* { background-color:#000; color:#fff; margin:0; text-align:center; font-size:small; }";
code2+="</style>";
code2+="</head>";
code2+="<body>";
code2+="<p>";
if (currentSong == "tbp01") {
code+=TBP02;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Dead!";
currentSong="";
currentSong="tbp02";
} else if (currentSong == "tbp02") {
code+=TBP03;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-This Is How I Disappear";
currentSong="";
currentSong="tbp03";
} else if (currentSong == "tbp03") {
code+=TBP04;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-The Sharpest Lives";
currentSong="";
currentSong="tbp04";
} else if (currentSong == "tbp04") {
code+=TBP05;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Welcome To The Black Parade";
currentSong="";
currentSong="tbp05";
} else if (currentSong == "tbp05") {
code+=TBP06;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-I Dont Love You";
currentSong="";
currentSong="tbp06";
} else if (currentSong == "tbp06") {
code+=TBP07;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-House Of Wolves";
currentSong="";
currentSong="tbp07";
} else if (currentSong == "tbp07") {
code+=TBP08;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Cancer";
currentSong="";
currentSong="tbp08";
} else if (currentSong == "tbp08") {
code+=TBP09;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Mama";
currentSong="";
currentSong="tbp09";
} else if (currentSong == "tbp09") {
code+=TBP10;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Sleep";
currentSong="";
currentSong="tbp10";
} else if (currentSong == "tbp10") {
code+=TBP11;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Teenagers";
currentSong="";
currentSong="tbp11";
} else if (currentSong == "tbp11") {
code+=TBP12;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Disenchanted";
currentSong="";
currentSong="tbp12";
} else if (currentSong == "tbp12") {
code+=TBP13;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Famous Last Words";
currentSong="";
currentSong="tbp13";
} else if (currentSong == "tbp13") {
code+=TBP14;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Blood";
currentSong="";
currentSong="tbp14";
} else if (currentSong == "tbp14") {
code+=TBP14;
code2+=TBP;
code2+="</p>";
code2+="<p>";
code2+="The Black Parade-Blood";
currentSong="";
currentSong="tbp14";
} else if (currentSong == "tcfsr01") {
code+=TCFSR02;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Give Em Hell Kid";
currentSong="";
currentSong="tcfsr02";
} else if (currentSong == "tcfsr02") {
code+=TCFSR03;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-To The End";
currentSong="";
currentSong="tcfsr03";
} else if (currentSong == "tcfsr03") {
code+=TCFSR04;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-You Know What They Do To Guys Like Us In Prison";
currentSong="";
currentSong="tcfsr04";
} else if (currentSong == "tcfsr04") {
code+=TCFSR05;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Im Not Okay";
currentSong="";
currentSong="tcfsr05";
} else if (currentSong == "tcfsr05") {
code+=TCFSR06;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-The Ghost Of You";
currentSong="";
currentSong="tcfsr06";
} else if (currentSong == "tcfsr06") {
code+=TCFSR07;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-The Jetset Life Is Gonna Kill You";
currentSong="";
currentSong="tcfsr07";
} else if (currentSong == "tcfsr07") {
code+=TCFSR08;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Interlude";
currentSong="";
currentSong="tcfsr08";
} else if (currentSong == "tcfsr08") {
code+=TCFSR09;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Thank You For The Venom";
currentSong="";
currentSong="tcfsr09";
} else if (currentSong == "tcfsr09") {
code+=TCFSR10;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Hang Em High";
currentSong="";
currentSong="tcfsr10";
} else if (currentSong == "tcfsr10") {
code+=TCFSR11;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Its Not A Fashion Statement Its A Deathwish";
currentSong="";
currentSong="tcfsr11";
} else if (currentSong == "tcfsr11") {
code+=TCFSR12;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-Cemetery Drive";
currentSong="";
currentSong="tcfsr12";
} else if (currentSong == "tcfsr12") {
code+=TCFSR13;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-I Never Told You What I Do For A Living";
currentSong="";
currentSong="tcfsr13";
} else if (currentSong == "tcfsr13") {
code+=TCFSR13;
code2+=TCFSR;
code2+="</p>";
code2+="<p>";
code2+="Three Cheers For Sweet Revenge-I Never Told You What I Do For A Living";
currentSong="";
currentSong="tcfsr13";
} else {
alert("ERROR!");
}
code+="' />";
code+="</object>";
code+="</body>";
code+="</html>";
code2+="</p>";
code2+="</body>";
code2+="</html>";
var doc;
doc=window.parent.musicPlayer.document;
doc.open();
doc.write(code);
doc.close();
var doc2;
doc2=window.parent.album.document;
doc2.open();
doc2.write(code2);
doc2.close();
}
So finaly here is my question, is there any way to shorten this? The coding was easy but even with using copy and paste it took me 1 hour and 43 minutes (I timed myself I was really bored). That's way to much work.
Furthermore just to get this out of the way. My user are not expecting a pause/stop button. Also, I will get permision before using any songs, photos, whatever before adding it any where on the site.
Thanks for any help, Death
I couldn't include the music file, but everything else is there.
Comment