From 6561ef5d15b0b8b35fbbdc065d4dea7ed5558aa3 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 8 Mar 2026 15:54:58 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20mobile=20fight=20playback=20=E2=80=94=20?= =?UTF-8?q?prevent=20sprite=20loading=20hangs,=20TTS=20stalls,=20unlock=20?= =?UTF-8?q?audio=20from=20gesture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Unified speakAsync/speakAsyncWithRate into _speakAsyncCore with: - 500ms startup check: bail immediately if speech won't start (mobile/no gesture) - 8s safety timeout (down from 15s) to prevent blocking - iOS-safe keepalive: only do Chrome pause/resume workaround on desktop Chrome - Immediate bail when no voices loaded - Sprite loading: 5s timeout per sprite prevents mobile hangs from stuck Image decodes - Scene creation: 10s timeout in FightViewer so overlay/voice flow continues even if canvas fails on mobile - playRound: bail gracefully if fighter sprites missing instead of crashing - Global audio unlock: first touch/click on site unlocks AudioContext + SpeechSynthesis - Practice button pre-unlocks audio while still in user gesture context Co-Authored-By: Claude Opus 4.6 --- frontend/src/App.vue | 13 ++++ frontend/src/components/FightViewer.vue | 27 ++++++-- frontend/src/game/FightScene.ts | 34 +++++++--- frontend/src/game/sounds.ts | 85 +++++++++++-------------- frontend/src/pages/JoinBoutPage.vue | 3 + 5 files changed, 97 insertions(+), 65 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 8e20f9d..b750dce 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,6 +1,19 @@