Enable OPFS Media Storage in Safari
Safari ships the File System Access API behind experimental flags until macOS 14.4. Without OPFS, large media files fall back to in-memory storage.
Steps
- Open Safari > Settings > Advanced and check Show features for web developers.
- In the menu bar choose Develop > Experimental Features > File System Access API.
- Reload OpenCut. The browser will prompt for storage access when you import media.
- Serve OpenCut over
https://
orhttp://localhost
so the API is available.
Fallback strategy
const fs = await navigator.storage.getDirectory();
// Safari fallback
defaultStorage = window.indexedDB ?? memoryStorage;
If navigator.storage.getDirectory
throws, store media in IndexedDB:
if (!window.showOpenFilePicker) {
await mediaStore.enableIndexedDbFallback();
}
Diagram
flowchart TD A[OpenCut media import] --> B{OPFS available?} B -- Yes --> C[Store in OPFS] B -- No --> D[Fallback to IndexedDB]
Communicate the experimental nature of OPFS to QA so they test on production Safari builds.