feat(playback): handle audio play errors

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2469>
This commit is contained in:
Kasper Seweryn 2023-06-12 15:31:34 +02:00 committed by Marge
parent 6b31cba294
commit 2aca2f18d5
1 changed files with 6 additions and 1 deletions

View File

@ -131,7 +131,12 @@ export class HTMLSound implements Sound {
} }
async play () { async play () {
return this.#audio.play() try {
await this.#audio.play()
} catch (err) {
console.error('>> AUDIO PLAY ERROR', err, this)
this.isErrored.value = true
}
} }
async pause () { async pause () {