Disable Username input box in when joining the meeting

How can I disable this input box so that users can’t change the default username provided

I have set the name there using this code

api.executeCommand(‘displayName’, localDisplayName);

You can use CSS to hide that field. I think there’s been some conversation around this before on the forum; do a search.

Possibly related:

There are 2 parts to the solution there:

  1. Custom CSS to disable the user input box without having to modify and recompile Jitsi Meet.

    • N.B. this will not stop a motivated person from changing their name since it is easily overriden, and is more a UX cue that name change won’t be accepted.
    • Use display: none instead of pointer-events: none; if you want to hide the field completely.
  2. Using a prosody module to force display name to what is specified in JWT token. So even if users manage to override UI controls and submit an display name change, other users will still see the original name

Thank you but how can I apply CSS to the iframe.
I am loading the jitsi meet in popup model which only loads after the click, not at the beginning of the page load.

One way i found that can prevent user not to change username is this:

api.executeCommand('displayName', localDisplayName);
api.addEventListeners({
      displayNameChange: function (params) {
           // alert("You can't change the name");
           return this.executeCommand('displayName', localDisplayName);
      }
});

In case an alert is needed it will give 2 alerts so it is fine for me without it now.
If anyone knows how to get displayname value and check if it is changed or not to prevent multiple alerts then that will be also great.

1 Like

Are you using meet.jit.si or your own deployment? If you’re using meet.jit.si, then I don’t think you can override the CSS. If you have you own deployment, you can update one of the html files in /usr/share/jitsi-meet, e.g. head.html.

I suspect the reason you’re getting multiple alerts is because you are trying to change back the display name on displayNameChange event, but that change will triggers another displayNameChange event and so on.

I’m afraid I do not know how (or if) you can disable name changing if using the public meet.jit.si server. Someone who’s really insistant on changing their display name could just work out the room name, then join directly and bypass the restrictions imposed using the IFrame API.