openvideo 0.1.10 → 0.2.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/dist/animation/gsap-animation.d.ts +1 -1
- package/dist/animation/presets.d.ts +31 -0
- package/dist/animation/types.d.ts +18 -0
- package/dist/browserAll-DjjOJsg2.js +7 -0
- package/dist/clips/base-clip.d.ts +2 -2
- package/dist/clips/caption-clip.d.ts +45 -42
- package/dist/clips/iclip.d.ts +10 -0
- package/dist/clips/text-clip.d.ts +17 -17
- package/dist/compositor.d.ts +3 -0
- package/dist/effect/effect.d.ts +4 -1
- package/dist/effect/glsl/custom-glsl.d.ts +15 -0
- package/dist/effect/glsl/gl-effect.d.ts +29 -7
- package/dist/index-DCWl03Hg.js +82357 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +35 -27
- package/dist/index.umd.js +2522 -495
- package/dist/json-serialization.d.ts +12 -1
- package/dist/sprite/base-sprite.d.ts +7 -2
- package/dist/sprite/pixi-sprite-renderer.d.ts +1 -0
- package/dist/studio.d.ts +21 -14
- package/dist/transition/glsl/gl-transition.d.ts +25 -5
- package/dist/utils/color.d.ts +8 -0
- package/dist/utils/stream-utils.d.ts +0 -5
- package/dist/webworkerAll-DY6Fccy4.js +17 -0
- package/package.json +3 -2
- package/dist/SharedSystems-BToBuu4Q.js +0 -2691
- package/dist/WebGLRenderer-CFWSnnJo.js +0 -2639
- package/dist/WebGPURenderer-7lmK3Jak.js +0 -1655
- package/dist/animation/easings.spec.d.ts +0 -1
- package/dist/animation/keyframe-animation.spec.d.ts +0 -1
- package/dist/browserAll-D7xrJ7bE.js +0 -1876
- package/dist/colorToUniform-C2jGzNe1.js +0 -97
- package/dist/index-B3edIoqh.js +0 -49178
- package/dist/webworkerAll-DvrCPjE-.js +0 -2643
|
@@ -102,8 +102,15 @@ export interface TextStyleJSON {
|
|
|
102
102
|
lineHeight?: number;
|
|
103
103
|
letterSpacing?: number;
|
|
104
104
|
textCase?: 'none' | 'uppercase' | 'lowercase' | 'title';
|
|
105
|
-
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
106
105
|
wordsPerLine?: 'single' | 'multiple';
|
|
106
|
+
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
107
|
+
wordAnimation?: ICaptionWordAnimation;
|
|
108
|
+
}
|
|
109
|
+
export interface ICaptionWordAnimation {
|
|
110
|
+
type: 'scale' | 'opacity';
|
|
111
|
+
application: 'active' | 'keyword' | 'none';
|
|
112
|
+
value: number;
|
|
113
|
+
mode?: 'static' | 'dynamic';
|
|
107
114
|
}
|
|
108
115
|
export interface TextJSON extends BaseClipJSON {
|
|
109
116
|
type: 'Text';
|
|
@@ -133,6 +140,7 @@ export interface CaptionDataJSON {
|
|
|
133
140
|
colors?: CaptionColorsJSON;
|
|
134
141
|
preserveKeywordColor?: boolean;
|
|
135
142
|
positioning?: CaptionPositioningJSON;
|
|
143
|
+
wordAnimation?: ICaptionWordAnimation;
|
|
136
144
|
}
|
|
137
145
|
export interface CaptionJSON extends BaseClipJSON {
|
|
138
146
|
type: 'Caption';
|
|
@@ -208,9 +216,12 @@ export interface ProjectJSON {
|
|
|
208
216
|
height?: number;
|
|
209
217
|
fps?: number;
|
|
210
218
|
bgColor?: string;
|
|
219
|
+
format?: string;
|
|
211
220
|
videoCodec?: string;
|
|
212
221
|
bitrate?: number;
|
|
213
222
|
audio?: boolean;
|
|
223
|
+
audioCodec?: string;
|
|
224
|
+
audioSampleRate?: number;
|
|
214
225
|
metaDataTags?: Record<string, string>;
|
|
215
226
|
};
|
|
216
227
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as EventEmitter } from '../event-emitter';
|
|
2
2
|
import { IAnimation, AnimationTransform } from '../animation';
|
|
3
|
+
import { IChromaKeyOpts } from '../clips/iclip';
|
|
3
4
|
type IRectBaseProps = any;
|
|
4
5
|
interface IAnimationOpts {
|
|
5
6
|
duration: number;
|
|
@@ -10,7 +11,7 @@ type TAnimateProps = IRectBaseProps & {
|
|
|
10
11
|
opacity: number;
|
|
11
12
|
};
|
|
12
13
|
export type TAnimationKeyFrame = Array<[number, Partial<TAnimateProps>]>;
|
|
13
|
-
type TKeyFrameOpts = Partial<Record<`${number}%` |
|
|
14
|
+
type TKeyFrameOpts = Partial<Record<`${number}%` | 'from' | 'to', Partial<TAnimateProps>>>;
|
|
14
15
|
export interface BaseSpriteEvents {
|
|
15
16
|
propsChange: Partial<{
|
|
16
17
|
left: number;
|
|
@@ -128,7 +129,7 @@ export declare abstract class BaseSprite<T extends BaseSpriteEvents = BaseSprite
|
|
|
128
129
|
/**
|
|
129
130
|
* Flip clip horizontally or vertically
|
|
130
131
|
*/
|
|
131
|
-
flip:
|
|
132
|
+
flip: 'horizontal' | 'vertical' | null;
|
|
132
133
|
effects: Array<{
|
|
133
134
|
id: string;
|
|
134
135
|
key: string;
|
|
@@ -136,6 +137,10 @@ export declare abstract class BaseSprite<T extends BaseSpriteEvents = BaseSprite
|
|
|
136
137
|
duration: number;
|
|
137
138
|
targets?: number[];
|
|
138
139
|
}>;
|
|
140
|
+
/**
|
|
141
|
+
* Chroma key settings (green screen removal)
|
|
142
|
+
*/
|
|
143
|
+
chromaKey: IChromaKeyOpts;
|
|
139
144
|
/**
|
|
140
145
|
* Styling properties (e.g., stroke, dropShadow, borderRadius)
|
|
141
146
|
* This is a generic object to hold visual styles across different clip types
|
package/dist/studio.d.ts
CHANGED
|
@@ -33,45 +33,45 @@ interface GlobalEffectInfo {
|
|
|
33
33
|
duration: number;
|
|
34
34
|
}
|
|
35
35
|
export interface StudioEvents {
|
|
36
|
-
|
|
36
|
+
'selection:created': {
|
|
37
37
|
selected: IClip[];
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
'selection:updated': {
|
|
40
40
|
selected: IClip[];
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
'selection:cleared': {
|
|
43
43
|
deselected: IClip[];
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
'track:added': {
|
|
46
46
|
track: StudioTrack;
|
|
47
47
|
index?: number;
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
'track:order-changed': {
|
|
50
50
|
tracks: StudioTrack[];
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
'track:removed': {
|
|
53
53
|
trackId: string;
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
'clip:added': {
|
|
56
56
|
clip: IClip;
|
|
57
57
|
trackId: string;
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
'clips:added': {
|
|
60
60
|
clips: IClip[];
|
|
61
61
|
trackId?: string;
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
'clip:removed': {
|
|
64
64
|
clipId: string;
|
|
65
65
|
};
|
|
66
|
-
|
|
66
|
+
'clip:updated': {
|
|
67
67
|
clip: IClip;
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
'clip:replaced': {
|
|
70
70
|
oldClip: IClip;
|
|
71
71
|
newClip: IClip;
|
|
72
72
|
trackId: string;
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
'studio:restored': {
|
|
75
75
|
clips: IClip[];
|
|
76
76
|
tracks: StudioTrack[];
|
|
77
77
|
settings: IStudioOpts;
|
|
@@ -85,7 +85,7 @@ export interface StudioEvents {
|
|
|
85
85
|
pause: {
|
|
86
86
|
isPlaying: boolean;
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
'history:changed': {
|
|
89
89
|
canUndo: boolean;
|
|
90
90
|
canRedo: boolean;
|
|
91
91
|
};
|
|
@@ -127,7 +127,7 @@ export declare class Studio extends EventEmitter<StudioEvents> {
|
|
|
127
127
|
set currentTime(val: number);
|
|
128
128
|
get maxDuration(): number;
|
|
129
129
|
set maxDuration(val: number);
|
|
130
|
-
opts: Required<Omit<IStudioOpts,
|
|
130
|
+
opts: Required<Omit<IStudioOpts, 'canvas'>> & {
|
|
131
131
|
canvas?: HTMLCanvasElement;
|
|
132
132
|
};
|
|
133
133
|
destroyed: boolean;
|
|
@@ -141,6 +141,9 @@ export declare class Studio extends EventEmitter<StudioEvents> {
|
|
|
141
141
|
activeGlobalEffects: ActiveGlobalEffect[];
|
|
142
142
|
currentGlobalEffectSprite: Sprite | null;
|
|
143
143
|
effectFilters: Map<string, {
|
|
144
|
+
filter: null;
|
|
145
|
+
render({ canvasTexture }: import('./effect/types').EffectRendererOptions): Texture<import('pixi.js').TextureSource<any>>;
|
|
146
|
+
} | {
|
|
144
147
|
filter: import('pixi.js').Filter;
|
|
145
148
|
render({ width, height, canvasTexture, progress }: import('./effect/types').EffectRendererOptions): RenderTexture;
|
|
146
149
|
}>;
|
|
@@ -186,6 +189,10 @@ export declare class Studio extends EventEmitter<StudioEvents> {
|
|
|
186
189
|
* Update studio dimensions
|
|
187
190
|
*/
|
|
188
191
|
setSize(width: number, height: number): void;
|
|
192
|
+
/**
|
|
193
|
+
* Update the background color of the studio
|
|
194
|
+
*/
|
|
195
|
+
setBgColor(color: string): void;
|
|
189
196
|
updateDimensions(width: number, height: number): void;
|
|
190
197
|
private handleResize;
|
|
191
198
|
updateArtboardLayout(): void;
|
|
@@ -8,11 +8,31 @@ export interface GlTransition {
|
|
|
8
8
|
previewDynamic?: string;
|
|
9
9
|
previewStatic?: string;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Register a custom transition at runtime
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerCustomTransition(name: string, transition: GlTransition): void;
|
|
15
|
+
/**
|
|
16
|
+
* Unregister a custom transition at runtime
|
|
17
|
+
*/
|
|
18
|
+
export declare function unregisterCustomTransition(name: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get all available transitions, including library, static custom, and runtime registered ones
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAllTransitions(): Record<string, GlTransition>;
|
|
11
23
|
export declare const GL_TRANSITIONS: Record<string, GlTransition>;
|
|
12
|
-
export type TransitionKey =
|
|
13
|
-
export declare
|
|
24
|
+
export type TransitionKey = string;
|
|
25
|
+
export declare function getTransitionOptions(): {
|
|
14
26
|
key: TransitionKey;
|
|
15
27
|
label: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
isCustom: boolean;
|
|
29
|
+
previewStatic: string;
|
|
30
|
+
previewDynamic: string;
|
|
31
|
+
}[];
|
|
32
|
+
export declare const GL_TRANSITION_OPTIONS: {
|
|
33
|
+
key: TransitionKey;
|
|
34
|
+
label: string;
|
|
35
|
+
isCustom: boolean;
|
|
36
|
+
previewStatic: string;
|
|
37
|
+
previewDynamic: string;
|
|
38
|
+
}[];
|
package/dist/utils/color.d.ts
CHANGED
|
@@ -7,3 +7,11 @@ export declare const resolveColor: (color?: string, fallback?: number) => {
|
|
|
7
7
|
color: number;
|
|
8
8
|
alpha: number;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Convert hex color string to RGB object
|
|
12
|
+
*/
|
|
13
|
+
export declare function hexToRgb(hex: string): {
|
|
14
|
+
r: number;
|
|
15
|
+
g: number;
|
|
16
|
+
b: number;
|
|
17
|
+
} | null;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { MP4File } from 'wrapbox';
|
|
2
1
|
export declare function autoReadStream<ST extends ReadableStream>(stream: ST, cbs: {
|
|
3
2
|
onChunk: ST extends ReadableStream<infer DT> ? (chunk: DT) => Promise<void> : never;
|
|
4
3
|
onDone: () => void;
|
|
5
4
|
}): () => void;
|
|
6
|
-
export declare function file2stream(file: MP4File, timeSlice: number, onCancel?: () => void): {
|
|
7
|
-
stream: ReadableStream<Uint8Array>;
|
|
8
|
-
stop: (err?: Error) => void;
|
|
9
|
-
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { e as a, R as e, T as d, G as i, b as s, M as t, c as p, d as P, f as n, g as r, B as T, H as l, h as c, i as m, N as x, j as S, k as o } from "./index-DCWl03Hg.js";
|
|
2
|
+
a.add(e);
|
|
3
|
+
a.add(d);
|
|
4
|
+
a.add(i);
|
|
5
|
+
a.add(s);
|
|
6
|
+
a.add(t);
|
|
7
|
+
a.add(p);
|
|
8
|
+
a.add(P);
|
|
9
|
+
a.add(n);
|
|
10
|
+
a.add(r);
|
|
11
|
+
a.add(T);
|
|
12
|
+
a.add(l);
|
|
13
|
+
a.add(c);
|
|
14
|
+
a.add(m);
|
|
15
|
+
a.add(x);
|
|
16
|
+
a.add(S);
|
|
17
|
+
a.add(o);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openvideo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Video rendering and processing library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -55,10 +55,11 @@
|
|
|
55
55
|
"@pixi/layout": "^3.2.0",
|
|
56
56
|
"gl-transitions": "^1.43.0",
|
|
57
57
|
"gsap": "^3.12.7",
|
|
58
|
+
"mediabunny": "^1.26.0",
|
|
58
59
|
"microdiff": "^1.4.0",
|
|
59
60
|
"opfs-tools": "^0.7.2",
|
|
60
61
|
"pixi.js": "^8.14.3",
|
|
61
62
|
"wave-resampler": "^1.0.0",
|
|
62
|
-
"wrapbox": "^0.0
|
|
63
|
+
"wrapbox": "^0.1.0"
|
|
63
64
|
}
|
|
64
65
|
}
|