Merge pull request #1850 from thecodingmachine/stabilize-cowebsite
Fix Jitsi co-website reloading
This commit is contained in:
commit
aa9b5e37c7
@ -2157,9 +2157,9 @@ ${escapedMessage}
|
|||||||
);
|
);
|
||||||
const jitsiUrl = allProps.get(GameMapProperties.JITSI_URL) as string | undefined;
|
const jitsiUrl = allProps.get(GameMapProperties.JITSI_URL) as string | undefined;
|
||||||
|
|
||||||
coWebsite.setJitsiLoadPromise(
|
coWebsite.setJitsiLoadPromise(() => {
|
||||||
jitsiFactory.start(roomName, this.playerName, jwt, jitsiConfig, jitsiInterfaceConfig, jitsiUrl)
|
return jitsiFactory.start(roomName, this.playerName, jwt, jitsiConfig, jitsiInterfaceConfig, jitsiUrl);
|
||||||
);
|
});
|
||||||
|
|
||||||
coWebsiteManager.loadCoWebsite(coWebsite).catch((err) => {
|
coWebsiteManager.loadCoWebsite(coWebsite).catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
@ -5,7 +5,7 @@ import { jitsiFactory } from "../JitsiFactory";
|
|||||||
import { SimpleCoWebsite } from "./SimpleCoWebsite";
|
import { SimpleCoWebsite } from "./SimpleCoWebsite";
|
||||||
|
|
||||||
export class JitsiCoWebsite extends SimpleCoWebsite {
|
export class JitsiCoWebsite extends SimpleCoWebsite {
|
||||||
private jitsiLoadPromise?: CancelablePromise<HTMLIFrameElement>;
|
private jitsiLoadPromise?: () => CancelablePromise<HTMLIFrameElement>;
|
||||||
|
|
||||||
constructor(url: URL, allowApi?: boolean, allowPolicy?: string, widthPercent?: number, closable?: boolean) {
|
constructor(url: URL, allowApi?: boolean, allowPolicy?: string, widthPercent?: number, closable?: boolean) {
|
||||||
const coWebsite = coWebsiteManager.searchJitsi();
|
const coWebsite = coWebsiteManager.searchJitsi();
|
||||||
@ -17,7 +17,7 @@ export class JitsiCoWebsite extends SimpleCoWebsite {
|
|||||||
super(url, allowApi, allowPolicy, widthPercent, closable);
|
super(url, allowApi, allowPolicy, widthPercent, closable);
|
||||||
}
|
}
|
||||||
|
|
||||||
setJitsiLoadPromise(promise: CancelablePromise<HTMLIFrameElement>): void {
|
setJitsiLoadPromise(promise: () => CancelablePromise<HTMLIFrameElement>): void {
|
||||||
this.jitsiLoadPromise = promise;
|
this.jitsiLoadPromise = promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export class JitsiCoWebsite extends SimpleCoWebsite {
|
|||||||
return reject("Undefined Jitsi start callback");
|
return reject("Undefined Jitsi start callback");
|
||||||
}
|
}
|
||||||
|
|
||||||
const jitsiLoading = this.jitsiLoadPromise
|
const jitsiLoading = this.jitsiLoadPromise()
|
||||||
.then((iframe) => {
|
.then((iframe) => {
|
||||||
this.iframe = iframe;
|
this.iframe = iframe;
|
||||||
this.iframe.classList.add("pixel");
|
this.iframe.classList.add("pixel");
|
||||||
|
Loading…
Reference in New Issue
Block a user