Getting the displayNames of the participants

Hi,
I’m using lib-jitsi-meet to use Jitsi inside my React web app.
I’m setting the username using setDisplayName() api. Is there a method (like getDisplayName(some id that I get when user joins)) to get the display name of participant so I can give an user joined alert with display name?

1 Like

Is there any suggestion/answer for this question? Sir. @damencho

hey @nikhilx

based on my research, you may use , room.getParticipantById(‘abcd1234’); or
you may use some other options via JitsiMeetJS.events

  • USER_JOINED - new user joined a conference. (parameters - id(string), user(JitsiParticipant))
  • USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))

and now you must try to get the displayName of the participant who joined by using the second parameter

first you should make an event like the code below:

room.on(JitsiMeetJS.events.conference.USER_JOINED, onUserJoined);

with

function onUserJoined(id, user){
    console.log('user join with display name : '+user.getDisplayName());
}

you may get more data from the participant here in this link:

Hey @ne018
I had solved it using the same, room.getParticipantById("abc")._displayName but forgot to update it here.
Thanks for updating. Would be helpful to others that encounter the same problem

1 Like