jQuery(document).ready(function(){ var playItem = 0; var myPlayList = [ {name:'Emmie by Trentin Manning- "Tranquility & Tension"',mp3:'http://atsounds.com/wp-content/uploads/2010/08/Emmie-M1.mp3'},{name:'Come As You Are by Dan Now-"Self Evident"',mp3:'http://atsounds.com/wp-content/uploads/2010/08/Come-As-You-Are1.mp3'},{name:'Fly On A Web by Dan Now-"Self Evident"',mp3:'http://atsounds.com/wp-content/uploads/2010/08/Fly-On-A-Web1.mp3'},{name:'Impermeable by Dan Now-"Self Evident"',mp3:'http://atsounds.com/wp-content/uploads/2010/08/Impermeable1.mp3'},{name:'Beautiful In You by Julie Nickell-"This Is Life"',mp3:'http://atsounds.com/wp-content/uploads/2010/08/Beautiful-In-You1.mp3'},{name:'Inside Out by Nathan Michael',mp3:'http://atsounds.com/wp-content/uploads/2010/09/Inside-Out-V21.mp3'},{name:'Something Else by Scott Duebber- "Rm. 113"',mp3:'http://atsounds.com/wp-content/uploads/2010/09/04-Something-Else1.mp3'},{name:'Without You by Scott Duebber- "Rm. 113"',mp3:'http://atsounds.com/wp-content/uploads/2010/09/05-Eds-Song1.mp3'}, ]; // Local copy of jQuery selectors, for performance. var jpPlayTime = jQuery("#jplayer_play_time"); var jpTotalTime = jQuery("#jplayer_total_time"); jQuery("#jquery_jplayer").jPlayer({ ready: function() { displayPlayList(); playListInit(true); // Parameter is a boolean for autoplay. }, nativeSupport: false, swfPath: "http://atsounds.com/wp-content/themes/atsounds88/js", errorAlerts:true }) .jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) { jpPlayTime.text(jQuery.jPlayer.convertTime(playedTime)); jpTotalTime.text(jQuery.jPlayer.convertTime(totalTime)); }) .jPlayer("onSoundComplete", function() { playListNext(); }); jQuery("#jplayer_previous").click( function() { playListPrev(); jQuery(this).blur(); return false; }); jQuery("#jplayer_next").click( function() { playListNext(); jQuery(this).blur(); return false; }); function displayPlayList() { jQuery("#jplayer_playlist ul").empty(); for (i=0; i < myPlayList.length; i++) { var listItem = (i == myPlayList.length-1) ? "
  • " : "
  • "; listItem += ""+ myPlayList[i].name +"
  • "; jQuery("#jplayer_playlist ul").append(listItem); jQuery("#jplayer_playlist_item_"+i).data( "index", i ).click( function() { var index = jQuery(this).data("index"); if (playItem != index) { playListChange( index ); } else { jQuery("#jquery_jplayer").jPlayer("play"); } jQuery(this).blur(); return false; }); } } function playListInit(autoplay) { if(autoplay) { playListChange( playItem ); } else { playListConfig( playItem ); } } function playListConfig( index ) { jQuery("#jplayer_playlist_item_"+playItem).removeClass("jplayer_playlist_current").parent().removeClass("jplayer_playlist_current"); jQuery("#jplayer_playlist_item_"+index).addClass("jplayer_playlist_current").parent().addClass("jplayer_playlist_current"); playItem = index; jQuery("#jquery_jplayer").jPlayer("setFile", myPlayList[playItem].mp3); } function playListChange( index ) { playListConfig( index ); jQuery("#jquery_jplayer").jPlayer("play"); } function playListNext() { var index = (playItem+1 < myPlayList.length) ? playItem+1 : 0; playListChange( index ); } function playListPrev() { var index = (playItem-1 >= 0) ? playItem-1 : myPlayList.length-1; playListChange( index ); } }); -->