From 80e46c92922c1a886be08f4747b6c9f791a625e8 Mon Sep 17 00:00:00 2001 From: Isaiah <66272034+isaiah-j@users.noreply.github.com> Date: Wed, 29 Nov 2023 07:58:07 -0500 Subject: [PATCH] fix(camera-recorder): stop camera on navigation (#782) * Stopping camera when user switches to another page * Missing ; --- src/tools/camera-recorder/camera-recorder.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/camera-recorder/camera-recorder.vue b/src/tools/camera-recorder/camera-recorder.vue index 34ce39aa..23fedd8c 100644 --- a/src/tools/camera-recorder/camera-recorder.vue +++ b/src/tools/camera-recorder/camera-recorder.vue @@ -28,6 +28,7 @@ const permissionCannotBePrompted = ref(false); const { stream, start, + stop, enabled: isMediaStreamAvailable, } = useUserMedia({ constraints: computed(() => ({ @@ -83,6 +84,8 @@ watchEffect(() => { } }); +onBeforeUnmount(() => stop()); + async function requestPermissions() { try { await ensurePermissions();