Skip to content

Commit 80e46c9

Browse files
authored
fix(camera-recorder): stop camera on navigation (CorentinTh#782)
* Stopping camera when user switches to another page * Missing ;
1 parent 7a70dbb commit 80e46c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tools/camera-recorder/camera-recorder.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const permissionCannotBePrompted = ref(false);
2828
const {
2929
stream,
3030
start,
31+
stop,
3132
enabled: isMediaStreamAvailable,
3233
} = useUserMedia({
3334
constraints: computed(() => ({
@@ -83,6 +84,8 @@ watchEffect(() => {
8384
}
8485
});
8586
87+
onBeforeUnmount(() => stop());
88+
8689
async function requestPermissions() {
8790
try {
8891
await ensurePermissions();

0 commit comments

Comments
 (0)