From 5e902234efb34765db436be36e4a66a400b9cf48 Mon Sep 17 00:00:00 2001 From: gballan1 Date: Tue, 29 Nov 2016 12:18:25 -0500 Subject: [PATCH] Added functionality to move on to next track in playlist when track ends --- public/js/music.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/js/music.js b/public/js/music.js index 688e592..2a9859c 100755 --- a/public/js/music.js +++ b/public/js/music.js @@ -17,6 +17,12 @@ $(document).ready(function() { // change selected album changeSelectedAlbum(this); }); + + // on track end + player.on('ended', function() { + // find selected track + changeSelectedTrack($('.music-track.selected').next()); + }); }); function changeSelectedAlbum(albumElem) {