diff --git a/react/src/pages/AntMedia.js b/react/src/pages/AntMedia.js index 17393b40..0866daf2 100644 --- a/react/src/pages/AntMedia.js +++ b/react/src/pages/AntMedia.js @@ -85,6 +85,7 @@ function getMediaConstraints(videoSendResolution, frameRate) { }; break; default: + constraint = { video: true }; break; } @@ -1277,6 +1278,11 @@ function AntMedia(props) { useEffect(() => { if (devices.length > 0) { checkAndUpdateVideoAudioSources(); + } else { + mediaConstraints = getMediaConstraints(null, 20); + navigator.mediaDevices.enumerateDevices().then(devices => { + setDevices(devices); + }); } }, [devices]); // eslint-disable-line react-hooks/exhaustive-deps