1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 15:25:48 +01:00

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

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