mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-20 06:55:06 -04:00
fix(camera-recorder): stop camera on navigation (#782)
* Stopping camera when user switches to another page * Missing ;
This commit is contained in:
parent
7a70dbbe0c
commit
80e46c9292
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue