Fully close Jitsi conferences on errors (#22060)
By not closing Jitsi fully when an error occurs, it could get stuck in PiP mode with no way to dismiss.
This commit is contained in:
parent
abb31c9b01
commit
9cb0185ec2
1 changed files with 12 additions and 8 deletions
|
@ -301,6 +301,15 @@ async function notifyHangup() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function closeConference() {
|
||||||
|
switchVisibleContainers();
|
||||||
|
document.getElementById("jitsiContainer").innerHTML = "";
|
||||||
|
|
||||||
|
if (skipOurWelcomeScreen) {
|
||||||
|
skipToJitsiSplashScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// event handler bound in HTML
|
// event handler bound in HTML
|
||||||
function joinConference(audioDevice?: string, videoDevice?: string) {
|
function joinConference(audioDevice?: string, videoDevice?: string) {
|
||||||
let jwt;
|
let jwt;
|
||||||
|
@ -386,20 +395,15 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
|
||||||
meetApi = null;
|
meetApi = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
meetApi.on("readyToClose", () => {
|
meetApi.on("readyToClose", closeConference);
|
||||||
switchVisibleContainers();
|
|
||||||
document.getElementById("jitsiContainer").innerHTML = "";
|
|
||||||
|
|
||||||
if (skipOurWelcomeScreen) {
|
|
||||||
skipToJitsiSplashScreen();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
meetApi.on("errorOccurred", ({ error }) => {
|
meetApi.on("errorOccurred", ({ error }) => {
|
||||||
if (error.isFatal) {
|
if (error.isFatal) {
|
||||||
// We got disconnected. Since Jitsi Meet might send us back to the
|
// We got disconnected. Since Jitsi Meet might send us back to the
|
||||||
// prejoin screen, we're forced to act as if we hung up entirely.
|
// prejoin screen, we're forced to act as if we hung up entirely.
|
||||||
notifyHangup();
|
notifyHangup();
|
||||||
|
meetApi = null;
|
||||||
|
closeConference();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue