From e21094b5254192a9e86f29b27fb38dca563575c0 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Tue, 31 May 2022 16:21:35 -0400 Subject: [PATCH] Fix crash when setting audio output on Chrome for Android --- src/video-grid/useMediaStream.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video-grid/useMediaStream.js b/src/video-grid/useMediaStream.js index 15efcff..2432a73 100644 --- a/src/video-grid/useMediaStream.js +++ b/src/video-grid/useMediaStream.js @@ -55,7 +55,8 @@ export function useMediaStream(stream, audioOutputDevice, mute = false) { mediaRef.current !== undefined ) { console.log(`useMediaStream setSinkId ${audioOutputDevice}`); - mediaRef.current.setSinkId(audioOutputDevice); + // Chrome for Android doesn't support this + mediaRef.current.setSinkId?.(audioOutputDevice); } }, [audioOutputDevice]);