Page 1 of 1

Change JW Player To Auto-Continue To Next Song

PostPosted: Wed May 22, 2013 11:33 pm
by sdct989
One of the problems that I've run into constantly with Subsonic media sharing is that if I share a playlist or an album with someone, the playback will only play one song. From then on out if the user wants to play the next song they have to click the song in the playlist. This gets annoying if you have a large playlist or a large album.

Since JW Player supports continuing to the next song (all you have to do is change a flash variable), I wrote a patch that will cause the player to continue to the next item in the playlist until it reaches the end of the playlist.

Here are the instructions for applying the patch (I wrote them for *nix based systems, Windows users will have to adapt them):
  1. Download the attached patch file
  2. Log in to the computer with your subsonic instance running on it (if you're not there already) and kill the subsonic service
  3. Find your Subsonic installation folder and run the following commands:
    Code: Select all
    cp subsonic.war /tmp
    mkdir /tmp/subsonic
    cd /tmp/subsonic
    jar -xvf ../subsonic.war
  4. Upload the patch file to wherever you're hosting subsonic (if you're not already there) and place it in the /tmp directory
  5. Run the following commands:
    Code: Select all
    cd /tmp/subsonic
    patch -p1 < ../continue_playlist.patch
    jar -cf ../subsonic.war.new *
  6. Now change directory to your subsonic installation and run the following commands:
    Code: Select all
    mv subsonic.war subsonic.war.old
    mv /tmp/subsonic.war.new subsonic.war
    rm -rf /tmp/subsonic/
    rm /tmp/subsonic.war /tmp/subsonic-sharing-domain.patch
  7. If you were running any of these commands as something other than the user that runs subsonic, make sure that you chown the subsonic.war file back to the original user with something like "chown subsonic:subsonic subsonic.war"
  8. Start subsonic again

Now when your shared media player (JW Player) reaches the end of the first song, it will continue to the next song in the playlist!

Re: Change JW Player To Auto-Continue To Next Song

PostPosted: Sat May 25, 2013 4:28 am
by GJ51
Strange - I've never run into this before. Might be limited to Linux versions.

http://xw8600.subsonic.org/share/vvJXZ

Re: Change JW Player To Auto-Continue To Next Song

PostPosted: Tue Jul 02, 2013 1:19 pm
by noexit23
Thanks VERY much for this addition. To complete this in Windows,
- Stop Subsonic Service
- Make a backup copy of the subsonic.war file (in case you scew up).
- Open subsonic.war file with 7Zip. If 7zip is installed, just right click on subsonic.war and select Open Archive. Do not extract the file.
- Navigate within 7zip to the Web-INF\jsp\ folder and right click the externalPlayer.jsp file. Select "Edit" from within 7Zip. The file should open with Notepad.exe.
- On the first page you should see the following:
<script type="text/javascript">
function init() {
var flashvars = {
id:"player1",
screencolor:"000000",
frontcolor:"<spring:theme code="textColor"/>",
backcolor:"<spring:theme code="backgroundColor"/>",
stretching: "fill",
"playlist.position": "bottom",
"playlist.size": 200,
};
- Find the line "playlist.size": 200, and then press Return on your keyboard to add another line. Then Tab over and add the following: repeat:"list" . Don't forget the quotes.
- So when done what you should have is this:

<script type="text/javascript">
function init() {
var flashvars = {
id:"player1",
screencolor:"000000",
frontcolor:"<spring:theme code="textColor"/>",
backcolor:"<spring:theme code="backgroundColor"/>",
stretching: "fill",
"playlist.position": "bottom",
"playlist.size": 200,
repeat:"list"
};
- close and save the file externalPlayer.jsp.
- close 7zip and save the file.
- restart the Subsonic service.