You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
} else if (fileWriter) {
return new Promise(async function (resolve, reject) {
// fileWriter.onwriteend = resolve;
if (newEntry.offset === 0) {
await fileWriter.ready;
}
console.log(newEntry.offset);
// await fileWriter.seek(newEntry.offset)
await fileWriter.write({
type: 'write',
position: newEntry.offset,
data: new Blob([newEntry.data]),
});
resolve();
});
}
Usage
document.querySelector('p').onclick = async () => {
fileHandle = await showSaveFilePicker({
suggestedName: 'webm-writer-filesystem-access.webm',
startIn: 'videos',
id: 'webm-writer',
types: [
{
description: 'WebM files',
accept: {
'video/webm': ['.webm'],
},
},
],
excludeAcceptAllOption: true,
});
writable = await fileHandle.createWritable();
fileWriter = await writable.getWriter();
videoWriter = new WebMWriter({
quality: 0.95, // WebM image quality from 0.0 (worst) to 1.0 (best)
fileWriter, // FileWriter in order to stream to a file instead of buffering to memory (optional)
fd: null, // Node.js file handle to write to instead of buffering to memory (optional)
// You must supply one of:
frameDuration: null, // Duration of frames in milliseconds
frameRate: 30, // Number of frames per second
// add support for variable resolution, variable frame duration, data URL representation of WebP input
variableResolution: true, // frameRate is not used for variable resolution
});
};
WHATWG File System is now implemented in Chromium (Chrome), Firefox, Safari, which unlike WICG File System Access which writes directly to user-selected directories and files, writes File objects to the origin private filesystem.
Chrome apps are deprecated, see https://developer.chrome.com/docs/extensions/reference/fileSystem/
Following the "migrating your app link" to
chrome.fileSystem
and #31.
To substitute
WritableStreamDefaultWriter
forFileWriter
in webm-writer-js atwebm-writer-js/src/BlobBuffer.js
Line 23 in 098a057
and
webm-writer-js/src/BlobBuffer.js
Lines 142 to 149 in 098a057
Usage
Test
webm-writer-js-file-system-access.zip
The text was updated successfully, but these errors were encountered: