fix/not asking for mic permissions (first time)
This commit is contained in:
parent
99d2c6f4d7
commit
0ddeda1f1c
1 changed files with 6 additions and 1 deletions
|
|
@ -135,6 +135,11 @@ export default function Recorder({ closeModal, step, setStep }: Props) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getAudioDevices() {
|
async function getAudioDevices() {
|
||||||
try {
|
try {
|
||||||
|
const stream = await navigator.mediaDevices.getUserMedia({
|
||||||
|
audio: { echoCancellation: false },
|
||||||
|
});
|
||||||
|
stream.getTracks().forEach((track) => track.stop()); // release the stream
|
||||||
|
|
||||||
const devices = await navigator.mediaDevices.enumerateDevices();
|
const devices = await navigator.mediaDevices.enumerateDevices();
|
||||||
const audioDevices = devices.filter(
|
const audioDevices = devices.filter(
|
||||||
(device) => device.kind === "audioinput"
|
(device) => device.kind === "audioinput"
|
||||||
|
|
@ -368,7 +373,7 @@ export default function Recorder({ closeModal, step, setStep }: Props) {
|
||||||
{submitting ? (
|
{submitting ? (
|
||||||
<>
|
<>
|
||||||
<svg
|
<svg
|
||||||
className="-ml-1 mr-3 h-5 w-5 animate-spin text-white"
|
className="animate-spin -ml-1 mr-3 h-5 w-5 text-white"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue