Skip to content

Commit

Permalink
Turn camera off after image capture
Browse files Browse the repository at this point in the history
  • Loading branch information
rohhn authored and rohhn committed Jan 30, 2024
1 parent d03cf76 commit d0039f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions svelte_client/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@
const data = canvas.toDataURL("image/png");
// Stop video after image capture
if (video) {
const tracks = video.srcObject.getTracks();
tracks.forEach(track => track.stop());
video.pause();
}
getEmotion(data);
}
Expand Down

0 comments on commit d0039f4

Please sign in to comment.