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