From 4e3345482fe083ffcc3e67dca50d5c24239d0fee Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 28 Jun 2022 15:12:59 +0100 Subject: [PATCH] Move setsinkid inside if statement --- src/video-grid/useMediaStream.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video-grid/useMediaStream.ts b/src/video-grid/useMediaStream.ts index cce1907..2b8f8f7 100644 --- a/src/video-grid/useMediaStream.ts +++ b/src/video-grid/useMediaStream.ts @@ -72,11 +72,11 @@ export const useMediaStream = ( console.log( `useMediaStream setting output setSinkId ${audioOutputDevice}` ); + // Chrome for Android doesn't support this + mediaRef.current.setSinkId(audioOutputDevice); } else { console.log("Can't set output - no setsinkid"); } - // Chrome for Android doesn't support this - mediaRef.current.setSinkId?.(audioOutputDevice); } }, [audioOutputDevice]);