- setMedia($('.play').first()).jPlayer("play");
-
- $('.play').click(function() {
- setMedia(this).jPlayer("play");
+
+ $('.play-next', $root).click(function() {
+ var next = parseInt($number.text()) + 1;
+ var p = $('.play:eq(' + next + ')', $root);
+ if (p.length) {
+ setMedia(p).jPlayer("play");
+ $number.text(next)
+ }
+ });
+ $('.play-prev', $root).click(function() {
+ var next = parseInt($number.text()) - 1;
+ if (next < 1)
+ return;
+ var p = $('.play:eq(' + next + ')', $root);
+ setMedia(p).jPlayer("play");
+ $number.text(next)