@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/dist/core/schemas/asset.d.ts +6 -10
- package/dist/core/schemas/audio-asset.d.ts +6 -10
- package/dist/core/schemas/clip.d.ts +21 -35
- package/dist/core/schemas/edit.d.ts +42 -70
- package/dist/core/schemas/track.d.ts +21 -35
- package/dist/core/schemas/video-asset.d.ts +6 -10
- package/dist/shotstack-studio.es.js +2 -4
- package/dist/shotstack-studio.umd.js +3 -3
- package/package.json +1 -1
- package/readme.md +42 -7
package/package.json
CHANGED
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
|
-
[](https://stackblitz.com/edit/studio-sdk-typescript)
|
|
14
|
-
[](https://stackblitz.com/edit/
|
|
15
|
-
[](https://stackblitz.com/edit/shotstack-studio-vue)
|
|
16
|
-
[](https://stackblitz.com/edit/shotstack-studio-angular)
|
|
13
|
+
[](https://stackblitz.com/edit/studio-sdk-typescript?file=src%2Fmain.ts)
|
|
14
|
+
[](https://stackblitz.com/edit/studio-sdk-typescript?file=src%2Fmain.ts)
|
|
15
|
+
[](https://stackblitz.com/edit/shotstack-studio-vue?file=src%2FApp.vue)
|
|
16
|
+
[](https://stackblitz.com/edit/shotstack-studio-angular?file=src%2Fmain.ts)
|
|
17
|
+
[](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
|
|
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
|
|
34
|
+
npm install @ffmpeg/ffmpeg
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
You can skip this if you
|
|
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.
|