fix: show user-friendly error for unsupported video codecs (#637)

When a video file uses a codec not supported by WebCodecs (like H.265/HEVC
from Clipchamp), show a helpful toast message suggesting to convert to
H.264/MP4 format instead of failing silently.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Abelino Chavez 2026-01-30 21:15:40 -06:00
parent 71bdafac75
commit edd2138c6b
1 changed files with 7 additions and 0 deletions

View File

@ -195,6 +195,13 @@ export async function processMediaAssets({
});
} catch (error) {
console.warn("Video processing failed", error);
const errorMessage =
error instanceof Error ? error.message : String(error);
if (errorMessage.includes("codec not supported")) {
toast.error(
`${file.name}: Video codec not supported. Try converting to H.264/MP4 format.`,
);
}
}
} else if (fileType === "audio") {
// For audio, we don't set width/height/fps (they'll be undefined)