Announcement

Collapse
No announcement yet.

Remote "NowPlaying" Display

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • MillmoorRon
    replied
    Is this correct?

    Code:
    	// Repeat Status Icon
    	SqueezeJS.UI.RptStateIcon = Ext.extend(SqueezeJS.UI.Component, {
    	onPlayerStateChange : function(status){
    	var myImage=document.getElementById('repeaticon');
    	if (status["playlist repeat"] == 1)
     	 myImage.src="icons/repeat.png";
    	else
    	if (status["playlist repeat"] == 2)
     	 myImage.src="icons/repeat_all.png";
    	else
    	 myImage.src="icons/no_repeat.png";
    	this.el.update(myImage.src);
    	},
            onPlaylistChange : function(status){
    	var myImage=document.getElementById('repeaticon');
    	if (status["playlist repeat"] == 1)
     	 myImage.src="icons/repeat.png";
    	else
    	if (status["playlist repeat"] == 2)
     	 myImage.src="icons/repeat_all.png";
    	else
    	 myImage.src="icons/no_repeat.png";
    	this.el.update(myImage.src);
    	}
    	});
    
    	new SqueezeJS.UI.RptStateIcon({el: 'repeaticon', noLink: true});

    Leave a comment:


  • mherger
    replied
    Remote "NowPlaying" Display

    > I changed my code to:
    > // Repeat Status Icon
    > SqueezeJS.UI.RptStateIcon = Ext.extend(SqueezeJS.UI.Component, {

    ....
    >
    > SqueezeJS.UI.RptStateIcon = Ext.extend(SqueezeJS.UI.Component, {
    > onPlaylistChange : function(status){


    You can't have two definitions for the same class. Only create one,
    which then implements both methods.

    --

    Michael

    Leave a comment:


  • MillmoorRon
    replied
    Michael,

    Yes, but maybe I didn't understand exactly what you meant!

    I changed my code to:

    Code:
    // Repeat Status Icon
    SqueezeJS.UI.RptStateIcon = Ext.extend(SqueezeJS.UI.Component, {
    onPlayerStateChange : function(status){
    var myImage=document.getElementById('repeaticon');
    if (status["playlist repeat"] == 1)
      myImage.src="icons/repeat.png";
    else
    if (status["playlist repeat"] == 2)
      myImage.src="icons/repeat_all.png";
    else
      myImage.src="icons/no_repeat.png";
    this.el.update(myImage.src);
    }});
    
    new SqueezeJS.UI.RptStateIcon({el: 'repeaticon', noLink: true});
    
    SqueezeJS.UI.RptStateIcon = Ext.extend(SqueezeJS.UI.Component, {
    onPlaylistChange : function(status){
    var myImage=document.getElementById('repeaticon');
    if (status["playlist repeat"] == 1)
      myImage.src="icons/repeat.png";
    else
    if (status["playlist repeat"] == 2)
      myImage.src="icons/repeat_all.png";
    else
      myImage.src="icons/no_repeat.png";
    this.el.update(myImage.src);
    }});
    
    new SqueezeJS.UI.RptStateIcon({el: 'repeaticon', noLink: true});
    Is this what you intended?

    When a new song starts both repeat and shuffle images update, but changing the status of 'repeat' during a song has no effect - unless 'shuffle' is changed.

    Leave a comment:


  • mherger
    replied
    Remote "NowPlaying" Display

    Did you read my previous mail about onPlaylistChange?

    Michael

    > Am 02.08.2014 um 14:10 schrieb MillmoorRon <MillmoorRon.6i809z (AT) no-mx (DOT) forums.slimdevices.com>:
    >
    >
    > Michael,
    >
    > If the playlist changes both repeat and shuffle icons update anyway.
    >
    > If I press the repeat button the onPlayerStateChange event just doesn't
    > happen!
    >
    >
    > ------------------------------------------------------------------------
    > MillmoorRon's Profile: http://forums.slimdevices.com/member.php?userid=6413
    > View this thread: http://forums.slimdevices.com/showthread.php?t=74270
    >
    >

    Leave a comment:


  • MillmoorRon
    replied
    Michael,

    If the playlist changes both repeat and shuffle icons update anyway.

    If I press the repeat button the onPlayerStateChange event just doesn't happen!

    Leave a comment:


  • mherger
    replied
    Remote &quot;NowPlaying&quot; Display

    > As suspected, the breakpoint in repeat does not occur when I press the
    > repeat button, but if I press the shuffle button then both breakpoints
    > are activated.


    Oh, took me a while to understand... there are two events that might
    change the behaviour: playlistchange and playerstatechange. Your code
    only deals with player state changes. But you might want to implement
    the onPlaylistChange handler, too. It can be identical (many of the
    pre-defined components have an update method which is called from these
    two).

    --

    Michael

    Leave a comment:


  • MillmoorRon
    replied
    Michael,

    I have finally got breakpoints to work in Firebug.

    I set a breakpoint on the line
    Code:
    this.el.update(myImage.src);
    in both repeat and shuffle.

    As suspected, the breakpoint in repeat does not occur when I press the repeat button, but if I press the shuffle button then both breakpoints are activated.

    Any suggestions as to what is causing this?

    Leave a comment:


  • tfec
    replied
    Originally posted by Noel Hibbard
    Put this line right after "SqueezeJS.Controller.init({player: playerid});":
    Code:
    SqueezeJS.Controller.selectPlayer('00:00:00:00:01:02')
    Fine. Thank you. Thats it.

    --
    Thomas

    Leave a comment:


  • MillmoorRon
    replied
    Originally posted by mherger
    > Am I doing it in the correct place?

    Hard to tell without a reasonably sized screenshot... https://gyazo.com/
    to the rescue :-)

    --

    Michael
    I must be doing something wrong - can't get any breakpoint to occur!

    Leave a comment:


  • Noel Hibbard
    replied
    Originally posted by tfec
    Is it possible to hardcode the player which is presented?
    Put this line right after "SqueezeJS.Controller.init({player: playerid});":
    Code:
    SqueezeJS.Controller.selectPlayer('00:00:00:00:01:02')

    Leave a comment:


  • tfec
    replied
    Originally posted by RussellMrgn
    You have to have the album showing on squeezebox server (Right Hand Pane) GUI, with the player that you have selected (if you have more than one). Then you open "The Now Playing" screen.

    This is from the readme file:-
    "This html may show a blank page when initially installed. To correct, launch the SqueezeCenter or SqueezeBox Server web interface in Internet Explorer on the
    same computer used to display this html and select the player you wish this html to show. Then refresh do a CTRL-F5 to do a full refresh of this html. Not sure
    why this step is necessary, but that is what I've found in my testing. Also, to change the player this html shows, from the same computer launch the SqueezeCenter
    web interface and select the player to display. Then do a CTRL-F5 to do a clean refresh of this html page. The new player should now be displayed."
    Hi,

    I'm using the nowplaying from MillmoorRon. Is it possible to hardcode the player which is presented?

    Maybe it's here and I have just to change a litte:
    Code:
    17   <script type="text/javascript">
    18   Ext.onReady(function(){
    19     	SqueezeJS.Controller.init({player: playerid});
    --
    Thomas

    This Quick & Dirty Solution with an unvisible IFRAME solved my problem, but I'm looking for a better way:
    Code:
    </script>
    <IFRAME src="http://192.168.2.153:9000/?player=00:26:bb:3f:c9:7c" height="0" width="0" border="0" style="visibility:hidden;">
    </body>
    </html>
    --
    Thomas
    Last edited by tfec; 2014-05-10, 16:51. Reason: Quick & Dirty Solution

    Leave a comment:


  • MillmoorRon
    replied
    Is this better?

    Leave a comment:


  • mherger
    replied
    Remote &quot;NowPlaying&quot; Display

    > Am I doing it in the correct place?

    Hard to tell without a reasonably sized screenshot... https://gyazo.com/
    to the rescue :-)

    --

    Michael

    Leave a comment:


  • MillmoorRon
    replied
    Still nothing!

    Am I doing it in the correct place?

    Click image for larger version

Name:	NowPlaying1.jpg
Views:	1
Size:	17.7 KB
ID:	1556893

    Sorry, can't get my screen shot to attach at full size!

    Leave a comment:


  • mherger
    replied
    Remote &quot;NowPlaying&quot; Display

    > I have set a breakpoint on the 2 lines above which state:
    >
    > Code:
    > --------------------
    >
    > onPlayerStateChange : function(status){


    Pick a statement inside those functions.

    --

    Michael

    Leave a comment:

Working...
X
😀
🥰
🤢
😎
😡
👍
👎