2016-10-03 16:12:04 +00:00
|
|
|
/* global APP, config */
|
2016-05-05 16:14:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The (name of the) command which transports the recorder info.
|
|
|
|
*/
|
2017-10-12 23:02:29 +00:00
|
|
|
const _USER_INFO_COMMAND = 'userinfo';
|
2016-05-05 16:14:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The Recorder class is meant to take care of recorder related presence
|
|
|
|
* commands.
|
|
|
|
*/
|
|
|
|
class Recorder {
|
2017-10-12 23:02:29 +00:00
|
|
|
/**
|
|
|
|
* Creates new recorder instance.
|
|
|
|
*/
|
2016-05-05 16:14:27 +00:00
|
|
|
constructor() {
|
2017-10-12 23:02:29 +00:00
|
|
|
if (config.iAmRecorder) {
|
2016-05-05 16:14:27 +00:00
|
|
|
this._sendRecorderInfo();
|
2017-10-12 23:02:29 +00:00
|
|
|
}
|
2016-05-05 16:14:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends the information that this is a recorder through the presence.
|
|
|
|
* @private
|
|
|
|
*/
|
|
|
|
_sendRecorderInfo() {
|
2017-10-12 23:02:29 +00:00
|
|
|
const commands = APP.conference.commands;
|
2016-05-05 16:14:27 +00:00
|
|
|
|
|
|
|
// XXX The "Follow Me" command represents a snapshot of all states
|
|
|
|
// which are to be followed so don't forget to removeCommand before
|
|
|
|
// sendCommand!
|
|
|
|
commands.removeCommand(_USER_INFO_COMMAND);
|
|
|
|
commands.sendCommand(
|
|
|
|
_USER_INFO_COMMAND,
|
|
|
|
{
|
|
|
|
attributes: {
|
|
|
|
xmlns: 'http://jitsi.org/jitmeet/userinfo',
|
|
|
|
robot: true
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-03 16:12:04 +00:00
|
|
|
export default Recorder;
|