Skip to content

feat: host and play video files - #17

Merged
notsuhas merged 4 commits into
mainfrom
feat/video-hosting
Oct 9, 2026
Merged

notsuhas merged 4 commits into
mainfrom
feat/video-hosting

Conversation

@notsuhas

@notsuhas notsuhas commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Lets people deploy mp4, m4v, mov and webm files and watch them in the viewer, same as audio and images. Main use is agent-rendered explainer videos.

What changed

  • mime.ts: mp4 and m4v serve as video/mp4, mov as video/quicktime. Ranges already applied to every non-HTML file, so seeking works without extra changes.
  • Viewer: new VideoView (native
  • llms.txt, SKILL.md and a What's New note mention video. Regenerated with build:generated.

Why webm stays audio/webm
Voice notes depend on it. Comment voice uploads resolve their extension through AUDIO_EXTENSIONS and the reverse audio MIME map. Recorded voice sites are saved as recording.webm. The "pure audio" site flag is also built from AUDIO_EXTENSIONS. Switching webm to video/webm would break all three. Browsers decode by content, not by Content-Type, so a

Testing

  • New tests: mime types, mp4 content-type plus a 206 range response, isVideoFile, VideoView, the webm probe hook, and a viewer test (mp4 renders without an iframe, timestamp insert, comment uses the file path).
  • Bumped the catalog-coupled unreadCount in whats-new tests from 14 to 15.
  • bun run test, typecheck, lint and format:check pass. go test ./... in packages/cli passes.
  • Not tested in a real browser or on the dev stack.

Notes

  • The 20 MB per-file cap is unchanged, so longer videos won't upload.
  • mov serves as video/quicktime. Firefox probably won't play it inline, so the docs recommend H.264 mp4.

🤖 Generated with Claude Code

notsuhas and others added 4 commits October 9, 2026 18:37
Serve mp4/m4v/mov with video MIME types and range support, and open
standalone videos in a native player with open-original/download
controls and [m:ss] timestamp comments. .webm stays audio/webm so voice
notes keep working; the viewer probes .webm metadata and switches to the
video player when the file has a picture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A video webm used to open in the audio player and swap to video when
metadata arrived, stopping playback if you'd already hit play. Show a
spinner until the probe settles; unreadable files fall back to audio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Addresses the thermo-nuclear quality review on this PR:
- lib/media.ts: one extension table and fileKindOf (replaces lib/audio
  isAudioFile, lib/image, lib/video and their three extOf copies)
- useMediaKind folds the webm probe into 'probing' | 'audio' | 'video' |
  'image' | 'document'; the viewer renders a MediaPane switch
- MediaToolbar shared by image and video views
- probe settles once and times out after 5s so a stalled file falls back
  to the audio player instead of spinning forever

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exhaustive MediaPane return type, one key at the call site, reuse isMedia,
merged probe test setup into one file, and restored ogg/oga/flac/aac
coverage in media.test.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@notsuhas
notsuhas marked this pull request as ready for review October 9, 2026 13:08
@notsuhas
notsuhas force-pushed the feat/video-hosting branch from f7b4eb8 to b7d0be9 Compare October 9, 2026 13:08
@notsuhas
notsuhas merged commit 4f66dfd into main Oct 9, 2026
2 checks passed
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.

1 participant