webFsWriter
💼 重要许可免责声明
We consider a team of 4 or more people a "company".
In a future version of
@remotion/webcodecs, this package will also require the purchase of a newly created "WebCodecs Conversion Seat". Get in touch with us if you are planning to use this package.不稳定的 API:写入器接口是实验性的。API 将来可能会发生变化。
一个用于 @remotion/webcodecs 的写入器,它使用文件系统访问 API 写入浏览器的文件系统。
🌐 A writer for @remotion/webcodecs that writes to the browser's file system using the File System Access API.
可以用于 convertMedia() 将转换后的输出直接写入浏览器的原始私有文件系统中的临时文件。
🌐 Can be used for convertMedia() to write the converted output directly to a temporary file in the browser's origin-private file system.
可用性
🌐 Availability
此写入器仅在支持 File System Access API 的浏览器中可用。使用 canUseWebFsWriter() 检查其是否可用。
🌐 This writer is only available in browsers that support the File System Access API. Use canUseWebFsWriter() to check if it's available.
示例
🌐 Example
Using webFsWriterimport {convertMedia } from '@remotion/webcodecs'; import {webFsWriter } from '@remotion/webcodecs/web-fs'; constresult = awaitconvertMedia ({src : 'https://remotion.media/BigBuckBunny.mp4',container : 'webm',writer :webFsWriter , }); constblob = awaitresult .save ();
canUseWebFsWriter()
一个返回 Promise<boolean> 的函数,用于指示 webFsWriter 是否可以在当前环境中使用。
🌐 A function that returns a Promise<boolean> indicating whether the webFsWriter can be used in the current environment.
Checking availabilityimport {canUseWebFsWriter ,webFsWriter } from '@remotion/webcodecs/web-fs'; constcanUse = awaitcanUseWebFsWriter (); if (canUse ) { // Use webFsWriter } else { // Fall back to bufferWriter or another writer }
另请参阅
🌐 See also
- 此函数的源代码
bufferWriter- 内存中替代写入器convertMedia()