Skip to content

Surface a clear error when a video format can't be decoded - #31

Merged
dxviie merged 4 commits into
mainfrom
claude/video-format-support-xh80o4
Jul 30, 2026
Merged

dxviie merged 4 commits into
mainfrom
claude/video-format-support-xh80o4

Conversation

@dxviie

@dxviie dxviie commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Picking a video the browser's decoder rejects — typically an HEVC (H.265) .mov straight off a phone in Firefox (AppleVTDecoder … NS_ERROR_DOM_MEDIA_DECODE_ERR) — used to fail silently: the hidden <video> element fired an error event nobody listened for, so no video UI ever appeared and the studio just sat empty.

What changed

Error handling (src/routes/studio/+page.svelte)

  • An onerror handler on the hidden decoder element catches decode/format failures, closes the dead video, and surfaces a clear message: what failed, why (HEVC hint for .mov files), and how to fix it — try another browser, or convert to MP4 (H.264) / WebM via QuickTime, HandBrake or a copy-ready ffmpeg one-liner.
  • The message renders two ways from one shared snippet: in the dropzone area when the stage is empty, and as a dismissible card floated over the render (same overlay treatment as the timeline) when the error arrives while something is still on stage — Firefox decodes the first frames of an HEVC .mov before giving up, so the failure often lands mid-scrub with a render still visible. A compact note also appears under the browse button.
  • Files dropped on the render that are neither image nor video (they bypass the picker's accept filter) get the same treatment instead of being silently ignored.

Hang fixes

  • seekVideo waited for a seeked event that never comes when the decoder dies mid-seek; it now also resolves on error / emptied.
  • A decode failure cancels a running frame-sequence export cleanly (and bails before zipping a garbage frame) instead of spinning forever on a dead element.

Docs (src/routes/(site)/help/+page.svelte)

  • New "supported formats" entry in the help page's video section documenting the same guidance.

Verification

Driven headlessly (vite dev + Playwright/Chromium): an undecodable .mov from an empty stage shows the dropzone error; a video that renders frames and then errors mid-scrub shows the overlay card with the last render kept underneath, timeline removed, and dismiss clearing everything; a .txt drop shows "can't read"; a valid webm afterwards clears the error and loads the pipeline as before. svelte-check, eslint, prettier and all 263 unit tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ng25H1kphEz6dXXevJC8R5


Generated by Claude Code

claude and others added 4 commits July 30, 2026 09:23
Picking a video the browser's decoder rejects — typically an HEVC
(H.265) .mov straight off a phone — used to fail silently: the hidden
<video> element fired an error nobody listened for, so no video UI ever
appeared and the studio just sat empty.

Now the error event closes the dead video and shows a message in the
dropzone area (plus a compact note under the picker): what failed, why
(HEVC hint for .mov files), and how to fix it — convert to MP4 (H.264)
or WebM via QuickTime, HandBrake or the given ffmpeg one-liner. Dropped
files that are neither image nor video get the same treatment instead
of being silently ignored, and the help page's video section now
documents the supported formats.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ng25H1kphEz6dXXevJC8R5
Firefox decodes the first frames of an HEVC .mov before the decoder
gives up, so the failure arrives with hatchReady still true — and the
error block only rendered on an empty stage, leaving just the small
sidebar note. The error content now lives in a snippet rendered two
ways: the empty-stage dropzone as before, and a dismissible card
floated over the render (same overlay treatment as the timeline) when
something is still showing.

A decode failure mid seek also left promises hanging: seekVideo now
resolves on error/emptied as well as seeked, and a video error cancels
a running sequence export instead of letting it spin on a dead element.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ng25H1kphEz6dXXevJC8R5
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ng25H1kphEz6dXXevJC8R5
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Deploying rstr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 276e9bc
Status: ✅  Deploy successful!
Preview URL: https://15b95911.rstr.pages.dev
Branch Preview URL: https://claude-video-format-support.rstr.pages.dev

View logs

@dxviie
dxviie merged commit 5294982 into main Jul 30, 2026
2 checks passed
@dxviie
dxviie deleted the claude/video-format-support-xh80o4 branch July 30, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants