@shotstack/shotstack-studio 2.25.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -0
- package/dist/shotstack-studio.es.js +1035 -1012
- package/dist/shotstack-studio.umd.js +80 -80
- package/package.json +1 -1
- package/readme.md +17 -0
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -337,6 +337,23 @@ const exporter = new VideoExporter(edit, canvas);
|
|
|
337
337
|
await exporter.export("my-video.mp4", 25);
|
|
338
338
|
```
|
|
339
339
|
|
|
340
|
+
`exportBlob()` runs the same export without the progress overlay or the download and resolves with the MP4 `Blob`. `onProgress` receives a fraction from 0 to 1 and a stage label. Aborting the signal rejects with an `ExportError` whose `phase` is `cancelled`.
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
import { ExportError } from "@shotstack/shotstack-studio";
|
|
344
|
+
|
|
345
|
+
const controller = new AbortController();
|
|
346
|
+
const file = await exporter
|
|
347
|
+
.exportBlob({
|
|
348
|
+
signal: controller.signal,
|
|
349
|
+
onProgress: (fraction, stage) => console.log(`${Math.round(fraction * 100)}% ${stage}`)
|
|
350
|
+
})
|
|
351
|
+
.catch(error => {
|
|
352
|
+
if (error instanceof ExportError && error.phase === "cancelled") return null;
|
|
353
|
+
throw error;
|
|
354
|
+
});
|
|
355
|
+
```
|
|
356
|
+
|
|
340
357
|
## Merge Fields
|
|
341
358
|
|
|
342
359
|
Merge fields are template placeholders, typically in the form `{{ FIELD_NAME }}`.
|