feat(playback): handle audio play errors

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2469>
2151-refused-to-load-spa-manifest-json-2
Kasper Seweryn 2023-06-12 15:31:34 +02:00 zatwierdzone przez Marge
rodzic 6b31cba294
commit 2aca2f18d5
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -131,7 +131,12 @@ export class HTMLSound implements Sound {
}
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 () {