This commit is contained in:
Timothy J. Baek
2024-06-07 15:18:45 -07:00
parent f4a15f9590
commit 32c4748749
38 changed files with 130 additions and 12 deletions

View File

@@ -855,19 +855,26 @@
class=" text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-850 transition rounded-full p-1.5 mr-0.5 self-center"
type="button"
on:click={async () => {
const res = await navigator.mediaDevices
.getUserMedia({ audio: true })
.catch(function (err) {
toast.error(
$i18n.t(`Permission denied when accessing microphone: {{error}}`, {
error: err
})
);
return null;
});
try {
const res = await navigator.mediaDevices
.getUserMedia({ audio: true })
.catch(function (err) {
toast.error(
$i18n.t(
`Permission denied when accessing microphone: {{error}}`,
{
error: err
}
)
);
return null;
});
if (res) {
recording = true;
if (res) {
recording = true;
}
} catch {
toast.error($i18n.t('Permission denied when accessing microphone'));
}
}}
>