@designcombo/video 0.0.0 → 0.0.2
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/{SharedSystems-BSw9neqH.js → SharedSystems-BWe03l6N.js} +20 -20
- package/dist/{WebGLRenderer-BrabW-VK.js → WebGLRenderer-CKduQ9yw.js} +22 -22
- package/dist/{WebGPURenderer-BKwBKkzk.js → WebGPURenderer-BSX8DZj-.js} +19 -19
- package/dist/{browserAll-C7HVZtqZ.js → browserAll-CwPYLzJJ.js} +2 -2
- package/dist/clips/audio-clip.d.ts +1 -1
- package/dist/clips/caption-clip.d.ts +33 -7
- package/dist/clips/iclip.d.ts +16 -4
- package/dist/clips/image-clip.d.ts +26 -0
- package/dist/clips/text-clip.d.ts +62 -7
- package/dist/clips/video-clip.d.ts +30 -4
- package/dist/colorToUniform-C2jGzNe1.js +97 -0
- package/dist/effect/effect.d.ts +6 -0
- package/dist/effect/glsl/custom-glsl.d.ts +523 -0
- package/dist/effect/glsl/gl-effect.d.ts +14 -0
- package/dist/effect/types.d.ts +24 -0
- package/dist/effect/vertex.d.ts +1 -0
- package/dist/event-emitter.d.ts +47 -0
- package/dist/{index-CjzowIhV.js → index-C333riU-.js} +9354 -6719
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +18 -16
- package/dist/index.umd.js +1498 -111
- package/dist/json-serialization.d.ts +21 -0
- package/dist/sprite/base-sprite.d.ts +7 -0
- package/dist/sprite/pixi-sprite-renderer.d.ts +3 -3
- package/dist/studio.d.ts +55 -1
- package/dist/transfomer/parts/wireframe.d.ts +1 -1
- package/dist/transfomer/transformer.d.ts +5 -0
- package/dist/utils/audio-codec-detector.d.ts +28 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/{webworkerAll-DsE6HIYE.js → webworkerAll-aNnyDpl9.js} +49 -49
- package/package.json +10 -9
- package/dist/colorToUniform-Du0ROyNd.js +0 -274
|
@@ -28,7 +28,7 @@ export interface ITextClipOpts {
|
|
|
28
28
|
* @default '#ffffff'
|
|
29
29
|
*/
|
|
30
30
|
fill?: string | number | {
|
|
31
|
-
type:
|
|
31
|
+
type: "gradient";
|
|
32
32
|
x0: number;
|
|
33
33
|
y0: number;
|
|
34
34
|
x1: number;
|
|
@@ -44,7 +44,9 @@ export interface ITextClipOpts {
|
|
|
44
44
|
stroke?: string | number | {
|
|
45
45
|
color: string | number;
|
|
46
46
|
width: number;
|
|
47
|
-
join?:
|
|
47
|
+
join?: "miter" | "round" | "bevel";
|
|
48
|
+
cap?: "butt" | "round" | "square";
|
|
49
|
+
miterLimit?: number;
|
|
48
50
|
};
|
|
49
51
|
/**
|
|
50
52
|
* Stroke width in pixels (used when stroke is a simple color)
|
|
@@ -55,7 +57,7 @@ export interface ITextClipOpts {
|
|
|
55
57
|
* Text alignment ('left', 'center', 'right')
|
|
56
58
|
* @default 'left'
|
|
57
59
|
*/
|
|
58
|
-
align?:
|
|
60
|
+
align?: "left" | "center" | "right";
|
|
59
61
|
/**
|
|
60
62
|
* Drop shadow configuration
|
|
61
63
|
*/
|
|
@@ -106,7 +108,7 @@ export interface ITextClipOpts {
|
|
|
106
108
|
* textClip.duration = 5e6; // 5 seconds
|
|
107
109
|
*/
|
|
108
110
|
export declare class TextClip extends BaseClip {
|
|
109
|
-
ready: IClip[
|
|
111
|
+
ready: IClip["ready"];
|
|
110
112
|
private _meta;
|
|
111
113
|
get meta(): {
|
|
112
114
|
duration: number;
|
|
@@ -141,6 +143,15 @@ export declare class TextClip extends BaseClip {
|
|
|
141
143
|
stroke: {
|
|
142
144
|
color: string | number;
|
|
143
145
|
width: number;
|
|
146
|
+
join: "miter" | "round" | "bevel" | undefined;
|
|
147
|
+
cap: "round" | "butt" | "square" | undefined;
|
|
148
|
+
miterLimit: number | undefined;
|
|
149
|
+
} | {
|
|
150
|
+
color: string | number;
|
|
151
|
+
width: number;
|
|
152
|
+
join?: undefined;
|
|
153
|
+
cap?: undefined;
|
|
154
|
+
miterLimit?: undefined;
|
|
144
155
|
} | undefined;
|
|
145
156
|
shadow: {
|
|
146
157
|
color: string | number;
|
|
@@ -149,6 +160,10 @@ export declare class TextClip extends BaseClip {
|
|
|
149
160
|
offsetX: number;
|
|
150
161
|
offsetY: number;
|
|
151
162
|
} | undefined;
|
|
163
|
+
wordWrap: boolean | undefined;
|
|
164
|
+
wordWrapWidth: number | undefined;
|
|
165
|
+
lineHeight: number | undefined;
|
|
166
|
+
letterSpacing: number | undefined;
|
|
152
167
|
};
|
|
153
168
|
private pixiText;
|
|
154
169
|
private textStyle;
|
|
@@ -156,13 +171,27 @@ export declare class TextClip extends BaseClip {
|
|
|
156
171
|
private externalRenderer;
|
|
157
172
|
private pixiApp;
|
|
158
173
|
private originalOpts;
|
|
159
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Unique identifier for this clip instance
|
|
176
|
+
*/
|
|
177
|
+
id: string;
|
|
178
|
+
/**
|
|
179
|
+
* Array of effects to be applied to this clip
|
|
180
|
+
* Each effect specifies key, startTime, duration, and optional targets
|
|
181
|
+
*/
|
|
182
|
+
effects: Array<{
|
|
183
|
+
id: string;
|
|
184
|
+
key: string;
|
|
185
|
+
startTime: number;
|
|
186
|
+
duration: number;
|
|
187
|
+
}>;
|
|
188
|
+
constructor(text: string, opts?: ITextClipOpts, renderer?: Application["renderer"]);
|
|
160
189
|
/**
|
|
161
190
|
* Set an external renderer (e.g., from Studio) to avoid creating our own Pixi App
|
|
162
191
|
* This is an optimization for Studio preview
|
|
163
192
|
* Can be called before ready() completes
|
|
164
193
|
*/
|
|
165
|
-
setRenderer(renderer: Application[
|
|
194
|
+
setRenderer(renderer: Application["renderer"]): void;
|
|
166
195
|
/**
|
|
167
196
|
* Get the renderer for rendering text to RenderTexture
|
|
168
197
|
* Creates a minimal renderer as fallback if no external renderer is provided
|
|
@@ -177,10 +206,36 @@ export declare class TextClip extends BaseClip {
|
|
|
177
206
|
getTexture(): Promise<Texture | null>;
|
|
178
207
|
tick(_time: number): Promise<{
|
|
179
208
|
video: ImageBitmap;
|
|
180
|
-
state:
|
|
209
|
+
state: "success";
|
|
181
210
|
}>;
|
|
182
211
|
split(_time: number): Promise<[this, this]>;
|
|
212
|
+
addEffect(effect: {
|
|
213
|
+
id: string;
|
|
214
|
+
key: string;
|
|
215
|
+
startTime: number;
|
|
216
|
+
duration: number;
|
|
217
|
+
}): void;
|
|
218
|
+
editEffect(effectId: string, newEffectData: Partial<{
|
|
219
|
+
key: string;
|
|
220
|
+
startTime: number;
|
|
221
|
+
duration: number;
|
|
222
|
+
}>): void;
|
|
223
|
+
removeEffect(effectId: string): void;
|
|
183
224
|
clone(): Promise<this>;
|
|
225
|
+
/**
|
|
226
|
+
* Update text styling options and refresh the texture
|
|
227
|
+
* This is used for dynamic updates like resizing with text reflow
|
|
228
|
+
*/
|
|
229
|
+
updateStyle(opts: Partial<ITextClipOpts>): Promise<void>;
|
|
230
|
+
/**
|
|
231
|
+
* Refresh the internal Pixi Text and RenderTexture
|
|
232
|
+
* Calculates dimensions based on text bounds and wrapping options
|
|
233
|
+
*/
|
|
234
|
+
private refreshText;
|
|
235
|
+
/**
|
|
236
|
+
* Helper to create PixiJS TextStyle options from TextClip options
|
|
237
|
+
*/
|
|
238
|
+
private createStyleFromOpts;
|
|
184
239
|
destroy(): void;
|
|
185
240
|
toJSON(main?: boolean): TextClipJSON;
|
|
186
241
|
/**
|
|
@@ -20,7 +20,7 @@ export interface IMP4ClipOpts {
|
|
|
20
20
|
*/
|
|
21
21
|
__unsafe_hardwareAcceleration__?: HardwarePreference;
|
|
22
22
|
}
|
|
23
|
-
type ExtMP4Sample = Omit<MP4Sample,
|
|
23
|
+
type ExtMP4Sample = Omit<MP4Sample, "data"> & {
|
|
24
24
|
is_idr: boolean;
|
|
25
25
|
deleted?: boolean;
|
|
26
26
|
data: null | Uint8Array;
|
|
@@ -60,7 +60,7 @@ type ExtMP4Sample = Omit<MP4Sample, 'data'> & {
|
|
|
60
60
|
export declare class VideoClip extends BaseClip implements IPlaybackCapable {
|
|
61
61
|
private insId;
|
|
62
62
|
private logger;
|
|
63
|
-
ready: IClip[
|
|
63
|
+
ready: IClip["ready"];
|
|
64
64
|
private _meta;
|
|
65
65
|
get meta(): {
|
|
66
66
|
duration: number;
|
|
@@ -92,6 +92,20 @@ export declare class VideoClip extends BaseClip implements IPlaybackCapable {
|
|
|
92
92
|
* Whether to include audio track (hybrid JSON structure)
|
|
93
93
|
*/
|
|
94
94
|
audio: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Unique identifier for this clip instance
|
|
97
|
+
*/
|
|
98
|
+
id: string;
|
|
99
|
+
/**
|
|
100
|
+
* Array of effects to be applied to this clip
|
|
101
|
+
* Each effect specifies key, startTime, duration, and optional targets
|
|
102
|
+
*/
|
|
103
|
+
effects: Array<{
|
|
104
|
+
id: string;
|
|
105
|
+
key: string;
|
|
106
|
+
startTime: number;
|
|
107
|
+
duration: number;
|
|
108
|
+
}>;
|
|
95
109
|
/**
|
|
96
110
|
* Load a video clip from a URL
|
|
97
111
|
* @param url Video URL
|
|
@@ -120,7 +134,7 @@ export declare class VideoClip extends BaseClip implements IPlaybackCapable {
|
|
|
120
134
|
*
|
|
121
135
|
* @see [Remove video green screen background](https://webav-tech.github.io/WebAV/demo/3_2-chromakey-video)
|
|
122
136
|
*/
|
|
123
|
-
tickInterceptor: <T extends Awaited<ReturnType<VideoClip[
|
|
137
|
+
tickInterceptor: <T extends Awaited<ReturnType<VideoClip["tick"]>>>(time: number, tickRet: T) => Promise<T>;
|
|
124
138
|
/**
|
|
125
139
|
* Get image frame and audio data at specified time
|
|
126
140
|
* @param time Time in microseconds
|
|
@@ -128,9 +142,21 @@ export declare class VideoClip extends BaseClip implements IPlaybackCapable {
|
|
|
128
142
|
tick(time: number): Promise<{
|
|
129
143
|
video?: VideoFrame;
|
|
130
144
|
audio: Float32Array[];
|
|
131
|
-
state:
|
|
145
|
+
state: "success" | "done";
|
|
132
146
|
}>;
|
|
133
147
|
split(time: number): Promise<[this, this]>;
|
|
148
|
+
addEffect(effect: {
|
|
149
|
+
id: string;
|
|
150
|
+
key: string;
|
|
151
|
+
startTime: number;
|
|
152
|
+
duration: number;
|
|
153
|
+
}): void;
|
|
154
|
+
editEffect(effectId: string, newEffectData: Partial<{
|
|
155
|
+
key: string;
|
|
156
|
+
startTime: number;
|
|
157
|
+
duration: number;
|
|
158
|
+
}>): void;
|
|
159
|
+
removeEffect(effectId: string): void;
|
|
134
160
|
clone(): Promise<this>;
|
|
135
161
|
/**
|
|
136
162
|
* Split VideoClip into VideoClips containing only video track and audio track
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const l = {
|
|
2
|
+
name: "local-uniform-bit",
|
|
3
|
+
vertex: {
|
|
4
|
+
header: (
|
|
5
|
+
/* wgsl */
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
struct LocalUniforms {
|
|
9
|
+
uTransformMatrix:mat3x3<f32>,
|
|
10
|
+
uColor:vec4<f32>,
|
|
11
|
+
uRound:f32,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
15
|
+
`
|
|
16
|
+
),
|
|
17
|
+
main: (
|
|
18
|
+
/* wgsl */
|
|
19
|
+
`
|
|
20
|
+
vColor *= localUniforms.uColor;
|
|
21
|
+
modelMatrix *= localUniforms.uTransformMatrix;
|
|
22
|
+
`
|
|
23
|
+
),
|
|
24
|
+
end: (
|
|
25
|
+
/* wgsl */
|
|
26
|
+
`
|
|
27
|
+
if(localUniforms.uRound == 1)
|
|
28
|
+
{
|
|
29
|
+
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
30
|
+
}
|
|
31
|
+
`
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
}, e = {
|
|
35
|
+
...l,
|
|
36
|
+
vertex: {
|
|
37
|
+
...l.vertex,
|
|
38
|
+
// replace the group!
|
|
39
|
+
header: l.vertex.header.replace("group(1)", "group(2)")
|
|
40
|
+
}
|
|
41
|
+
}, n = {
|
|
42
|
+
name: "local-uniform-bit",
|
|
43
|
+
vertex: {
|
|
44
|
+
header: (
|
|
45
|
+
/* glsl */
|
|
46
|
+
`
|
|
47
|
+
|
|
48
|
+
uniform mat3 uTransformMatrix;
|
|
49
|
+
uniform vec4 uColor;
|
|
50
|
+
uniform float uRound;
|
|
51
|
+
`
|
|
52
|
+
),
|
|
53
|
+
main: (
|
|
54
|
+
/* glsl */
|
|
55
|
+
`
|
|
56
|
+
vColor *= uColor;
|
|
57
|
+
modelMatrix = uTransformMatrix;
|
|
58
|
+
`
|
|
59
|
+
),
|
|
60
|
+
end: (
|
|
61
|
+
/* glsl */
|
|
62
|
+
`
|
|
63
|
+
if(uRound == 1.)
|
|
64
|
+
{
|
|
65
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
class a {
|
|
72
|
+
constructor() {
|
|
73
|
+
this.batcherName = "default", this.topology = "triangle-list", this.attributeSize = 4, this.indexSize = 6, this.packAsQuad = !0, this.roundPixels = 0, this._attributeStart = 0, this._batcher = null, this._batch = null;
|
|
74
|
+
}
|
|
75
|
+
get blendMode() {
|
|
76
|
+
return this.renderable.groupBlendMode;
|
|
77
|
+
}
|
|
78
|
+
get color() {
|
|
79
|
+
return this.renderable.groupColorAlpha;
|
|
80
|
+
}
|
|
81
|
+
reset() {
|
|
82
|
+
this.renderable = null, this.texture = null, this._batcher = null, this._batch = null, this.bounds = null;
|
|
83
|
+
}
|
|
84
|
+
destroy() {
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function s(o, r, i) {
|
|
88
|
+
const t = (o >> 24 & 255) / 255;
|
|
89
|
+
r[i++] = (o & 255) / 255 * t, r[i++] = (o >> 8 & 255) / 255 * t, r[i++] = (o >> 16 & 255) / 255 * t, r[i++] = t;
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
a as B,
|
|
93
|
+
l as a,
|
|
94
|
+
n as b,
|
|
95
|
+
s as c,
|
|
96
|
+
e as l
|
|
97
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Filter, RenderTexture } from 'pixi.js';
|
|
2
|
+
import { EffectOptions, EffectRendererOptions } from './types';
|
|
3
|
+
export declare function makeEffect({ name, renderer }: EffectOptions): {
|
|
4
|
+
filter: Filter;
|
|
5
|
+
render({ width, height, canvasTexture, progress }: EffectRendererOptions): RenderTexture;
|
|
6
|
+
};
|