From 8f2f565833a6c0e16ce731c803d33bd255720d64 Mon Sep 17 00:00:00 2001 From: Nicolas Girault Date: Tue, 15 Feb 2022 15:51:57 +0100 Subject: [PATCH] Support all browsers when recording is disabled This allow to use react-media-recorder with all kind of browser and handle browser incompatibility thanks to undefined audio & video. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 72205d7..babd93c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -112,7 +112,7 @@ export function useReactMediaRecorder({ }, [audio, video, screen]); useEffect(() => { - if (!window.MediaRecorder) { + if (!window.MediaRecorder && (screen || audio)) { throw new Error("Unsupported Browser"); }