myUserId()

Hi, trying to identify and pass my User ID

api._myUserId() returns the correct ID in the console but in my page something like

Me = api._myUserID();

or to be honest any code with myUserID returns “myUserId is not defined”

Clearly I am missing smth, not terribly comfortable with JS to be honest so sorry for dumb Q

J

Where are you calling this? Can you provide a full code sample?

Hi Saghul,

Yes, I have an image with an onclick event calling MeView();

function is:

function MeView() {
var Me = api._myUserId;
api.executeCommand(‘setLargeVideoParticipant’, ‘Me’);
}

api is define as such

var api = new JitsiMeetExternalAPI(domain, options);

Can I only use myUserid() if I create the conf using lowlevel API?

Thx
J

That is a private field, you shouldn’t access it directly. You can listen to the videoConferenceJoined event, and that contains your own ID.

Understood, thx a lot saghul