mherger wrote: > >> Ever thought of looking into cometd? > > > > Nope, new to me. Guess I'd have to use a WebSocket for this? Never > used > > one of those either :-) > > No, it's older than WebSockets. It's long-polling implementation would > not hang up the http request after the first response, but keep > listening for new events. I haven't dealt with it in a very long time, > though...
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! ------------------------------------------------------------------------ cpd73's Profile: http://forums.slimdevices.com/member.php?userid=66686 View this thread: http://forums.slimdevices.com/showthread.php?t=109624 _______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/plugins
