From 2033a6769cd1eec82f07cc7b12fdb5cf7a751b3b Mon Sep 17 00:00:00 2001 From: ian ramzy Date: Mon, 30 Mar 2020 00:25:07 -0400 Subject: [PATCH] auto stop screen capture --- public/js/chat.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/js/chat.js b/public/js/chat.js index e9346c8..dc30f43 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -381,6 +381,9 @@ function swap() { switchStreamHelper(stream); }); } else { + + VideoChat.localVideo.srcObject.getTracks().forEach(track => track.stop()); + navigator.mediaDevices.getUserMedia({ video: true, audio: true