Last updated 3 years ago
a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a so its methods can be used for processing the data. Blobs can represent data that isn't necessarily in a JavaScript-native format.
interface is based on Blob
Blob
const blob = new Blob(recordedChunks, { type: recordedChunks[0].type }); const blobURL = URL.createObjectURL(blob); //.... <video src={blobURL} />
export async function storeVideo(blob, filepath) { const write = util.promisify(fs.writeFile); const data = await blob.arrayBuffer(); const buf = Buffer.from(data); console.log("Storing", buf); await write(filePath, buf); console.log(`Blob stored at ${filePath}`); }
ReadableStream
File