fix: resolve FFmpeg MIME type error and persist core files in IndexedDB#49
Merged
fix: resolve FFmpeg MIME type error and persist core files in IndexedDB#49
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Fix MIME type error by ensuring correct types (text/javascript, application/wasm) when creating blob URLs for FFmpeg module loading - Add IndexedDB persistence for FFmpeg core JS and WASM files to avoid re-downloading on every load - Extract shared openDB helper from respackStorage into idb.ts - Create ffmpegStorage.ts for FFmpeg blob cache using shared IndexedDB - Make loadFFmpeg() work without arguments by falling back to cache/download Co-authored-by: Naptie <57532127+Naptie@users.noreply.github.com> Agent-Logs-Url: https://github.com/PhiZone/player/sessions/40cc73f4-8857-46c3-8178-25246cf5975d
Copilot
AI
changed the title
[WIP] Fix FFmpeg loading error and implement IndexedDB persistence
fix: resolve FFmpeg MIME type error and persist core files in IndexedDB
Mar 21, 2026
Naptie
approved these changes
Mar 21, 2026
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.
loadFFmpegcreated blob URLs without MIME types, causing browsers to reject the core JS as a module script (Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of ""). Additionally, FFmpeg core+WASM were re-downloaded on every use.MIME type fix
Blobs are now wrapped with correct MIME types before
createObjectURL:IndexedDB caching
src/lib/services/idb.ts— Extracted sharedopenDBfromrespackStorage.ts. DB version bumped 1→2 to addffmpegobject store.src/lib/services/ffmpegStorage.ts— Key-value blob storage for FFmpeg files, reusing the shared DB.src/lib/services/respackStorage.ts— Now importsopenDBfromidb.ts.src/lib/player/services/ffmpeg/index.ts—loadFFmpeg(core?, wasm?)now checks IndexedDB cache first, downloads and caches on miss, and caches caller-provided blobs. This also fixes the existing bug whereutils.tscalledloadFFmpeg()with no arguments against a signature that required them.src/routes/(app)/+page.svelte— Simplified to justawait loadFFmpeg()since caching is handled internally.⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.