If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Thanks. Played with it, but didn't get it to report anything either. I
do see that it's connecting to the server. But no events.
--
Michael
Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.
Thinking about using CometD to obtain status updates, rather than polling in Material Skin. I found a Javascript library for this at https://github.com/cometd/cometd-javascript (As an aside, I had to rename this libcometd.js, otherwise LMS would just return some error message instead of the JS file?)
Just quickly adding this to my server.js file, so that I can see how things work, I tried:
But I never get any serverstatus messages. CometD does produce some logging, and the handshake is successful. If I edit the libcometd.js file and replace channel: '/meta/subscribe' with channel: '/slim/subscribe' in CometD.subscribe(), then CometD does log what appears to be serverstatus messages. But still my handler above is not called. This is hack anyway, and I'm sure its not a correct change.
Any ideas as to what's wrong? Anybody have experience using cometd.js with LMS?
Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.
> Just quickly adding this to my -server.js- file, so that I can see how
> things work, I tried:
Could you please create a branch on github I could play with this? Would
be easier than finding the right place to put this in...
> Any ideas as to what's wrong? Anybody have experience using cometd.js
> with LMS?
I'll see what I did when I was using it - when I find some time.
--
Michael
Michael
"It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
(LMS: Settings/Information)
> Just quickly adding this to my -server.js- file, so that I can see how
> things work, I tried:
Could you please create a branch on github I could play with this? Would
be easier than finding the right place to put this in...
Sure, but it'll have to be much later - at work at the moment. But, I literally just copied cometd.js to MaterialSkin/HTML/material/html/lib/libcometd.js (must be renamed), edited desktop.html to include this JS file, and placed the above code in the "mounted" section of server.js
Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.
> Just quickly adding this to my -server.js- file, so that I can see how
> things work, I tried:
Could you please create a branch on github I could play with this? Would
be easier than finding the right place to put this in...
Code checked into cometd branch.
Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.
Which, if I look at the documentation for CometD, is correct.
However, if I look at the LMS code, it states this :
Code:
# A valid /slim/subscribe message looks like this:
# {
# channel => '/slim/subscribe',
# id => <unique id>,
# data => {
# response => '/slim/serverstatus', # the channel all messages should be sent back on
# request => [ '', [ 'serverstatus', 0, 50, 'subscribe:60' ],
# priority => <value>, # optional priority value, is passed-through with the response
# }
Note, it says '/slim/subscribe' should be in the 'channel' key (instead of 'meta/subscribe' and there should be no 'subscription' key.
Is it simply that LMS is non-standard and I'm going to have to hand craft my own subscription method?
[EDIT]
Ah, I now realise that is exactly what Craig has done, he is maintaining is own amended version of libcometd.js and put some custom code in to make it work : https://github.com/CDrummond/lms-mat...ometd.js#L2820
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment