From 82b10b2c102ba233114d3832da36d127ca36a6da Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sat, 17 Jul 2021 00:38:26 +0200 Subject: [PATCH] Properly close the camera when changing parameters. The trick of calling the onclose callback wasn't correct. --- static/galene.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/galene.js b/static/galene.js index 816324a..4376064 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1327,9 +1327,10 @@ async function addLocalMedia(localId) { } let old = serverConnection.findByLocalId(localId); - if(old && old.onclose) { + if(old) { // make sure that the camera is released before we try to reopen it - old.onclose.call(old, true); + removeFilter(old); + stopStream(old.stream); } let constraints = {audio: audio, video: video};