1

how can set password for jitsi meet video room with external API , i can try do it with sample code , but don't work for me, room create but without password as below:

var domain = "meet.jit.si";
var roomName="my_test_room1";

var options = {
  roomName: roomName,
  width: 1024,
  height: 900,
  parent: undefined,
  noSsl: false,
  configOverwrite: {
    disableDeepLinking: true,
  },
  interfaceConfigOverwrite: {
    filmStripOnly: false
  },
  userInfo: {
    email: 'test@mail.ru',
    displayName: 'Test Testov'
  }
}

api = new JitsiMeetExternalAPI(domain, options);

var pwd = "mypass";


 setTimeout(() => {

    // when local user is trying to enter in a locked room
    api.addEventListener('passwordRequired', () => {
        api.executeCommand('password', pwd);
    });

    // when local user has joined the video conference
    api.addEventListener('videoConferenceJoined', (response) => {
        api.executeCommand('password', pwd);
    });

}, 10);
Yusif Karimov
  • 400
  • 5
  • 8

2 Answers2

0

When first person enters room, he will have administrator permissions. We can setup password at that moment.

api.addEventListener('participantRoleChanged', function(event) {
    if (event.role === "moderator") {
        api.executeCommand('password', pwd);
    }
});

Then next participants on join will enter required password.

api.on('passwordRequired', function () {
    api.executeCommand('password', pwd);
}
overfl0w
  • 64
  • 2
  • yeah i know it, if administrator enter first time and he don't leave meeting room in this case it is OK, but i want to first create room with password, then i send room link and password to other user, when any user enter room via this link he must enter password anywhere (admin enter or not enter ) – Yusif Karimov Sep 17 '20 at 11:26
0

On every create check for a password and set it, by querying an external service and by implementing your custom module.

  1. Create the lua file with name mod_password_moderation.lua where your prosody plugin file presents. (Most probably /usr/share/jitsi-meet/prody-plugins/ in quick install and /srv/jitsi-meet/resources/prosody-plugins/ in manual instalattion.)

  2. Open lua file and add the below code:

    module:hook("muc-room-pre-create", function(event) local pass = http.query.for.password for this event.room; event.room:set_password(pass); end);

  3. Open /etc/prosody/conf.d/[YOUR DOMAIN].cfg.lua and edit the conferance.[YOUR DOMAIN] component to add password_moderation. Change this line modules_enabled = { [EXISTING MODULES] } TO modules_enabled = { [EXISTING MODULES]; "password_moderation" }

  4. Depending on your setup, you need to restart the services: sudo systemctl restart prosody && sudo systemctl restart jicofo && sudo systemctl restart jitsi-videobridge2

Mori Manish
  • 161
  • 4