openvideo 0.2.3 → 0.2.4
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/{browserAll-fYnMYU5U.js → browserAll-DqJYgFGF.js} +2 -2
- package/dist/clips/caption-clip.d.ts +55 -41
- package/dist/{index-CZJxf7wC.js → index-D-dl7dbF.js} +2152 -2091
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +112 -112
- package/dist/json-serialization.d.ts +10 -0
- package/dist/{webworkerAll-B5b1f-BT.js → webworkerAll-LBYBQRrP.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as a, A as e, C as i, a as s, E as t, F as n, D as d } from "./index-
|
|
2
|
-
import "./webworkerAll-
|
|
1
|
+
import { e as a, A as e, C as i, a as s, E as t, F as n, D as d } from "./index-D-dl7dbF.js";
|
|
2
|
+
import "./webworkerAll-LBYBQRrP.js";
|
|
3
3
|
a.add(e);
|
|
4
4
|
a.mixin(i, s);
|
|
5
5
|
a.add(t);
|
|
@@ -3,16 +3,23 @@ import { IClip } from './iclip';
|
|
|
3
3
|
import { CaptionJSON, ICaptionWordAnimation } from '../json-serialization';
|
|
4
4
|
import { Application, Texture } from 'pixi.js';
|
|
5
5
|
import { BaseSpriteEvents } from '../sprite/base-sprite';
|
|
6
|
+
export interface ITextBoxStyle {
|
|
7
|
+
style?: "tiktok" | "none";
|
|
8
|
+
textAlign?: "left" | "center" | "right" | "";
|
|
9
|
+
maxLines?: number;
|
|
10
|
+
borderRadius?: number;
|
|
11
|
+
horizontalPadding?: number;
|
|
12
|
+
}
|
|
6
13
|
export interface ICaptionStyle {
|
|
7
14
|
fontSize?: number;
|
|
8
15
|
fontFamily?: string;
|
|
9
16
|
fontWeight?: string | number;
|
|
10
17
|
fontStyle?: string;
|
|
11
|
-
color?: ICaptionOpts[
|
|
12
|
-
align?: ICaptionOpts[
|
|
13
|
-
textCase?: ICaptionOpts[
|
|
14
|
-
verticalAlign?: ICaptionOpts[
|
|
15
|
-
wordsPerLine?: ICaptionOpts[
|
|
18
|
+
color?: ICaptionOpts["fill"];
|
|
19
|
+
align?: ICaptionOpts["align"];
|
|
20
|
+
textCase?: ICaptionOpts["textCase"];
|
|
21
|
+
verticalAlign?: ICaptionOpts["verticalAlign"];
|
|
22
|
+
wordsPerLine?: ICaptionOpts["wordsPerLine"];
|
|
16
23
|
stroke?: {
|
|
17
24
|
color: string | number;
|
|
18
25
|
width: number;
|
|
@@ -25,6 +32,7 @@ export interface ICaptionStyle {
|
|
|
25
32
|
angle: number;
|
|
26
33
|
};
|
|
27
34
|
wordAnimation?: ICaptionWordAnimation;
|
|
35
|
+
textBoxStyle?: ITextBoxStyle;
|
|
28
36
|
}
|
|
29
37
|
export interface ICaptionEvents extends BaseSpriteEvents {
|
|
30
38
|
propsChange: Partial<{
|
|
@@ -37,14 +45,15 @@ export interface ICaptionEvents extends BaseSpriteEvents {
|
|
|
37
45
|
opacity: number;
|
|
38
46
|
volume: number;
|
|
39
47
|
text: string;
|
|
40
|
-
words: ICaptionOpts[
|
|
41
|
-
fill: ICaptionOpts[
|
|
42
|
-
align: ICaptionOpts[
|
|
43
|
-
textCase: ICaptionOpts[
|
|
44
|
-
stroke: ICaptionOpts[
|
|
45
|
-
dropShadow: ICaptionOpts[
|
|
46
|
-
caption: ICaptionOpts[
|
|
47
|
-
wordsPerLine: ICaptionOpts[
|
|
48
|
+
words: ICaptionOpts["words"];
|
|
49
|
+
fill: ICaptionOpts["fill"];
|
|
50
|
+
align: ICaptionOpts["align"];
|
|
51
|
+
textCase: ICaptionOpts["textCase"];
|
|
52
|
+
stroke: ICaptionOpts["stroke"];
|
|
53
|
+
dropShadow: ICaptionOpts["dropShadow"];
|
|
54
|
+
caption: ICaptionOpts["caption"];
|
|
55
|
+
wordsPerLine: ICaptionOpts["wordsPerLine"];
|
|
56
|
+
textBoxStyle: ITextBoxStyle;
|
|
48
57
|
}>;
|
|
49
58
|
}
|
|
50
59
|
export interface ICaptionOpts {
|
|
@@ -74,7 +83,7 @@ export interface ICaptionOpts {
|
|
|
74
83
|
* @default '#ffffff'
|
|
75
84
|
*/
|
|
76
85
|
fill?: string | number | {
|
|
77
|
-
type:
|
|
86
|
+
type: "gradient";
|
|
78
87
|
x0: number;
|
|
79
88
|
y0: number;
|
|
80
89
|
x1: number;
|
|
@@ -109,6 +118,7 @@ export interface ICaptionOpts {
|
|
|
109
118
|
bottomOffset?: number;
|
|
110
119
|
};
|
|
111
120
|
wordAnimation?: ICaptionWordAnimation;
|
|
121
|
+
textBoxStyle?: ITextBoxStyle;
|
|
112
122
|
};
|
|
113
123
|
/**
|
|
114
124
|
* @deprecated Use caption.words instead
|
|
@@ -152,7 +162,7 @@ export interface ICaptionOpts {
|
|
|
152
162
|
stroke?: string | number | {
|
|
153
163
|
color: string | number;
|
|
154
164
|
width: number;
|
|
155
|
-
join?:
|
|
165
|
+
join?: "miter" | "round" | "bevel";
|
|
156
166
|
};
|
|
157
167
|
/**
|
|
158
168
|
* Stroke width in pixels (used when stroke is a simple color)
|
|
@@ -163,7 +173,7 @@ export interface ICaptionOpts {
|
|
|
163
173
|
* Text alignment ('left', 'center', 'right')
|
|
164
174
|
* @default 'center'
|
|
165
175
|
*/
|
|
166
|
-
align?:
|
|
176
|
+
align?: "left" | "center" | "right";
|
|
167
177
|
/**
|
|
168
178
|
* Drop shadow configuration
|
|
169
179
|
*/
|
|
@@ -183,7 +193,7 @@ export interface ICaptionOpts {
|
|
|
183
193
|
* Word wrap mode ('break-word' or 'normal')
|
|
184
194
|
* @default 'break-word'
|
|
185
195
|
*/
|
|
186
|
-
wordWrapMode?:
|
|
196
|
+
wordWrapMode?: "break-word" | "normal";
|
|
187
197
|
/**
|
|
188
198
|
* Whether to enable word wrap
|
|
189
199
|
* @default true
|
|
@@ -193,7 +203,7 @@ export interface ICaptionOpts {
|
|
|
193
203
|
* Vertical alignment ('top', 'center', 'bottom')
|
|
194
204
|
* @default 'bottom'
|
|
195
205
|
*/
|
|
196
|
-
verticalAlign?:
|
|
206
|
+
verticalAlign?: "top" | "center" | "bottom";
|
|
197
207
|
/**
|
|
198
208
|
* Line height (multiplier)
|
|
199
209
|
* @default 1
|
|
@@ -208,7 +218,7 @@ export interface ICaptionOpts {
|
|
|
208
218
|
* Text case transformation
|
|
209
219
|
* @default 'none'
|
|
210
220
|
*/
|
|
211
|
-
textCase?:
|
|
221
|
+
textCase?: "none" | "uppercase" | "lowercase" | "title";
|
|
212
222
|
/**
|
|
213
223
|
* Media ID to which the captions were applied
|
|
214
224
|
*/
|
|
@@ -221,8 +231,9 @@ export interface ICaptionOpts {
|
|
|
221
231
|
* Words per line mode ('single' or 'multiple')
|
|
222
232
|
* @default 'multiple'
|
|
223
233
|
*/
|
|
224
|
-
wordsPerLine?:
|
|
234
|
+
wordsPerLine?: "single" | "multiple";
|
|
225
235
|
wordAnimation?: ICaptionWordAnimation;
|
|
236
|
+
textBoxStyle?: ITextBoxStyle;
|
|
226
237
|
}
|
|
227
238
|
/**
|
|
228
239
|
* Caption clip using Canvas 2D for rendering
|
|
@@ -241,7 +252,7 @@ export interface ICaptionOpts {
|
|
|
241
252
|
*/
|
|
242
253
|
export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
243
254
|
readonly type = "Caption";
|
|
244
|
-
ready: IClip[
|
|
255
|
+
ready: IClip["ready"];
|
|
245
256
|
private _meta;
|
|
246
257
|
get meta(): {
|
|
247
258
|
duration: number;
|
|
@@ -274,8 +285,8 @@ export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
|
274
285
|
set text(v: string);
|
|
275
286
|
get style(): ICaptionStyle;
|
|
276
287
|
set style(v: Partial<ICaptionOpts> | ICaptionStyle);
|
|
277
|
-
get wordsPerLine():
|
|
278
|
-
set wordsPerLine(v:
|
|
288
|
+
get wordsPerLine(): "single" | "multiple";
|
|
289
|
+
set wordsPerLine(v: "single" | "multiple");
|
|
279
290
|
get fontFamily(): string;
|
|
280
291
|
set fontFamily(v: string);
|
|
281
292
|
get fontUrl(): string;
|
|
@@ -284,20 +295,22 @@ export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
|
284
295
|
set fontSize(v: number);
|
|
285
296
|
get fontWeight(): string | number;
|
|
286
297
|
set fontWeight(v: string | number);
|
|
287
|
-
get fontStyle():
|
|
288
|
-
set fontStyle(v:
|
|
289
|
-
get fill(): ICaptionOpts[
|
|
290
|
-
set fill(v: ICaptionOpts[
|
|
291
|
-
get align():
|
|
292
|
-
set align(v:
|
|
293
|
-
get stroke(): ICaptionOpts[
|
|
294
|
-
set stroke(v: ICaptionOpts[
|
|
298
|
+
get fontStyle(): "normal" | "italic" | "oblique";
|
|
299
|
+
set fontStyle(v: "normal" | "italic" | "oblique");
|
|
300
|
+
get fill(): ICaptionOpts["fill"];
|
|
301
|
+
set fill(v: ICaptionOpts["fill"]);
|
|
302
|
+
get align(): "left" | "center" | "right";
|
|
303
|
+
set align(v: "left" | "center" | "right");
|
|
304
|
+
get stroke(): ICaptionOpts["stroke"];
|
|
305
|
+
set stroke(v: ICaptionOpts["stroke"]);
|
|
295
306
|
get strokeWidth(): number;
|
|
296
307
|
set strokeWidth(v: number);
|
|
297
|
-
get dropShadow(): ICaptionOpts[
|
|
298
|
-
set dropShadow(v: ICaptionOpts[
|
|
299
|
-
get caption(): ICaptionOpts[
|
|
300
|
-
set caption(v: ICaptionOpts[
|
|
308
|
+
get dropShadow(): ICaptionOpts["dropShadow"];
|
|
309
|
+
set dropShadow(v: ICaptionOpts["dropShadow"]);
|
|
310
|
+
get caption(): ICaptionOpts["caption"];
|
|
311
|
+
set caption(v: ICaptionOpts["caption"]);
|
|
312
|
+
get textBoxStyle(): ITextBoxStyle;
|
|
313
|
+
set textBoxStyle(v: ITextBoxStyle);
|
|
301
314
|
/**
|
|
302
315
|
* Bottom offset from video bottom (hybrid JSON structure)
|
|
303
316
|
*/
|
|
@@ -306,7 +319,7 @@ export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
|
306
319
|
* Text case proxy
|
|
307
320
|
*/
|
|
308
321
|
get textCase(): string;
|
|
309
|
-
set textCase(v:
|
|
322
|
+
set textCase(v: "none" | "uppercase" | "lowercase" | "title");
|
|
310
323
|
/**
|
|
311
324
|
* Unique identifier for this clip instance
|
|
312
325
|
*/
|
|
@@ -333,7 +346,7 @@ export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
|
333
346
|
/**
|
|
334
347
|
* Words setter that triggers re-render and ensures consistency
|
|
335
348
|
*/
|
|
336
|
-
set words(v: ICaptionOpts[
|
|
349
|
+
set words(v: ICaptionOpts["words"]);
|
|
337
350
|
private opts;
|
|
338
351
|
private pixiTextContainer;
|
|
339
352
|
private renderTexture;
|
|
@@ -345,7 +358,7 @@ export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
|
345
358
|
private externalRenderer;
|
|
346
359
|
private pixiApp;
|
|
347
360
|
private originalOpts;
|
|
348
|
-
constructor(text: string, opts?: ICaptionOpts, renderer?: Application[
|
|
361
|
+
constructor(text: string, opts?: ICaptionOpts, renderer?: Application["renderer"]);
|
|
349
362
|
/**
|
|
350
363
|
* Update text styling options and refresh the caption rendering
|
|
351
364
|
*/
|
|
@@ -364,11 +377,11 @@ export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
|
364
377
|
/**
|
|
365
378
|
* Set an external renderer (e.g., from Studio) to avoid creating our own Pixi App
|
|
366
379
|
*/
|
|
367
|
-
setRenderer(renderer: Application[
|
|
380
|
+
setRenderer(renderer: Application["renderer"]): void;
|
|
368
381
|
private getRenderer;
|
|
369
382
|
tick(time: number): Promise<{
|
|
370
383
|
video: ImageBitmap;
|
|
371
|
-
state:
|
|
384
|
+
state: "success";
|
|
372
385
|
}>;
|
|
373
386
|
split(_time: number): Promise<[this, this]>;
|
|
374
387
|
addEffect(effect: {
|
|
@@ -392,5 +405,6 @@ export declare class Caption extends BaseClip<ICaptionEvents> implements IClip {
|
|
|
392
405
|
* @returns Promise that resolves to a Caption instance
|
|
393
406
|
*/
|
|
394
407
|
static fromObject(json: CaptionJSON): Promise<Caption>;
|
|
395
|
-
getVisibleHandles(): Array<
|
|
408
|
+
getVisibleHandles(): Array<"tl" | "tr" | "bl" | "br" | "ml" | "mr" | "mt" | "mb" | "rot">;
|
|
409
|
+
private drawRoundedTiktokPath;
|
|
396
410
|
}
|