catch a couple of exceptions
This commit is contained in:
@@ -58,8 +58,12 @@ export const usePTTSounds = (): PTTSounds => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ref.current) {
|
if (ref.current) {
|
||||||
ref.current.currentTime = 0;
|
try {
|
||||||
await ref.current.play();
|
ref.current.currentTime = 0;
|
||||||
|
await ref.current.play();
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Couldn't play sound effect", e);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("No media element found");
|
console.log("No media element found");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,13 @@ export const useMediaStream = (
|
|||||||
audioOutputDevice &&
|
audioOutputDevice &&
|
||||||
mediaRef.current !== undefined
|
mediaRef.current !== undefined
|
||||||
) {
|
) {
|
||||||
console.log(`useMediaStream setSinkId ${audioOutputDevice}`);
|
if (mediaRef.current.setSinkId) {
|
||||||
|
console.log(
|
||||||
|
`useMediaStream setting output setSinkId ${audioOutputDevice}`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log("Can't set output - no setsinkid");
|
||||||
|
}
|
||||||
// Chrome for Android doesn't support this
|
// Chrome for Android doesn't support this
|
||||||
mediaRef.current.setSinkId?.(audioOutputDevice);
|
mediaRef.current.setSinkId?.(audioOutputDevice);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user