Play icon adds song to current playlist and plays it.

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Play icon adds song to current playlist and plays it.

Postby ytechie » 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:

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! :D
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Play icon adds song to current playlist and plays it.

Postby baxtr » Thu Jan 19, 2012 11:31 pm

Most excellent....I love this one......great for those parties when I've had a few and go to add music to the playlist and click the play button only to delete the list and play just that song... Thanks!!!!!!!!!
baxtr
 
Posts: 99
Joined: Sat Feb 13, 2010 4:19 am

Re: Play icon adds song to current playlist and plays it.

Postby stratosrv » Fri Oct 05, 2012 4:34 pm

Hi..
This work in 4.7 too?
I can't find this code in playlist.jsp

thank you.
stratosrv
 
Posts: 12
Joined: Sat Apr 28, 2012 12:08 pm

Re: Play icon adds song to current playlist and plays it.

Postby baxtr » Thu Sep 05, 2013 2:21 am

any chance this can be modified to add the song into the "next" spot of a playlist already in session? Say I have 1000 songs in the list, I am on number 50 and someone asks to hear something....adding it to the bottom of the list and playing it just ends the playlist.....this would insert it, then continue on with the list.


Now, this should likely be a different button seeing as you may want to add but not add it next ...if you understand what I mean.
baxtr
 
Posts: 99
Joined: Sat Feb 13, 2010 4:19 am

Re: Play icon adds song to current playlist and plays it.

Postby mjeppo » Fri Sep 06, 2013 3:49 am

Unfortunately, the described sections of code do not exist in the Playlist.js file.
Maybe the tutorial is for older versions of ss?
9.445 artiesten
21.140 albums
342.780 songs
14998,37 GB
28.673 uren
User avatar
mjeppo
 
Posts: 20
Joined: Thu Oct 20, 2011 8:18 am
Location: Groningen, the Netherlands


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 7 guests