Skip to main content

universalReader

一个用于@remotion/media-parser读取器,可以从URL、File或本地文件路径读取。

🌐 A reader for @remotion/media-parser that reads either from a URL, from a File or from a local file path.

它是 nodeReaderwebReader 的组合。

🌐 It is the combination of nodeReader and webReader.

由于依赖 fs 模块,因此不能在浏览器中使用。

🌐 Because of the dependency on the fs module, it cannot be used in the browser.

示例

🌐 Example

Reading from any source
import {parseMedia} from '@remotion/media-parser'; import {universalReader} from '@remotion/media-parser/universal'; const result = await parseMedia({ // Or a File, or a URL src: '/Users/jonnyburger/Downloads/my-video.mp4', fields: { durationInSeconds: true, dimensions: true, }, reader: universalReader, });

另请参阅

🌐 See also