1

如何使用外部 API 设置 jitsi meet video room 的密码,我可以尝试使用示例代码,但对我不起作用,创建房间但没有密码,如下所示:

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);
4

2 回答 2

0

通过查询外部服务和实现您的自定义模块,在每次创建时检查并设置密码。

  1. 创建名称为 mod_password_moderation.lua 的 lua 文件,您的韵律插件文件将在其中显示。(很可能是 /usr/share/jitsi-meet/prody-plugins/ 快速安装和 /srv/jitsi-meet/resources/prosody-plugins/ 手动安装。)

  2. 打开lua文件并添加以下代码:

    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. 打开 /etc/prosody/conf.d/[YOUR DOMAIN].cfg.lua 并编辑 conferance.[YOUR DOMAIN] 组件以添加 password_moderation。modules_enabled = { [EXISTING MODULES] }将此 行更改 为modules_enabled = { [EXISTING MODULES]; "password_moderation" }

  4. 根据您的设置,您需要重新启动服务: sudo systemctl restart prosody && sudo systemctl restart jicofo && sudo systemctl restart jitsi-videobridge2

于 2020-09-18T08:18:49.877 回答
0

当第一个人进入房间时,他将拥有管理员权限。我们可以在那个时候设置密码。

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

然后下一位加入的参与者将输入所需的密码。

api.on('passwordRequired', function () {
    api.executeCommand('password', pwd);
}
于 2020-09-16T11:20:47.300 回答