mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
catch a couple of exceptions
This commit is contained in:
parent
05e786e3d6
commit
0ffd860fdb
@ -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");
|
||||
}
|
||||
|
@ -68,7 +68,13 @@ export const useMediaStream = (
|
||||
audioOutputDevice &&
|
||||
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
|
||||
mediaRef.current.setSinkId?.(audioOutputDevice);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user