Get participantID of user already in room

Is there a possibility to get the participant ID of a user which is already in the room through the iFrame API? I’m aware that I can get the participantID of new joining users with participantJoined or that I can get the name of a user when I have the participantID with api.getDisplayName(participantId)
Is there a possibility to achieve the opposite? I have a moderator which name is always the same but he is the first in the room. I need to get his participantID so that I can sent him textMessages via the API

I would need to get a userlist of the room or something like getParticipantID(DisplayName)
Any ideas how to achieve that?


If someone needs to to the same, here is my workaround:
I’ve added a function to external_api.js which retrieves a object with all current users in the room. There you can see all userIDs and corresponding displayNames:

    const participlist = this._participants;
    return participlist;

on client side, I check if the displayName is equal to “moderator” and if yes, I retrieve the ID of the moderator.

be aware that this is a customization of external_api.js, you have to manually add this function to external_api.js of your jitsi-deployment otherwise it won’t work

api._participants gives a similar list on the client side.

1 Like

didn’t know that - this is definitely the easier way - thanks!