diff options
author | 2023-11-29 07:58:07 -0500 | |
---|---|---|
committer | 2023-11-29 13:58:07 +0100 | |
commit | 80e46c92922c1a886be08f4747b6c9f791a625e8 (patch) | |
tree | 9282b5e2f48275f901eeca407e307497270ee2e5 /src/tools/camera-recorder/camera-recorder.vue | |
parent | 7a70dbbe0cd2b6a0aa06708368fb3e1d1359a49e (diff) | |
download | it-tools-80e46c92922c1a886be08f4747b6c9f791a625e8.tar.gz it-tools-80e46c92922c1a886be08f4747b6c9f791a625e8.tar.zst it-tools-80e46c92922c1a886be08f4747b6c9f791a625e8.zip |
fix(camera-recorder): stop camera on navigation (#782)
* Stopping camera when user switches to another page
* Missing ;
Diffstat (limited to 'src/tools/camera-recorder/camera-recorder.vue')
-rw-r--r-- | src/tools/camera-recorder/camera-recorder.vue | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/camera-recorder/camera-recorder.vue b/src/tools/camera-recorder/camera-recorder.vue index 34ce39a..23fedd8 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(); |