diff --git a/src/sound/usePttSounds.ts b/src/sound/usePttSounds.ts index 0bcc8a71..9f6e31d9 100644 --- a/src/sound/usePttSounds.ts +++ b/src/sound/usePttSounds.ts @@ -58,8 +58,12 @@ export const usePTTSounds = (): PTTSounds => { break; } if (ref.current) { - ref.current.currentTime = 0; - await ref.current.play(); + try { + ref.current.currentTime = 0; + await ref.current.play(); + } catch (e) { + console.log("Couldn't play sound effect", e); + } } else { console.log("No media element found"); } diff --git a/src/video-grid/useMediaStream.ts b/src/video-grid/useMediaStream.ts index 5565ab21..2b8f8f72 100644 --- a/src/video-grid/useMediaStream.ts +++ b/src/video-grid/useMediaStream.ts @@ -68,9 +68,15 @@ export const useMediaStream = ( audioOutputDevice && mediaRef.current !== undefined ) { - console.log(`useMediaStream setSinkId ${audioOutputDevice}`); - // Chrome for Android doesn't support this - mediaRef.current.setSinkId?.(audioOutputDevice); + if (mediaRef.current.setSinkId) { + 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"); + } } }, [audioOutputDevice]);