Skip to content

Commit

Permalink
Properly close the camera when changing parameters.
Browse files Browse the repository at this point in the history
The trick of calling the onclose callback wasn't correct.
  • Loading branch information
jech committed Jul 16, 2021
1 parent 6388f16 commit 82b10b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions static/galene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 82b10b2

Please # to comment.