@shotstack/shotstack-studio 1.1.0 → 1.1.1

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
@@ -5,7 +5,7 @@
5
5
  "cpuccino",
6
6
  "dazzatron"
7
7
  ],
8
- "version": "1.1.0",
8
+ "version": "1.1.1",
9
9
  "description": "A video editing library for creating and editing videos with Shotstack",
10
10
  "type": "module",
11
11
  "main": "dist/shotstack-studio.umd.js",
package/readme.md CHANGED
@@ -10,10 +10,11 @@ A JavaScript library for creating and editing videos in the browser.
10
10
 
11
11
  Try Shotstack Studio in your preferred framework:
12
12
 
13
- [![TypeScript](https://img.shields.io/badge/TypeScript-StackBlitz-blue?style=for-the-badge&logo=typescript)](https://stackblitz.com/edit/studio-sdk-typescript)
14
- [![React](https://img.shields.io/badge/React-StackBlitz-blue?style=for-the-badge&logo=react)](https://stackblitz.com/edit/shotstack-studio-react)
15
- [![Vue](https://img.shields.io/badge/Vue-StackBlitz-blue?style=for-the-badge&logo=vue.js)](https://stackblitz.com/edit/shotstack-studio-vue)
16
- [![Angular](https://img.shields.io/badge/Angular-StackBlitz-blue?style=for-the-badge&logo=angular)](https://stackblitz.com/edit/shotstack-studio-angular)
13
+ [![TypeScript](https://img.shields.io/badge/TypeScript-StackBlitz-blue?style=for-the-badge&logo=typescript)](https://stackblitz.com/edit/studio-sdk-typescript?file=src%2Fmain.ts)
14
+ [![React](https://img.shields.io/badge/React-StackBlitz-blue?style=for-the-badge&logo=react)](https://stackblitz.com/edit/studio-sdk-typescript?file=src%2Fmain.ts)
15
+ [![Vue](https://img.shields.io/badge/Vue-StackBlitz-blue?style=for-the-badge&logo=vue.js)](https://stackblitz.com/edit/shotstack-studio-vue?file=src%2FApp.vue)
16
+ [![Angular](https://img.shields.io/badge/Angular-StackBlitz-blue?style=for-the-badge&logo=angular)](https://stackblitz.com/edit/shotstack-studio-angular?file=src%2Fmain.ts)
17
+ [![Next.js](https://img.shields.io/badge/Next.js-StackBlitz-blue?style=for-the-badge&logo=next.js)](https://stackblitz.com/edit/shotstack-studio-nextjs?file=app%2Fpage.tsx)
17
18
 
18
19
  ## Installation
19
20
 
@@ -27,13 +28,13 @@ yarn add @shotstack/shotstack-studio
27
28
 
28
29
  ### FFmpeg (peer dependency)
29
30
 
30
- Install FFmpeg to use the browser based `VideoExporter` class. This is kept separate to prevent WASM / WebWorker clashes in frameworks like Next.js.
31
+ Install FFmpeg to use the browser based `VideoExporter` class. This is kept separate to prevent WASM / Web Worker clashes in frameworks like Next.js.
31
32
 
32
33
  ```bash
33
- npm i @ffmpeg/ffmpeg
34
+ npm install @ffmpeg/ffmpeg
34
35
  ```
35
36
 
36
- You can skip this if youre using the Shotstack Edit API.
37
+ You can skip this if you're using the [Shotstack Edit API](https://shotstack.io/docs/guide/getting-started/hello-world-using-curl/) for rendering videos.
37
38
 
38
39
  ## Quick Start
39
40
 
@@ -114,6 +115,23 @@ const editJson = edit.getEdit();
114
115
  const duration = edit.totalDuration; // in milliseconds
115
116
  ```
116
117
 
118
+ #### Events
119
+
120
+ The Edit class provides an event system to listen for specific actions:
121
+
122
+ ```typescript
123
+ // Listen for clip selection events
124
+ edit.events.on("clip:selected", data => {
125
+ console.log("Clip selected:", data.clip);
126
+ console.log("Track index:", data.trackIndex);
127
+ console.log("Clip index:", data.clipIndex);
128
+ });
129
+ ```
130
+
131
+ Available events:
132
+
133
+ - `clip:selected` - Emitted when a clip is selected, providing data about the clip, its track index, and clip index
134
+
117
135
  ### Canvas
118
136
 
119
137
  The Canvas class provides the visual rendering of the edit.
@@ -251,6 +269,23 @@ Creates a new Edit instance with the specified dimensions and background color.
251
269
  - `deleteTrack(trackIdx: number)` - Delete a track
252
270
  - `getEdit()` - Get the full edit configuration as a JSON object
253
271
 
272
+ #### Events
273
+
274
+ The Edit class provides an event system to listen for specific actions:
275
+
276
+ ```typescript
277
+ // Listen for clip selection events
278
+ edit.events.on("clip:selected", data => {
279
+ console.log("Clip selected:", data.clip);
280
+ console.log("Track index:", data.trackIndex);
281
+ console.log("Clip index:", data.clipIndex);
282
+ });
283
+ ```
284
+
285
+ Available events:
286
+
287
+ - `clip:selected` - Emitted when a clip is selected, providing data about the clip, its track index, and clip index
288
+
254
289
  ### Canvas
255
290
 
256
291
  The `Canvas` class provides the visual rendering of the edit.