diff --git a/src/state.ts b/src/state.ts index 8163f5c..c029ed7 100644 --- a/src/state.ts +++ b/src/state.ts @@ -207,8 +207,13 @@ async function switchMedia() { delete constraints.video } } - - const media = await getUserMedia(constraints) + let media = await getUserMedia(constraints) + if (media.error) { + const audioOnly: MediaStreamConstraints = { + audio, + } + media = await getUserMedia(audioOnly) + } state.error = media.error stream = media.stream