PDA

View Full Version : It won't play the music and how do I get my own music on


DatsNotFunny
11-01-2005, 10:07 PM
Here's the code taken from another thread. I have 2 problems. One is that the music wont play when I click ">". The other is rpoblem I have is how do I transform the "song.mp3" to sumthing that can be read by the script. I hope I'm askin the right questions.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>

<body>

<style type="text/css">

#mainbodyMP{background-color: #060A91; width: 300px; height: 30px; border-top: 2px solid #F67E0E; border-right: 2px solid #000; border-bottom: 2px solid #F67E0E; border-left: 2px solid #000;}



#navlistMP
{
margin: 0px;
margin-bottom: 0px;
margin-right: 0px;
padding: 0px;
padding-left: 245px;
background-color: #060A91;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
padding-bottom: 3px;
padding-top: 3px;
}

#navlistMP a, #navlistMP a:link, #navlistMP a:visited
{

padding: 1px;
padding-left: 0.5em;
padding-right: 0.5em;
color: #000000;
font-weight: bold;
text-decoration: none;
}

#navlistMP a:hover, #navlistMP a:active, #navlistMP a:focus
{

padding: 1px;
padding-left: 0.5em;
padding-right: 0.5em;
text-decoration: none;
}

#navlistMP li
{
padding-right: 1px;
display: inline;
font-size: 0.6em;
}

#navlistMP ul
{
margin: 0px;
padding: 0px;
}

#navlistMP #active a { background-color: #DDDDDD; }






</style>


<div id="mainbodyMP">
<marquee align="left" behavior="scroll|slide|alternate" bgcolor="#000" height="25" width="300" direction="left|right" loop="infinite|value" scrollamount="1" scrolldelay="1" title="music player"><font face="lithos pro regular" color="#F67E0E" size="1">System of a Down...Mezmerise...Question!</font></marquee>
<div id="navbarMP">
<div id="navcontainerMP">
<ul id="navlistMP">
<li id="active">
<a href="/zentcart125d/media/sample06 A Most Prcecious Gift.mp3" onclick="play(this.href);return false">></a></li>
<a href="#" onclick="stopsong();return false">||</a>
<span id="music1"></span>
</span>
</ul>
</div>
</div>
</div>



<script type="text/javascript">
function play(what){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+what+"' name='MediaPlayer1' width='1' height='1' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true' loop='false'></embed>";
}
function stopsong(){
document.getElementById('music1').innerHTML="";
}

</script>






</body>
</html>

_Aerospace_Eng_
11-01-2005, 11:48 PM
Where you see spaces in your file name use %20 and instead of > use &gt;
Move the styles and the script in between the head tags.

DatsNotFunny
11-09-2005, 06:29 PM
Thank you for the effort but it still doesn't play the song. I've tried a lot of different coding. This is probably pretty simple but due to the fact that I'm relativly new to this I don't know what I'm doing. Like I said I'm not really sure why this isn't working.

Thank you
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>

<script type="text/javascript">
function play(what){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+what+"' name='MediaPlayer1' width='1' height='1' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true' loop='false'></embed>";
}
function stopsong(){
document.getElementById('music1').innerHTML="";
}

</script>

<style type="text/css">

#mainbodyMP{background-color: #060A91; width: 300px; height: 30px; border-top: 2px solid #F67E0E; border-right: 2px solid #000; border-bottom: 2px solid #F67E0E; border-left: 2px solid #000;}



#navlistMP
{
margin: 0px;
margin-bottom: 0px;
margin-right: 0px;
padding: 0px;
padding-left: 245px;
background-color: #060A91;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
padding-bottom: 3px;
padding-top: 3px;
}

#navlistMP a, #navlistMP a:link, #navlistMP a:visited
{

padding: 1px;
padding-left: 0.5em;
padding-right: 0.5em;
color: #000000;
font-weight: bold;
text-decoration: none;
}

#navlistMP a:hover, #navlistMP a:active, #navlistMP a:focus
{

padding: 1px;
padding-left: 0.5em;
padding-right: 0.5em;
text-decoration: none;
}

#navlistMP li
{
padding-right: 1px;
display: inline;
font-size: 0.6em;
}

#navlistMP ul
{
margin: 0px;
padding: 0px;
}

#navlistMP #active a { background-color: #DDDDDD; }
</head>
</style>
<title>"title"</title

<body>





<div id="mainbodyMP">
<marquee align="left" behavior="scroll|slide|alternate" bgcolor="#000" height="25" width="300" direction="left|right" loop="infinite|value" scrollamount="1" scrolldelay="1" title="music player"><font face="lithos pro regular" color="#F67E0E" size="1">System of a Down...Mezmerise...Question!</font></marquee>
<div id="navbarMP">
<div id="navcontainerMP">
<ul id="navlistMP">
<li id="active">
<a href="/zentcart125d/media/sample01%20Living%20on%20the%20Farm.mp3"%20onclick="play(this.href);return false">></a></li>
<a href="/zentcart125d/media/sample01%20Living%20on%20the%20Farm.mp3"%20onclick="stopsong();return false">||</a>
<span id="music1"></span>
</span>
</ul>
</div>
</div>
</div>

</body>
</html>

_Aerospace_Eng_
11-09-2005, 07:30 PM
I had only meant for you to put %20 for spaces in the file name. Can you give us a link to your site?

rainemaida
11-17-2005, 06:37 AM
rename your files with no spaces in, it's SO much easier that way..