catch a couple of exceptions

This commit is contained in:
David Baker 2022-06-15 21:37:42 +01:00
commit 0ffd860fdb
2 changed files with 13 additions and 3 deletions

View file

@ -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");
}