Add inline video preview to the file panel - #655
Open
luckrnx09 wants to merge 1 commit into
Open
Conversation
Video files previously fell through to the text preview path and were rejected above 256KB, and .webm was misclassified as audio. Add a VIDEO_EXT_TO_MIME table, stream videos through the existing Range-capable file route, and render them with a VideoViewer that mirrors the audio viewer (live watch, duration, size, download).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #654.
Summary
Video files were not previewable: they fell through to the text-preview branch and were rejected above 256KB, and
.webmwas misclassified as audio. This adds a video preview path end to end.Changes
lib/file-types.ts: newVIDEO_EXT_TO_MIME(mp4/m4v/webm/mov/ogv) withgetVideoMime()/isVideoPath();webmmoved out ofAUDIO_EXT_TO_MIME(webaremains audio).app/api/files/[...path]/route.ts:read,meta, anddownloadhandle video MIME types via the existing Range-capablestreamFile()— streaming and seeking work, no size cap (same as audio).components/FileViewer.tsx: newVideoViewermirroringAudioViewer(live-watch badge, duration, size, download); dispatcher routesisVideoPath()to it.file-types.test.mjscovers video detection and the webm reclassification;FileViewer.state.test.mjsviewer-count/watch wiring updated for the fifth viewer.Testing
npm test: 846/846 pass;tsc --noEmitandeslintclean.206).