Change JW Player To Auto-Continue To Next Song

Tutorials, tips and tricks.

Moderator: moderators

Change JW Player To Auto-Continue To Next Song

Postby sdct989 » Wed May 22, 2013 11:33 pm

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!
User avatar
sdct989
 
Posts: 30
Joined: Thu Jan 31, 2013 4:11 am

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

Postby GJ51 » Sat May 25, 2013 4:28 am

Strange - I've never run into this before. Might be limited to Linux versions.

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

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

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

Postby noexit23 » Tue Jul 02, 2013 1:19 pm

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.
noexit23
 
Posts: 3
Joined: Tue Jul 02, 2013 1:06 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests