From 2aca2f18d541ea66f1fa7ce290237959d896b51c Mon Sep 17 00:00:00 2001 From: Kasper Seweryn Date: Mon, 12 Jun 2023 15:31:34 +0200 Subject: [PATCH] feat(playback): handle audio play errors Part-of: --- front/src/api/player.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/front/src/api/player.ts b/front/src/api/player.ts index f84eb62f9..6a1ea4582 100644 --- a/front/src/api/player.ts +++ b/front/src/api/player.ts @@ -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 () {