Skip to content

Commit

Permalink
realize when webfs cannot be used
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Nov 6, 2024
1 parent af6ddad commit f7772da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/media-parser/src/writers/web-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ export const webFsWriter: WriterInterface = {
};

export const canUseWebFsWriter = async () => {
if (!('storage' in navigator)) {
return false;
}

if (!('getDirectory' in navigator.storage)) {
return false;
}

const directoryHandle = await navigator.storage.getDirectory();
const fileHandle = await directoryHandle.getFileHandle(
'remotion-probe-web-fs-support',
Expand Down

0 comments on commit f7772da

Please sign in to comment.