Make sure user gave permission on enumerateDevices

This commit is contained in:
Stefano Brilli 2020-04-10 16:44:06 +02:00
parent c606d78753
commit 2834a20505
1 changed files with 1 additions and 0 deletions

View File

@ -79,6 +79,7 @@ export const DumpDialog = ({ trackIndexes }: { trackIndexes: number[] }) => {
useEffect(() => { useEffect(() => {
async function updateDeviceList() { async function updateDeviceList() {
await navigator.mediaDevices.getUserMedia({ audio: true });
let devices = await navigator.mediaDevices.enumerateDevices(); let devices = await navigator.mediaDevices.enumerateDevices();
let inputDevices = devices let inputDevices = devices
.filter(device => device.kind === 'audioinput') .filter(device => device.kind === 'audioinput')