Merge pull request #366 from robintown/chrome-android-sink

Fix crash when setting audio output on Chrome for Android
This commit is contained in:
Robin 2022-06-01 09:14:41 -04:00 committed by GitHub
commit f1bdad0d7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]);