@shotstack/shotstack-studio 2.24.5 → 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/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "dazzatron",
7
7
  "kratos2k7"
8
8
  ],
9
- "version": "2.24.5",
9
+ "version": "2.26.0",
10
10
  "description": "A video editing library for creating and editing videos with Shotstack",
11
11
  "type": "module",
12
12
  "main": "dist/shotstack-studio.umd.js",
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 }}`.