From ab9c578b447de17500e455dc3f781caaf332b37d Mon Sep 17 00:00:00 2001 From: Froelich Stefan Date: Sun, 4 Nov 2012 12:48:06 +0000 Subject: [PATCH] added dafault track playing when play button is clicked and no track is playing, it is ignored. patch forces player to look for a highlighted track or default to playing selected playlist from the top. --- scripts/player.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/player.js b/scripts/player.js index 4ca8dee..72f340e 100755 --- a/scripts/player.js +++ b/scripts/player.js @@ -765,6 +765,15 @@ SC.Player.prototype = { this.isPlaying = true; $("body").addClass("playing"); } + else { + //ensure that at least a track plays + //similar to itunes default behaviour + $(".selected").dblclick();//try to play a highlighted track + if(!this.audio) { + //no selected track, play first track in the playlist + $("tbody").find("tr:first").dblclick(); + } + } }, stop: function() { if(this.audio) {