Page 1 of 1

Change title of the page to display current track name

PostPosted: Wed Jan 05, 2011 8:30 pm
by mvo
Hi,
Is it possible to give an option to allow the track name to be displayed on the title so the user can quickly glance at the title bar or tab to see what is playing? Even better if the title scrolled if the name is too long.

Thanks

PostPosted: Fri Jan 07, 2011 2:28 pm
by kramttocs
+1

There have been many times that I have also thought that a scrolling title with the song title would be nice.

PostPosted: Fri Mar 18, 2011 5:57 pm
by plarpco
I thought this was a good idea as well... I decided to write a greasemonkey script to handle it. YMMV. I'm sure it can be improved.

Currently this just sets the title to the LAST found "now playing" item in the right frame. I'm pretty much the only listener on my system, so this works for me. If you have multiple users, you might have to do some additional parsing.

Should work wheverever greasemonkey does. Create a new script, and paste this in, replacing the @include portion to point to your domain of subsonic.

Basically, this parses the right.view frame every 5 seconds and grabs a valid title (tooltip) from an anchor.

Code: Select all
// ==UserScript==
// @name           Now Playing in Subsonic
// @namespace      npsub
// @include        http://<domaintoyoursubsonicinstall>/right.view?*
// ==/UserScript==

function getNowPlayingName (){

   var links = document.getElementsByTagName('a');
   var element;

   for (var i = 0; i < links.length; i++) {
     
      element = links[i];

      if (element.title != '') {
         parent.document.title=element.title;
      }
   }

}

setInterval(getNowPlayingName, 5000);