Fixing a race condition in Jitsi
When setting the name, in rare cases, Jitsi was not initialized yet and setting the name would cause a JS error. We are now waiting for Jitsi to be properly initialized before setting the name.
This commit is contained in:
@@ -197,7 +197,10 @@ class JitsiFactory {
|
|||||||
|
|
||||||
options.onload = () => doResolve(); //we want for the iframe to be loaded before triggering animations.
|
options.onload = () => doResolve(); //we want for the iframe to be loaded before triggering animations.
|
||||||
this.jitsiApi = new window.JitsiMeetExternalAPI(domain, options);
|
this.jitsiApi = new window.JitsiMeetExternalAPI(domain, options);
|
||||||
this.jitsiApi.executeCommand("displayName", playerName);
|
|
||||||
|
this.jitsiApi.addListener("videoConferenceJoined", () => {
|
||||||
|
this.jitsiApi?.executeCommand("displayName", playerName);
|
||||||
|
});
|
||||||
|
|
||||||
this.jitsiApi.addListener("audioMuteStatusChanged", this.audioCallback);
|
this.jitsiApi.addListener("audioMuteStatusChanged", this.audioCallback);
|
||||||
this.jitsiApi.addListener("videoMuteStatusChanged", this.videoCallback);
|
this.jitsiApi.addListener("videoMuteStatusChanged", this.videoCallback);
|
||||||
|
|||||||
Reference in New Issue
Block a user