chore: catch error when trying to play pop sound
Safari does not allow playing sound without user interaction, so we'll just silently catch and ignore the error until we have a better solution.
This commit is contained in:
parent
a92eb31ab3
commit
929d4f4023
@ -3,6 +3,10 @@ import popSoundFile from '@/assets/audio/pop.mp3'
|
|||||||
export const playSoundWhenDoneKey = 'playSoundWhenTaskDone'
|
export const playSoundWhenDoneKey = 'playSoundWhenTaskDone'
|
||||||
|
|
||||||
export function playPopSound() {
|
export function playPopSound() {
|
||||||
const popSound = new Audio(popSoundFile)
|
try {
|
||||||
popSound.play()
|
const popSound = new Audio(popSoundFile)
|
||||||
|
popSound.play()
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Could not play pop sound:', e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user