Skip to content

Instantly share code, notes, and snippets.

@MeoMix
Created September 13, 2012 17:15
Show Gist options
  • Save MeoMix/3715911 to your computer and use it in GitHub Desktop.
Save MeoMix/3715911 to your computer and use it in GitHub Desktop.
var onReady = function(){
var waitForPlaylistAndPort = setInterval(function(){
playlist = playlists.getSelectedPlaylist();
if(playlist && port){
clearInterval(waitForPlaylistAndPort);
sendUpdate();
//If there is a song to cue might as well have it ready to go.
if (playlist.songCount() > 0) {
loadSongById(playlist.getSongs()[0].id);
playlist.addSongToHistory(playlist.getSongs()[0]);
}
}
}, 200);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment