- "; // 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) { // Add img element to artwork container to then provide src through playlistConfig //$(".c7s-media-player .artwork").append(""); 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; $('.artwork img').attr('src', this.playlist[this.current].artwork).fadeTo("slow", 1); $('.track-name').text(this.playlist[this.current].name); $('.artist-name').text(this.playlist[this.current].artist); $('.album-name').text(this.playlist[this.current].album); $(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("", [ { artwork: "https://www.miloraps.com/wp-content/themes/soundcheck/images/default-album-artwork.png", name: "Audio Player Setup", artist: "Soundcheck", album: "Version 2.8", mp3:"https://www.miloraps.com/wp-content/themes/soundcheck/includes/default-album-audio.mp3" } ], { ready: function() { audioPlaylist.displayPlaylist(); audioPlaylist.playlistInit(false); // Parameter is a boolean for autoplay. }, ended: function() { audioPlaylist.playlistNext(); }, play: function() { $(this).jPlayer("pauseOthers"); }, swfPath: "https://www.miloraps.com/wp-content/themes/soundcheck/js/jplayer/js", solution: "flash, html", // Flash with an HTML5 fallback. supplied: "mp3" }); }); //]]>
New Site Coming Soon
We are currently re-designing the website. Please stay tuned. You can follow Milo on twitter at @yomilo or find him on facebook (Milo RapSmith)