Skip to content

🎥 Make videos programmatically with React

sick sick sick

Jonny Burger66fa1a4a9f2b
diff --git a/packages/core/src/prefetch.ts b/packages/core/src/prefetch.ts
index c741955178..d8bf267e85 100644
--- a/packages/core/src/prefetch.ts
+++ b/packages/core/src/prefetch.ts
@@ -33,7 +33,7 @@ const blobToBase64 = function (blob: Blob): Promise<string> {
export type PrefetchOnProgress = (options: {
totalBytes: number | null;
loadedBytes: number;
-}) => {};
+}) => void;
const getBlobFromReader = async ({
reader,
diff --git a/packages/docs/docs/prefetch.md b/packages/docs/docs/prefetch.md
index 552ca2e9fd..7b8a3cc09a 100644
--- a/packages/docs/docs/prefetch.md
+++ b/packages/docs/docs/prefetch.md
@@ -76,6 +76,7 @@ Set a content type for the blob. By default, the content type from the HTTP resp
Callback for progress events.
```tsx twoslash
+import { prefetch } from "remotion";
import type { PrefetchOnProgress } from "remotion";
const onProgress: PrefetchOnProgress = (progress) => {
@@ -91,6 +92,10 @@ const onProgress: PrefetchOnProgress = (progress) => {
Math.round(progress.loadedBytes / progress.totalBytes / 100) + "%",
);
};
+
+prefetch("https://example.com/video.mp4", {
+ onProgress,
+});
```
## Return value