From 1de48a20a15690f5a441e461819c79233f5a6181 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 13 Apr 2020 19:12:43 +0200 Subject: [PATCH] Can stop streaming --- assets/js/components/calls/window.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index 70e0fbf6..54c16bf6 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -212,6 +212,15 @@ class CallWindow extends CustomEvents { } }, + // Stop streaming + { + icon: "fa-stop", + text: "Stop streaming", + onclick: () => { + this.closeMainPeer() + } + } + ] //Add buttons @@ -511,8 +520,10 @@ class CallWindow extends CustomEvents { const el = this.videoEls.get(peerID); this.videoEls.delete(peerID) - el.pause() - el.parentNode.remove() + if(el) { + el.pause() + el.parentNode.remove() + } } /** @@ -818,6 +829,9 @@ class CallWindow extends CustomEvents { this.mainStream.getTracks().forEach(e => e.stop()) delete this.mainStream } + + this.removeVideoElement(userID()) + this.refreshButtonsState() } /**