Jitsi-meet: Allow to prevent displayName change in config

Created on 6 Apr 2020  路  6Comments  路  Source: jitsi/jitsi-meet

Is your feature request related to a problem you are facing?
I currently cannot prevent an user to update his dsplay name. I'm setting it automatically and don't want him to be able to change it.

Describe the solution you'd like
Have a boolean parameter I can set in configOverwrite, which could be something like enableDisplayNameChange as true by default.

Describe alternatives you've considered
To prevent users doing it I made an event listener on displayNameChange to set it back, but it will seem strange in an UX point of view.

api config feature-request wontfix

All 6 comments

Try this:
setInterval(function(){
api.executeCommand('displayName', userFullName);
},1000);

@abhi0476 I know how to overwrite a display name, but allowing the user to update his name and set it back to previous feels strange in UX perspective.

I manage to unallow the editing by setting pointer-events: none to #localDisplayName on the jitsi server, but that would be better to be able to do it in the options of JitsiMeetExternalAPI

Agreed, developers should definitely look into it for future release...

If you use jwt token, you can set enableUserRolesBasedOnToken to true
This removes the profile editing from the user interface for token authenticated users.

However savvy users can still change their displayName from the browser console with api.executeCommand('displayName', 'newname');
I am looking for a solution to prevent this. Maybe an option to disable the displayName command from the API? Could it be the same option as enableUserRolesBasedOnToken?

It works for me with JitsiMeetExternalAPI:

<script src='https://meet.jit.si/external_api.js'></script>
<script>
  // check conference state (join page or videochat)
  let videoConferenceJoined = false;

  // set with an string to default value, "John Doe" by example
  let localDisplayName = null;

  const domain = 'meet.jit.si';
  const options = {...}; // put your own options here
  const api = new JitsiMeetExternalAPI(domain, options);

  // Force default value (You can comment this line if localDisplayName is null)
  api.executeCommand('displayName', localDisplayName);

  api.addEventListeners({
      displayNameChange: function(params){
        // if is Videochat, set the Join Page displayName
        if (videoConferenceJoined){
          return this.executeCommand('displayName', localDisplayName);
        }

        // if is Join Page, update global variable (localDisplayName) with input value
        localDisplayName = params.displayname;
      },
      videoConferenceJoined: function() {
       // flag the conference starts
        videoConferenceJoined = true;
      }
  });
</script>

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saghul picture saghul  路  106Comments

adammarketing picture adammarketing  路  90Comments

kangzhe0000 picture kangzhe0000  路  39Comments

andres934 picture andres934  路  54Comments

carotkut94 picture carotkut94  路  45Comments