cpd73 wrote: 
> I'm not having much luck with this. I found a javascript library
> https://github.com/cometd/cometd-javascript Tried:
> 
> > 
Code:
--------------------
  >   > 
  > var cometd = new org.cometd.CometD();
  > cometd.init({url: lmsServerAddress + '/cometd', logLevel:'debug'});
  > cometd.addListener('/meta/handshake', function(message) {
  > if (eval(message).successful) {
  > console.log("Handshake successful");
  > cometd.subscribe('/slim/serverstatus', 
  > function(res) { console.log("serverstatus:"+JSON.stringify(res, null, 
2));}, 
  > {data:{response:'/slim/serverstatus', request:['', ['serverstatus', 0, 50, 
'subscribe:60']]}});
  > }
  > });
  > 
--------------------
> > 
> 
> The handshake is successful, and the subscription appears to be
> (according to debug inf in the console). But if I start/stop a player
> - no messages are received. I'm obviously doing something wrong, just
> no idea what it is!

Wow!... you're fast! Your code should be ok to receive server status
events. But if you want to listen to player specific events, you'll have
to subscribe to "status" events for the player you're controlling.



Michael

http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo
------------------------------------------------------------------------
mherger's Profile: http://forums.slimdevices.com/member.php?userid=50
View this thread: http://forums.slimdevices.com/showthread.php?t=109624

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to