//" : "
  • "; listItem += ""+ this.playlist[i].name +""; // Create links to free media if(this.playlist[i].free) { var first = true; listItem += "
    ("; $.each(this.playlist[i], function(property,value) { if($.jPlayer.prototype.format[property]) { // Check property is a media format. if(first) { first = false; } else { listItem += " | "; } listItem += "" + property + ""; } }); listItem += ")"; } listItem += "
  • "; // Associate playlist items with their media $(this.cssSelector.playlist + " ul").append(listItem); $(this.cssSelector.playlist + "_item_" + i).data("index", i).click(function() { var index = $(this).data("index"); if(self.current !== index) { self.playlistChange(index); } else { $(self.cssSelector.jPlayer).jPlayer("play"); } $(this).blur(); return false; }); // Disable free media links to force access via right click if(this.playlist[i].free) { $.each(this.playlist[i], function(property,value) { if($.jPlayer.prototype.format[property]) { // Check property is a media format. $(self.cssSelector.playlist + "_item_" + i + "_" + property).data("index", i).click(function() { var index = $(this).data("index"); $(self.cssSelector.playlist + "_item_" + index).click(); $(this).blur(); return false; }); } }); } } }, playlistInit: function(autoplay) { if(autoplay) { this.playlistChange(this.current); } else { this.playlistConfig(this.current); } }, playlistConfig: function(index) { $(this.cssSelector.playlist + "_item_" + this.current).removeClass("jp-playlist-current").parent().removeClass("jp-playlist-current"); $(this.cssSelector.playlist + "_item_" + index).addClass("jp-playlist-current").parent().addClass("jp-playlist-current"); this.current = index; $(this.cssSelector.jPlayer).jPlayer("setMedia", this.playlist[this.current]); }, playlistChange: function(index) { this.playlistConfig(index); $(this.cssSelector.jPlayer).jPlayer("play"); }, playlistNext: function() { var index = (this.current + 1 < this.playlist.length) ? this.current + 1 : 0; this.playlistChange(index); }, playlistPrev: function() { var index = (this.current - 1 >= 0) ? this.current - 1 : this.playlist.length - 1; this.playlistChange(index); } }; var audioPlaylist = new Playlist("2", [ { name:"Glide (Krajacic) / Glide / 2011", mp3:"http://www.damjanmusic.com/download.php?type=mp3&name=01-Glide" }, { name:"Come Play (Krajacic) / Glide / 2011", mp3:"http://www.damjanmusic.com/download.php?type=mp3&name=02-Come-Play" }, { name:"First Steps (Krajacic/Thies) / Difference / 2007", mp3:"http://www.damjanmusic.com/download.php?type=mp3&name=01_Krajacic_FirstSteps" }, { name:"Peacefully (Krajacic) / In Retrospect / 2004", mp3:"http://www.damjanmusic.com/download.php?type=mp3&name=01_Krajacic_Peacefully" }, { name:"Lara (Krajacic) / Glide / 2011", mp3:"http://www.damjanmusic.com/download.php?type=mp3&name=03-Lara" }, { name:"Walking in Silence (Krajacic) / Difference / 2007", mp3:"http://www.damjanmusic.com/download.php?type=mp3&name=02_Krajacic_WalkingInSilence" }, { name:"An Impression (Krajacic) / In Retrospect / 2004", mp3:"http://www.damjanmusic.com/download.php?type=mp3&name=05_Krajacic_AnImpression" }, ], { ready: function() { audioPlaylist.displayPlaylist(); audioPlaylist.playlistInit(true); // Parameter is a boolean for autoplay. }, ended: function() { audioPlaylist.playlistNext(); }, play: function() { $(this).jPlayer("pauseOthers"); }, swfPath: "js", supplied: "mp3" }); }); //]]>