mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: show image viewer for video-to-gif/webp results instead of broken video player
When a video tool produces a non-video output (gif, webp, png), the media player can't render it. Now detects the processed file extension and switches to ImageViewer for image outputs while keeping the video player for the input preview.
This commit is contained in:
@@ -641,6 +641,20 @@ export function ToolPage() {
|
||||
);
|
||||
}
|
||||
}
|
||||
// Tools that convert video to a non-video format (gif, webp, frames):
|
||||
// after processing, show the result as an image instead of a video player
|
||||
if (hasProcessed && processedUrl) {
|
||||
const ext = (currentEntry?.processedFilename ?? "").split(".").pop()?.toLowerCase();
|
||||
if (ext && ["gif", "webp", "png", "jpg", "jpeg", "apng"].includes(ext)) {
|
||||
return (
|
||||
<ImageViewer
|
||||
src={processedUrl}
|
||||
filename={currentEntry?.processedFilename ?? ""}
|
||||
fileSize={currentEntry?.processedSize ?? 0}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<Suspense fallback={<div className="text-sm text-muted-foreground">Loading...</div>}>
|
||||
<MediaPlayerView />
|
||||
|
||||
Reference in New Issue
Block a user