Jitsi Meet API - Passwort Protection

Hey,

I’m trying to use the IFrame API to build a custom frontend, so my grandparents can easily create a conferenze (aka: just a big button which creates a conference with a random namen (beginning with a static part build from the domain) and password and shows it in a sidebar so they can just give us the numbers to us, because my grandma never used a computer before). This all worked fine and the creation process workes perfect. But then I tried to also created a custom page for others to join the conference, so that they can easily set their name and type in the random id and the password.

But I’ve ran into an issue: While I can set the conference password on the videoConferenceJoined-Event with the password command, I’m not able to automaticly fill it for the users who are trying to join the conference. It shows the jitsi iframe for a few seconds but then fails, in the console it states that it failed because of a required password.

(Edit: I’ve not used a custom configured jitsi instance, I used meet.jit.si!)

Has anybody else this issue too and maybe also found a solution? I stumbled over this thread but it didn’t helped me.

At the end I also would like to thank everybody contributing to this amazing program!

I had the same symptoms. In my case it was because the videoConferenceLeft event was firing when someone tried to join a password-protected session.

See here

Andy

1 Like

Thank your for this tip! It worked for me!

I’m trying to a similar task. But instead of a automatic password. I wanted a pre defined password.

Can you show that you did do have conference links with password?

I don’t have the code I used anymore, but It was rather simple. If you’re creating the conference, you can just use this line after the user joined, to set a password:

api.executeCommand("password", "my-password");

Just use this with your static password. This line also sets the password when someone is entering the protected room, but there’s also a prompt for that, so you don’t have to implement this, when the users who enter the conference have the password. Just be aware of the issue with the videoConferenceLeft-Event as mentioned by @AndyHenderson above.

Greetings!

1 Like

Here’s what we ended up with…

      const options = {
        roomName: fullMeetingName,
        width: '100%',
        height: '500px',
        parentNode: document.querySelector('#meeting'),
        noSsl: false,
        configOverwrite: {
          disableDeepLinking: true,
        }
      };
      jQ("#getName").hide("slow");
      meetAPI = new JitsiMeetExternalAPI("meet.jit.si", options);
      setTimeout(() => {
        meetAPI.addEventListener('passwordRequired', () => {
          meetAPI.executeCommand('password', password);
        });
        meetAPI.addEventListener('videoConferenceJoined', (response) => {
          meetAPI.executeCommand('displayName', userName);
          meetAPI.executeCommand('password', password);
        });
      }, 10);
      setTimeout(() => {
        meetAPI.addEventListener('videoConferenceLeft', () => {
          meetAPI.dispose();
          jQ("#meeting").text("");
          location.hash = '';
          location.hash = '#getName';
          jQ("#getName").show("slow");
        });
      }, 15000);`

Our code sets variables: meetingName, userName and password; and creates a div with the id meeting to host the API. The getName div is a form that collects the person’s name and the name of the meeting their joining.

Hope it helps,

Andy

2 Likes

It will!

I’ll save and show to my collegate who deals with code