stop video mediastream

This commit is contained in:
wataru 2023-01-15 10:38:20 +09:00
parent cda032aaf9
commit 13e0d7618e
2 changed files with 3 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,8 @@ import { ClientState } from "@dannadori/voice-changer-client-js";
const reloadDevices = async () => {
try {
await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
const ms = await navigator.mediaDevices.getUserMedia({ video: false, audio: true });
ms.getTracks().forEach(x => { x.stop() })
} catch (e) {
console.warn("Enumerate device error::", e)
}