[IFrame API] Sets the password for the room

Hi,

I’m currently trying to add a password to my room using the IFrame API. My code is below

           <script src="https://meet.jit.si/external_api.js"></script>
            <script>
            var domain = "meet.jit.si";
            var options = {
                roomName: "xxxx",
                width: '100%',
                height: '100%',
                parentNode: undefined,
                interfaceConfigOverwrite: {
                    TOOLBAR_BUTTONS: [
        'microphone', 'camera', 'closedcaptions', 'desktop', 'fullscreen',
        'fodeviceselection', 'hangup', 'profile', 'chat', 'recording',
        'livestreaming', 'etherpad', 'sharedvideo', 'settings', 'raisehand',
        'videoquality', 'filmstrip', 'invite', 'feedback', 'stats', 'shortcuts',
        'tileview', 'videobackgroundblur', 'download', 'help', 'mute-everyone'
        ]
                }
            }
            var api = new JitsiMeetExternalAPI(domain, options);
            api.executeCommand('password', 'The Password');
        </script>

It doesn’t work, there is no pwd.

I read on an other post that I need to execute the password command after joining.
I tried that :

api.addEventListener('videoConferenceJoined', afterJoining());

function afterJoining(){
   alert('I Joined the conference!');
   api.executeCommand('password', 'MyPwd');
   return 
}

But still not working. Someone know What should I do?

Thanks in advance!

Hi

Not sure if you have found a solution, but based on the documentation you should check you are the moderator before setting the password.

Check the example “// set new password for channel” here https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe