Play icon adds song to current playlist and plays it.
Posted: Thu Jan 19, 2012 11:22 pm
Here is how to make the play icon next to each song add the song to the end of the playlist and play it.
We are going to edit playlist.jsp. This is the first part we are going to edit:
Simply change "playlistService.play" to "playlistService.add".
This is the second part of the file we are going to edit:
Change "skip(0);" to "skip(songs.length - 1);".
Hope this helps!
We are going to edit playlist.jsp. This is the first part we are going to edit:
- Code: Select all
function onPlay(path) {
startPlayer = true;
playlistService.play(path, playlistCallback);
}
Simply change "playlistService.play" to "playlistService.add".
This is the second part of the file we are going to edit:
- Code: Select all
function triggerPlayer() {
if (startPlayer) {
startPlayer = false;
if (songs.length > 0) {
skip(0);
}
}
updateCurrentImage();
if (songs.length == 0) {
player.sendEvent("LOAD", new Array());
player.sendEvent("STOP");
}
}
Change "skip(0);" to "skip(songs.length - 1);".
Hope this helps!