From 675a2b12a2bfb4e7d1948f68f034d2fb3a7f9424 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 6 Mar 2012 21:58:56 +0100 Subject: Added hints to tell the server which track we want next. This lets the server recode the next track behind the scenes while we're listening to the current track. --- static/playlist.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'static/playlist.js') diff --git a/static/playlist.js b/static/playlist.js index 6f57075..b94de61 100644 --- a/static/playlist.js +++ b/static/playlist.js @@ -39,6 +39,9 @@ $(function(){ item.id = this.current_id; this.current_id++; var model = items.create(item); + if(items.indexOf(model) < 2) { + sound_hint(model); + } }, addOne: function(item) { var view = new PlaylistItemView({model: item}); @@ -60,6 +63,11 @@ $(function(){ items.remove(item); this.render(); return next; + }, + hintnext: function() { + var next = items.at(1); + if(next) + sound_hint(next); } }); -- cgit v1.2.3