Skip to content

🎥 Make videos programmatically with React

Allow `canDecode()` to accept a blob

JonnyBurger65c5528b61ee
diff --git a/packages/docs/docs/mediabunny/can-decode.mdx b/packages/docs/docs/mediabunny/can-decode.mdx
index 603ea89b93..7a4d70bb65 100644
--- a/packages/docs/docs/mediabunny/can-decode.mdx
+++ b/packages/docs/docs/mediabunny/can-decode.mdx
@@ -10,12 +10,12 @@ Before attempting to load a video into [`<Video>`](/docs/media/video), you may w
Here's a `canDecode()` function you can copy and paste into your project:
```ts twoslash title="can-decode.ts"
-import {ALL_FORMATS, Input, UrlSource} from 'mediabunny';
+import {ALL_FORMATS, Input, UrlSource, BlobSource} from 'mediabunny';
-export const canDecode = async (src: string) => {
+export const canDecode = async (src: string | Blob) => {
const input = new Input({
formats: ALL_FORMATS,
- source: new UrlSource(src),
+ source: typeof src === 'string' ? new UrlSource(src) : new BlobSource(src),
});
try {