Create music player

Using jPlayer’s circle player I created a random music player. Here is the jQuery code

var currentSong;

var songlists = new Array();
songlists[0] = “/Audio/preciosa.mp3”;
songlists[1] = “/Audio/ElComejen.mp3”;
songlists[2] = “/Audio/rvdancingmoon.mp3”;
var random = Math.ceil(Math.random() * songlists.length) – 1;
currentSong = songlists[random];

var myCirclePlayer = new CirclePlayer(“#jquery_jplayer_1”,
mp3: currentSong

}, {
playlistOptions: {
enableRemoveControls: true
cssSelectorAncestor: “#cp_container_1”,
swfPath: “js”,
supplied: “mp3”


Here is the html code
<div id="jquery_jplayer_1"></div>
<div> <!-- A wrapper to emulate use in a webpage and center align --><!-- The container for the interface can go where you want to display it. Show and hide it as you need. -->
<div id="cp_container_1">
<div> <!-- .cp-gt50 only needed when buffer is > than 50% -->
<div> <!-- .cp-gt50 only needed when progress is > than 50% -->
<li><a tabindex="0"></a></li>
<li><a tabindex="0"></a></li> <!-- Needs the inline style here, or uses display:inline instead of display:block -->

You reference the three js files

<script type="text/javascript" src="js/jquery.jplayer.js"></script>
<script src="js/circle.player.js" type="text/javascript"></script>
<script src="js/Audioplayer.js" type="text/javascript"></script>