Move setsinkid inside if statement

This commit is contained in:
David Baker 2022-06-28 15:12:59 +01:00
parent 0ffd860fdb
commit 4e3345482f

View file

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