Add KSFP chunked attachment ingestion and playback#94
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const codec = origin.specialization?.codec; | ||
| const mimeBase = origin.mime || "video/mp4"; | ||
| const mime = codec ? `${mimeBase}; codecs="${codec}"` : mimeBase; | ||
| if (!MediaSource.isTypeSupported(mime)) { | ||
| throw new Error(`Unsupported media type: ${mime}`); |
There was a problem hiding this comment.
Provide codecs info for KSFP MediaSource playback
When origin.specialization.codec is unset, the MIME passed to MediaSource.isTypeSupported becomes just origin.mime (e.g., video/mp4). In this change, ingestKsfpFile only sets container/initSegmentKey for videos and never populates codec, so MP4 KSFP origins will commonly hit isTypeSupported("video/mp4") === false in browsers that require a codec string for MSE. That causes the stream to throw "Unsupported media type" and prevents playback even though the data is valid. Consider extracting/recording codecs during ingestion or relaxing the isTypeSupported check when codecs are missing.
Useful? React with 👍 / 👎.
…y-stream Add codec parsing for KSFP video playback
Motivation
file-refattachments so streams can reconstruct and verify files offline.Description
src/lib/ksfp1.tsimplementing KSFP ingestion and storage:ingestKsfpFile, chunk schedule (FCS-1), chunk hashing (BLAKE3), Merkle root/proofs, and cache keysKSFP_ORIGIN_PREFIX/KSFP_LINEAGE_PREFIX/KSFP_BLOB_PREFIX.ingestKsfpFilefrom the file/Story handlers insrc/components/KaiVoh/KaiVoh.tsxand prefer KSFP origin URLs when available.src/pages/sigilstream/attachments/ksfp.tsxprovidingKsfpFileCardandshouldRenderKsfp, integrating it into the attachments gallery so cached KSFP origins: (a) stream viaMediaSourcefor video, and (b) reconstruct fullBlobfor download.src/pages/sigilstream/styles/sigilstream.cssand integrate the KSFP card ingallery.tsxto surface KSFP-backed attachments in the Memory Stream UI.Testing
npm run devand it launched successfully (Vite served the app). — succeeded.git commitof the new files and UI integration (files created:src/lib/ksfp1.ts,src/pages/sigilstream/attachments/ksfp.tsxand modifications toKaiVoh/gallery/CSS). — succeeded.Codex Task