PDA

View Full Version : JavaScript - Music Player


Core
03-01-2010, 11:30 AM
<!--http://ananmanan.com/am_download/sinhala_mp3/Amal_Perera_Mal_Pita_Mal.mp3 -->
<!-- use above link for testing purpose-->
<!-- remember US IE because FireFox needs plugins-->


<html>

<head>

<script type='text/javascript'>

try
{

function coremusic()
{
var _URL = prompt('Copy and Paste your Music Link here','');




if (_URL != "")
{


if ( _URL.indexOf('.mp3') != -1 )
{

if ( navigator.appName == 'Microsoft Internet Explorer')
{

document.write("<div style='text-align:center'><object width='300' height='80' id='music1'>\
<param name='music' value= " + "'" + _URL + "'" + " type='audio/mpeg' />\
<embed src= " + "'" + _URL + "'" + " type='audio/mpeg' id='music1' width='300' height=80' />\
</object></div>")

document.write("<br /> <p style='text-align:center'> Now Playing : <b>" + _URL + "</b> <br />");
document.write("<br /> <p style='text-align:center'> Browser : <b>" + navigator.appName + "</b> <br />");

}
else
{
alert('Sorry Use IE rest of are shit needs plugins');
}
}
else
{
alert('this codes have been written for only .mp3 format');
}
}
else
{
alert("Need a Valid URL");
}


}

}
catch( _error )
{
alert(_error.description);
}

</script>

</head>


<body>

<input type='button' value='Click to Proceed' onclick='coremusic()' />

</body>


</html>

Note : all codes have been written by Core so don't steal mine ,if you want to use then put the reference with you (use Harvard Reference System)

GIVE ME FEEDBACK so I CAN FIND ERRORS .!!!

Core
03-01-2010, 11:37 AM
http://i942.photobucket.com/albums/ad262/reckjavik/JavaScript/img3.jpg

VSGM
03-01-2010, 11:39 AM
Thanks :D

Rangau2
03-01-2010, 11:46 AM
lol
rhythm fm

<object style="Z-INDEX: -999"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"
type="application/x-oleobject" height="62"
standby="Loading Windows Media Player components..." width="179"
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="Filename" value="http://220.247.227.5/live" />
<param name="autostart" value="true" />
<param name="ShowStatusBar" value="true" />
<param name="enableContextMenu" value="false" />
<param name="DisplaySize" value="-1" />
<param name="AutoSize" value="false" />
<param name="Volume" value="100" />
<embed src="http://220.247.227.5/live" stretchtofit="0"
enablecontextmenu="0" type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"
volume="-1" showstatusbar="1" style="z-index: -999;" height="62"
width="179"/></embed>
</object>

h_abeysinghe
03-01-2010, 11:46 AM
elaz

h_abeysinghe
03-01-2010, 11:46 AM
machan eth ai CHROME and FIREFOX wala wada natthe??

Core
03-01-2010, 11:50 AM
machan eth ai CHROME and FIREFOX wala wada natthe??

I didn't test with Chrome but FireFox needs Plugins
for playing Mp3 infact this is just a Tutorial I will post once I have done the full one.

give me FeedBack so I can write a better one ,unless it's useless if no one accept my codes :eek::eek:

h_abeysinghe
03-01-2010, 11:54 AM
I didn't test with Chrome but FireFox needs Plugins
for playing Mp3 infact this is just a Tutorial I will post once I have done the full one.

give me FeedBack so I can write a better one ,unless it's useless if no one accept my codes :eek::eek:

ela ela
machan puluwan nam me tikakth add karapan

1.nice background
2.and tikak OBJECTS(buttons) lassana karapan
3.ONLINE radio ekakuth daapan(CODE EKA TIBBA aru POST karala)

VSGM
03-01-2010, 11:56 AM
ela ela
machan puluwan nam me tikakth add karapan

1.nice background
2.and tikak OBJECTS(buttons) lassana karapan
3.ONLINE radio ekakuth daapan(CODE EKA TIBBA aru POST karala)

There is no buttons in this :dull:
Just the Windows media player activeX control ;)

h_abeysinghe
03-01-2010, 12:01 PM
There is no buttons in this :dull:
Just the Windows media player activeX control ;)

yeah man i knw man kiwwe BUTTONS danna kiyala(NOT IN MP)
ai ara CLICK to PROCEED kiyala thiyenne anna ekai eka CLICK kalama ena BAR ekai tikak COLOR full karrna kiyala

VSGM
03-01-2010, 12:02 PM
yeah man i knw man kiwwe BUTTONS danna kiyala(NOT IN MP)

4 wat?

h_abeysinghe
03-01-2010, 12:04 PM
4 wat?

man eka edit kala dan gihin balapan

VSGM
03-01-2010, 12:07 PM
yeah man i knw man kiwwe BUTTONS danna kiyala(NOT IN MP)
ai ara CLICK to PROCEED kiyala thiyenne anna ekai eka CLICK kalama ena BAR ekai tikak COLOR full karrna kiyala

I didn't see that ;)

Core
03-01-2010, 04:37 PM
<!--http://ananmanan.com/am_download/sinhala_mp3/Amal_Perera_Mal_Pita_Mal.mp3 -->




<html>


<head>


<script type='text/javascript'>


try
{


function coremusic()
{
var _URL = prompt('Copy and Paste your Music Link here','');








if (_URL != "")
{




if ( _URL.indexOf('.mp3') != -1 )
{




document.write("<div style='text-align:center'><object width='300' height='80' id='music1'>\
<param name='music' value= " + "'" + _URL + "'" + " type='audio/mpeg' />\
<embed src= " + "'" + _URL + "'" + " type='audio/mpeg' id='music1' width='300' height=80' />\
</object></div>")


document.write("<br /> <p style='text-align:center'> Now Playing : <b>" + _URL + "</b> <br />");
document.write("<br /> <p style='text-align:center'> Browser : <b>" + navigator.appName + "</b> <br />");


}
else
{
alert('this codes have been written for only .mp3 format');
}
}
else
{
alert("Need a Valid URL");
}




}


}
catch( _error )
{
alert(_error.description);
}


</script>


</head>




<body>


<input type='button' value='Click to Proceed' onclick='coremusic()' />


</body>




</html>



http://i942.photobucket.com/albums/ad262/reckjavik/JavaScript/img4.jpg