JavaScript - Music Player

Core

Member
Jan 23, 2010
3,120
195
0
Milky Way/Local Cluster/Local Sol/Earth
<!--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

Member
Jan 23, 2010
3,120
195
0
Milky Way/Local Cluster/Local Sol/Earth
img3.jpg
 

Rangau2

Well-known member
  • Dec 31, 2008
    20,468
    1,211
    113
    34
    දෙණියාය :)
    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

    Well-known member
  • Sep 4, 2008
    12,096
    435
    83
    32
    toronto,canada
    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

    Well-known member
  • Aug 2, 2007
    10,330
    213
    63
    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

    Well-known member
  • Sep 4, 2008
    12,096
    435
    83
    32
    toronto,canada
    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
     
    Last edited:

    Core

    Member
    Jan 23, 2010
    3,120
    195
    0
    Milky Way/Local Cluster/Local Sol/Earth
    Works with Comodo Dragon (Netscape except FireFox)


    <!--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>



    img4.jpg