PDA

View Full Version : Drop Down Menu for Music



Miciella
02-21-2006, 11:18 PM
Hi All,

Is there such a thing as a drop down menu that you can choose music to play and it not open another window to the player?

TheJoshMan
02-22-2006, 01:36 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
text-align:center;
}
form {
margin:0;
padding:0;
}
-->
</style>
<script type="text/javascript">
<!--
function PlayIt(){

document.getElementById('music1').innerHTML='<object id="mediaplayer" type="application/x-mplayer2" width="300" height="45" data="'+document.getElementById('cancion').value+'">'
+'<param id="media1" name="src" value="'+document.getElementById('cancion').value+'">'
+'<param id="media2" name="filename" value="'+document.getElementById('cancion').value+'">'
+'<param name="type" value="application/x-mplayer2">'
+'Your system does cannot find the windows media player that was specified.'
+'</object>'
}
//-->
</script>
</head>
<body onload="document.forms['player'].reset()">
<form name="player" action="" method="">
<select name="" id="cancion" onchange="PlayIt()" size="1">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<option value="http://urltosong1.mp3">Song 1</option>
<option value="http://urltosong2.mp3">Song 2</option>
<option value="http://urltosong3.mp3">Song 3</option>
<option value="http://urltosong4.mp3">Song 4</option>
<option value="http://urltosong5.mp3">Song 5</option>
<option value="http://urltosong6.mp3">Song 6</option>
<option value="http://urltosong7.mp3">Song 7</option>
<option value="http://urltosong8.mp3">Song 8</option>
<option value="http://urltosong9.mp3">Song 9</option>
<option value="http://urltosong10.mp3">Song 10</option>
</select>
</form>
<span id="music1">
<object type="application/x-mplayer2" width="300" height="45" data="">
<param name="src" value="">
<param name="filename" value="">
<param name="type" value="application/x-mplayer2">
Your system does cannot find the windows media player that was specified.
</object>
</span>
</body>
</html>

Miciella
02-22-2006, 11:39 PM
Nyne Lyvez Thank you so much it works... If you want to peek at where I am using it please go here then to the meditaion room and then the area with music http://www.thesanctuaryoftheheart.org/

Becuase it is in a meditation room do you think the Hidden code below would work somewhere in your code

<EMBED SRC="XXX" HIDDEN=TRUE AUTOSTART="false" MASTERSOUND NAME="soundfile">

Again, thank you, you have know idea what creative messes I was making.

Miciella

TheJoshMan
02-23-2006, 12:51 AM
You know... I was about to say HUH??? when i read that post... but I misenterpreted what you meant. I thought you wanted to add a whole other <embed> file inside of that one... but anyway... yes you can hide the player if you wish... and also... I went to your site and went to the music page... I think that you should use this version of the player instead. That one there is just the bare bones version of this code... but it was running REALLY slow so I think you need to use the version that will offer more cross browser compatiblity. So... Here goes... I have already plugged everything in for you so all you need to do is copy and paste. (then plug in your images) I forgot to do that part...


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
text-align:center;
background-color:black;
}
form {
margin:0;
padding:0;
}
-->
</style>
<script type="text/javascript">
<!--
function PlayIt(){
document.getElementById("music1").innerHTML='<object id="mediaPlayer" width="270" height="45" '
+'classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" '
+'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" '
+'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
+'<param name="fileName" value="'+document.getElementById('cancion').value+'">'
+'<param name="animationatStart" value="true">'
+'<param name="transparentatStart" value="true">'
+'<param name="autoStart" value="true">'
+'<param name="showControls" value="false">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'bgcolor="101010" showcontrols="false" width="270" height="45" '
+'src="'+document.getElementById('cancion').value+'" autostart="true" designtimesp="5311" loop="true">'
+'</embed>'
+'</object>'
}
//-->
</script>
</head>
<body onload="document.forms['player'].reset()">
<form name="player" action="" method="">
<select name="List" style="background-color:#101010; color:#aa0000" id="cancion" onchange="PlayIt()" size="1">
<option value="#">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::::::::::::: Choose Your Music :::::::::::::</option>
<option value="http://www.thesanctuaryoftheheart.org/SanctMusic/FairRIng4.wav">FairyRing~M. Rowland </option>
<option value="http://www.thesanctuaryoftheheart.org/SanctMusic/Oignisspiritus.wav">O ignis spiritus~ Hildgard Von Bingen</option>
<option value="http://www.thesanctuaryoftheheart.org/SanctMusic/OmNamashiva.wav">Om Nama Shiva~Robert Gass </option>
<option value="http://www.thesanctuaryoftheheart.org/SanctMusic/VoicesOfAngels.wav">Voices of Angels~ Hildgard Von Bingen</option>
</select>
</form>
<span id="music1">
<object id="mediaPlayer" width="270" height="45"
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="fileName" value="">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="true">
<param name="showControls" value="false">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
bgcolor="black" showcontrols="false" width="270" height="45"
src="" autostart="false" designtimesp="5311" loop="true">
</object>
</span>
</body>
</html>

By the way... Thanks for the email. That was pretty thoughtful.

TheJoshMan
02-23-2006, 01:21 AM
Forgot to tell you... The first audio file that you have linked shows up as "File Not Found" so you might wanna check your filename and make sure that it's not a typo somewhere...

Miciella
02-23-2006, 05:15 AM
Oh Yesssssss that looks so much better... Thank you.... I am so glad you understood what I was trying to say about hiding it. I know nothing about script and dor me to try and covey something I'm sure sounded insane lmaooooooo..

I find things on here and I pray I can make them work... I'm pulling my hair out right now trying to get a Slide show thing to work.... forget it its making me to nuts..

I'm just so very grateful for this music player, after I posted my first message about this on the fourm, I found a post on the same subject and they said only way to have a music drop down was to created it in flash >>> I choked reading that one...

You are such a gift thank you!

TheJoshMan
02-23-2006, 05:23 AM
Yea... I got that response for a long time too. I was trying to do the same thing and I finally gave up on it and decided to just put my files in a ".wax" playlist so they just automatically played... then I got curious and had to play around like I always do. But now... the funny and ironic thing is... I'm using a FLASH mp3 player instead. LMAO... Probably not your kind of muzik but you can check it out.

mp3 Player (http://www.waldronar.com/Design/Muzik/mp3/temp.html)
I didn't create the player itself... but i did do some editing work to it. I didn't like the silver color they had. Anyway, I'm glad everything worked out good with the code. If you need some help with the slideshow let me know... I assume you have my email address and you can email me if you wish.

Miciella
02-23-2006, 07:32 AM
You did a great job on your mp3 player... Yes that would be great if you have the time to work on the slideshow... Ill write you tomorrow... How long did it take you to learn flash?? I know im going to have to break down learn it.. I have so many ideas in my head and I think the only way most of it can be created will be in flash...

I cant say thank you enough...

faheemkmaran
11-06-2010, 06:41 PM
brother i am a new developer and stuck in the same situation with a little difference i wanted to add this type of mp3 player which is present on this site with the same stuff the site is http://tanzil.info/ and the menu which i want to add is all in the recitation section same playing option if you could help me on this

faheemkmaran
11-10-2010, 12:32 PM
hi i am a new developer and learning at the moment i also wanted to have the same drop down menu media player but wanted to add this http://flash-mp3-player.net/players/normal/ media player in it and the drop down menu below to the format as your is on the top and wanted to run the first track on auto mode plz if you could help me