Setting password in embedded page

Hi,
I want to embed Jitsi in a webpage in order to control just a few options; the most important one is setting a password.
But I can’t get that option to work. I put in:

var domain = ‘meet.jit.si’;
var options = {

}
var api = new JitsiMeetExternalAPI(domain, options);
api.executeCommand(‘displayName’, ‘Hans’);
api.executeCommand(‘password’, ‘MyPwd’);

The ‘displayName’ works, but the password does not. What am I missing?
Thanx for help,
Hans

You need to execute the password command after joining. After receiving videoConferenceJoined event.

Thanks you so much Damencho. But I still can’t get it to work. Nog being familiar with event emitters, I used the old (but I take it still functional) addEventListener method:

api.addEventListener('videoConferenceJoined', afterJoining());

function afterJoining(){
	alert('I Joined the conference!');
	api.executeCommand('password', 'MyPwd');
	return 
}

The ‘I joined the conference’ message duly appears but still no password setting.
What did I do wrong?

(And, by the way, is there a code-snipped somewhere showing the client-side use of an event emitter?)

Hi, got the exact same issue.