From 0b87363d60d798c6b317b2df555cba7be91d4494 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 4 May 2020 13:32:04 +0200 Subject: [PATCH] Auto-stop recording when closing calls --- assets/js/components/calls/window.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index 7e5ba11b..269babb7 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -501,6 +501,10 @@ class CallWindow extends CustomEvents { async Close(propagate = true) { this.rootEl.remove(); + // Stop recording + if(this.isRecording) + this.startRecording(); + // Leave the call if(UserWebSocket.IsConnected) await ws("calls/leave", { @@ -1003,6 +1007,13 @@ class CallWindow extends CustomEvents { } + /** + * Check out whether we are currently recording video or not + */ + get isRecording() { + return this.hasOwnProperty("recorder"); + } + /** * Start / stop recording the streams */ @@ -1018,7 +1029,7 @@ class CallWindow extends CustomEvents { } // Start recording - if(!this.recorder) { + if(!this.isRecording) { // Determine the list of streams to save const streams = []