From 79ad065d6a52dbe82164982b5f5d2ac3089ad5f1 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 20 May 2022 16:25:28 -0400 Subject: [PATCH] Stop Jitsi if we time out while connecting to a video room (#8659) --- src/stores/VideoChannelStore.ts | 5 +++++ src/stores/widgets/ElementWidgetActions.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/src/stores/VideoChannelStore.ts b/src/stores/VideoChannelStore.ts index 9ab521b50f..0e249ac02f 100644 --- a/src/stores/VideoChannelStore.ts +++ b/src/stores/VideoChannelStore.ts @@ -190,6 +190,11 @@ export default class VideoChannelStore extends AsyncStoreWithClient { messaging.off(`action:${ElementWidgetActions.UnmuteVideo}`, this.onUnmuteVideo); messaging.off(`action:${ElementWidgetActions.HangupCall}`, this.onHangup); + if (messaging.transport.ready) { + // The messaging still exists, which means Jitsi might still be going in the background + messaging.transport.send(ElementWidgetActions.ForceHangupCall, {}); + } + this.emit(VideoChannelEvent.Disconnect, roomId); throw new Error(`Failed to join call in room ${roomId}: ${e}`); diff --git a/src/stores/widgets/ElementWidgetActions.ts b/src/stores/widgets/ElementWidgetActions.ts index 117c4b47f3..df82bf3b1f 100644 --- a/src/stores/widgets/ElementWidgetActions.ts +++ b/src/stores/widgets/ElementWidgetActions.ts @@ -21,6 +21,7 @@ export enum ElementWidgetActions { WidgetReady = "io.element.widget_ready", JoinCall = "io.element.join", HangupCall = "im.vector.hangup", + ForceHangupCall = "io.element.force_hangup", CallParticipants = "io.element.participants", MuteAudio = "io.element.mute_audio", UnmuteAudio = "io.element.unmute_audio",