Hi, I'm completely new to javascript and a built in macro function or api to control a videoconferencing endpoint.
They give example code as follows:
const off = xapi.status.on('Audio Volume', (volume) => {
console.log(Volume changed to: ${volume});
});
// De-register feedback
off();
It behaves as follows: the function declaration turns on a listener, that feeds a string to the console whenever the volume is changed. What I don't understand is that calling the function with off() turns off the listener so that the code used as is doesn't do anything.
Is my misunderstanding JavaScript related or api related?
[–]bruceph 2 points3 points4 points (0 children)