4 $(".jp-jplayer").each(function() {
6 var $root = $self.parent();
7 var $number = $('.number', $root);
9 swfPath: "/static/jplayer/",
10 solution: "html,flash",
11 supplied: $self.attr('data-supplied'),
12 cssSelectorAncestor: "#" + $self.attr("data-player"),
16 var setMedia = function(elem) {
17 var li = $(elem).parent();
20 media['mp3'] = li.attr('data-mp3');
21 media['oga'] = li.attr('data-ogg');
23 $(".title", $root).html(li.html());
24 return player.jPlayer("setMedia", media);
27 $('.play-next', $root).click(function() {
28 var next = parseInt($number.text()) + 1;
29 var p = $('.play:eq(' + next + ')', $root);
31 setMedia(p).jPlayer("play");
35 $('.play-prev', $root).click(function() {
36 var next = parseInt($number.text()) - 1;
39 var p = $('.play:eq(' + next + ')', $root);
40 setMedia(p).jPlayer("play");
44 setMedia($('.play', $root).first());