ignore AbortError from audio.play()

This commit is contained in:
Thomas Amland 2021-04-25 11:26:06 +02:00
parent 92bead8b6b
commit 8229276683

View File

@ -69,7 +69,15 @@ export class AudioController {
this.audio.volume = 0.0 this.audio.volume = 0.0
if (options.paused !== true) { if (options.paused !== true) {
await this.audio.play() try {
await this.audio.play()
} catch (error) {
if (error.name === 'AbortError') {
console.warn(error)
return
}
throw error
}
this.fadeIn() this.fadeIn()
} }
} }