Merge pull request #418 from thecodingmachine/fix/coWebsiteBlocking

FIX: the jitsi iframe promise now throw an error if it cannot load in 10 secondes
This commit is contained in:
Kharhamel 2020-11-13 18:28:31 +01:00 committed by GitHub
commit 40e9570cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,8 +50,9 @@ class JitsiFactory {
delete options.jwt; delete options.jwt;
} }
return new Promise((resolve) => { return new Promise((resolve, reject) => {
options.onload = () => resolve(); //we want for the iframe to be loaded before triggering animations. options.onload = () => resolve(); //we want for the iframe to be loaded before triggering animations.
setTimeout(() => reject('Failed to load the iframe'), 10000); //failsafe in case the iframe is deleted before loading
this.jitsiApi = new window.JitsiMeetExternalAPI(domain, options); this.jitsiApi = new window.JitsiMeetExternalAPI(domain, options);
this.jitsiApi.executeCommand('displayName', playerName); this.jitsiApi.executeCommand('displayName', playerName);