fix(media): catch autoplay rejections from play()
CI / Build & Quality Checks (push) Successful in 5m10s
CI / Docker image build & smoke test (push) Skipped
CI / Trigger Desktop Build (push) Successful in 7s
CI / Secret scan (gitleaks) (push) Canceled after 0s
CI / Playwright smoke (e2e) (push) Canceled after 0s
CI / Build & Quality Checks (push) Successful in 5m10s
CI / Docker image build & smoke test (push) Skipped
CI / Trigger Desktop Build (push) Successful in 7s
CI / Secret scan (gitleaks) (push) Canceled after 0s
CI / Playwright smoke (e2e) (push) Canceled after 0s
Notification sounds called `audio.play()` without handling the promise, so every message that arrived before the user interacted with the page (e.g. right after launch) logged an uncaught NotAllowedError — 15 in a short test run. Same pattern in the video thumbnail loader, the voice preview (which now also resets its Play button) and useMediaPlay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
343de27cad
commit
23649f1255
@@ -134,7 +134,9 @@ export const loadVideoElement = (url: string): Promise<HTMLVideoElement> =>
|
||||
|
||||
video.src = url;
|
||||
video.load();
|
||||
video.play();
|
||||
// Only nudges the decoder toward the first frame; `onloadeddata` settles
|
||||
// the promise, so an autoplay refusal here is harmless.
|
||||
video.play().catch(() => undefined);
|
||||
});
|
||||
|
||||
export const getThumbnailDimensions = (width: number, height: number): [number, number] => {
|
||||
|
||||
Reference in New Issue
Block a user