1
Fork 0

Properly close the camera when changing parameters.

The trick of calling the onclose callback wasn't correct.
This commit is contained in:
Juliusz Chroboczek 2021-07-17 00:38:26 +02:00
parent 6388f16e87
commit 82b10b2c10
1 changed files with 3 additions and 2 deletions

View File

@ -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};