@nice2dev/ui-video 1.0.10
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/README.md +265 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +327 -0
- package/dist/index.mjs +2046 -0
- package/package.json +65 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare type DestinationStatus = 'idle' | 'connecting' | 'live' | 'error' | 'disconnected';
|
|
4
|
+
|
|
5
|
+
export declare interface Effect {
|
|
6
|
+
id: string;
|
|
7
|
+
type: EffectType;
|
|
8
|
+
name: string;
|
|
9
|
+
parameters: Record<string, number | string | boolean>;
|
|
10
|
+
keyframes?: Keyframe_2[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare type EffectType = 'blur' | 'brightness' | 'contrast' | 'saturation' | 'hue' | 'grayscale' | 'sepia' | 'invert' | 'chromaKey' | 'crop' | 'zoom' | 'pan' | 'rotate' | 'flip' | 'mirror';
|
|
14
|
+
|
|
15
|
+
declare interface Keyframe_2 {
|
|
16
|
+
time: number;
|
|
17
|
+
value: number | string;
|
|
18
|
+
easing: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
|
|
19
|
+
}
|
|
20
|
+
export { Keyframe_2 as Keyframe }
|
|
21
|
+
|
|
22
|
+
export declare interface MediaAsset {
|
|
23
|
+
id: string;
|
|
24
|
+
type: MediaType;
|
|
25
|
+
name: string;
|
|
26
|
+
url: string;
|
|
27
|
+
duration?: number;
|
|
28
|
+
width?: number;
|
|
29
|
+
height?: number;
|
|
30
|
+
size: number;
|
|
31
|
+
thumbnail?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare type MediaType = 'video' | 'audio' | 'image';
|
|
35
|
+
|
|
36
|
+
export declare const NiceLiveStreaming: default_2.FC<NiceLiveStreamingProps>;
|
|
37
|
+
|
|
38
|
+
export declare interface NiceLiveStreamingProps {
|
|
39
|
+
config?: StreamConfig;
|
|
40
|
+
onConfigChange?: (config: StreamConfig) => void;
|
|
41
|
+
onStreamStart?: () => void;
|
|
42
|
+
onStreamStop?: () => void;
|
|
43
|
+
onStatsUpdate?: (stats: StreamStats) => void;
|
|
44
|
+
onError?: (error: Error) => void;
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export declare const NiceScreenRecorder: default_2.FC<NiceScreenRecorderProps>;
|
|
49
|
+
|
|
50
|
+
export declare interface NiceScreenRecorderProps {
|
|
51
|
+
options?: Partial<RecordingOptions>;
|
|
52
|
+
onRecordingStart?: (session: RecordingSession) => void;
|
|
53
|
+
onRecordingStop?: (session: RecordingSession, blob: Blob) => void;
|
|
54
|
+
onRecordingPause?: () => void;
|
|
55
|
+
onRecordingResume?: () => void;
|
|
56
|
+
onError?: (error: Error) => void;
|
|
57
|
+
className?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare const NiceVideoEditor: default_2.FC<NiceVideoEditorProps>;
|
|
61
|
+
|
|
62
|
+
export declare interface NiceVideoEditorProps {
|
|
63
|
+
project?: VideoProject;
|
|
64
|
+
onProjectChange?: (project: VideoProject) => void;
|
|
65
|
+
onExport?: (project: VideoProject, format: string) => Promise<Blob>;
|
|
66
|
+
onAssetUpload?: (file: File) => Promise<MediaAsset>;
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export declare interface NiceVideoPlayerProps {
|
|
71
|
+
src: string;
|
|
72
|
+
poster?: string;
|
|
73
|
+
autoplay?: boolean;
|
|
74
|
+
controls?: boolean;
|
|
75
|
+
loop?: boolean;
|
|
76
|
+
muted?: boolean;
|
|
77
|
+
onPlay?: () => void;
|
|
78
|
+
onPause?: () => void;
|
|
79
|
+
onEnded?: () => void;
|
|
80
|
+
onTimeUpdate?: (currentTime: number) => void;
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare interface ProjectSettings {
|
|
85
|
+
backgroundColor: string;
|
|
86
|
+
audio: {
|
|
87
|
+
sampleRate: number;
|
|
88
|
+
channels: 1 | 2;
|
|
89
|
+
bitrate: number;
|
|
90
|
+
};
|
|
91
|
+
video: {
|
|
92
|
+
codec: 'h264' | 'h265' | 'vp9' | 'av1';
|
|
93
|
+
bitrate: number;
|
|
94
|
+
profile?: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export declare interface RecordingMarker {
|
|
99
|
+
id: string;
|
|
100
|
+
time: number;
|
|
101
|
+
label: string;
|
|
102
|
+
color?: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export declare interface RecordingOptions {
|
|
106
|
+
video: {
|
|
107
|
+
source: 'screen' | 'window' | 'tab' | 'camera';
|
|
108
|
+
displaySurface?: string;
|
|
109
|
+
resolution?: VideoResolution;
|
|
110
|
+
frameRate?: number;
|
|
111
|
+
showCursor: boolean;
|
|
112
|
+
};
|
|
113
|
+
audio: {
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
source: 'system' | 'microphone' | 'both' | 'none';
|
|
116
|
+
echoCancellation?: boolean;
|
|
117
|
+
noiseSuppression?: boolean;
|
|
118
|
+
};
|
|
119
|
+
output: {
|
|
120
|
+
format: 'webm' | 'mp4' | 'mkv';
|
|
121
|
+
codec?: string;
|
|
122
|
+
quality?: 'low' | 'medium' | 'high' | 'lossless';
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare interface RecordingSession {
|
|
127
|
+
id: string;
|
|
128
|
+
status: RecordingStatus;
|
|
129
|
+
startTime?: Date;
|
|
130
|
+
duration: number;
|
|
131
|
+
size: number;
|
|
132
|
+
options: RecordingOptions;
|
|
133
|
+
chunks: Blob[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export declare type RecordingStatus = 'idle' | 'preparing' | 'recording' | 'paused' | 'stopped' | 'error';
|
|
137
|
+
|
|
138
|
+
export declare interface SourceSettings {
|
|
139
|
+
deviceId?: string;
|
|
140
|
+
url?: string;
|
|
141
|
+
resolution?: VideoResolution;
|
|
142
|
+
frameRate?: number;
|
|
143
|
+
position?: {
|
|
144
|
+
x: number;
|
|
145
|
+
y: number;
|
|
146
|
+
};
|
|
147
|
+
size?: {
|
|
148
|
+
width: number;
|
|
149
|
+
height: number;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export declare type SourceType = 'camera' | 'screen' | 'window' | 'browser' | 'image' | 'video' | 'microphone' | 'system-audio' | 'ndi' | 'rtsp';
|
|
154
|
+
|
|
155
|
+
export declare interface StreamConfig {
|
|
156
|
+
id: string;
|
|
157
|
+
name: string;
|
|
158
|
+
protocol: StreamProtocol;
|
|
159
|
+
destinations: StreamDestination[];
|
|
160
|
+
sources: StreamSource[];
|
|
161
|
+
layout: StreamLayout;
|
|
162
|
+
settings: StreamSettings;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare interface StreamDestination {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
platform: StreamPlatform;
|
|
169
|
+
url: string;
|
|
170
|
+
streamKey?: string;
|
|
171
|
+
enabled: boolean;
|
|
172
|
+
status: DestinationStatus;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export declare interface StreamLayer {
|
|
176
|
+
id: string;
|
|
177
|
+
sourceId: string;
|
|
178
|
+
position: {
|
|
179
|
+
x: number;
|
|
180
|
+
y: number;
|
|
181
|
+
};
|
|
182
|
+
size: {
|
|
183
|
+
width: number;
|
|
184
|
+
height: number;
|
|
185
|
+
};
|
|
186
|
+
visible: boolean;
|
|
187
|
+
opacity: number;
|
|
188
|
+
zIndex: number;
|
|
189
|
+
crop?: {
|
|
190
|
+
top: number;
|
|
191
|
+
right: number;
|
|
192
|
+
bottom: number;
|
|
193
|
+
left: number;
|
|
194
|
+
};
|
|
195
|
+
filters?: string[];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export declare interface StreamLayout {
|
|
199
|
+
name: string;
|
|
200
|
+
canvas: {
|
|
201
|
+
width: number;
|
|
202
|
+
height: number;
|
|
203
|
+
backgroundColor: string;
|
|
204
|
+
};
|
|
205
|
+
layers: StreamLayer[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export declare type StreamPlatform = 'youtube' | 'twitch' | 'facebook' | 'custom-rtmp' | 'custom-srt';
|
|
209
|
+
|
|
210
|
+
export declare type StreamProtocol = 'rtmp' | 'rtmps' | 'hls' | 'webrtc' | 'srt';
|
|
211
|
+
|
|
212
|
+
export declare interface StreamSettings {
|
|
213
|
+
video: {
|
|
214
|
+
resolution: VideoResolution;
|
|
215
|
+
frameRate: number;
|
|
216
|
+
codec: 'h264' | 'h265';
|
|
217
|
+
bitrate: number;
|
|
218
|
+
keyframe: number;
|
|
219
|
+
profile: 'baseline' | 'main' | 'high';
|
|
220
|
+
};
|
|
221
|
+
audio: {
|
|
222
|
+
sampleRate: 44100 | 48000;
|
|
223
|
+
bitrate: number;
|
|
224
|
+
channels: 1 | 2;
|
|
225
|
+
codec: 'aac' | 'opus';
|
|
226
|
+
};
|
|
227
|
+
advanced?: {
|
|
228
|
+
lowLatency?: boolean;
|
|
229
|
+
hardwareEncoding?: boolean;
|
|
230
|
+
bFrames?: number;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export declare interface StreamSource {
|
|
235
|
+
id: string;
|
|
236
|
+
type: SourceType;
|
|
237
|
+
name: string;
|
|
238
|
+
settings: SourceSettings;
|
|
239
|
+
volume?: number;
|
|
240
|
+
muted?: boolean;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export declare interface StreamStats {
|
|
244
|
+
duration: number;
|
|
245
|
+
viewers: number;
|
|
246
|
+
peakViewers: number;
|
|
247
|
+
bitrate: number;
|
|
248
|
+
fps: number;
|
|
249
|
+
droppedFrames: number;
|
|
250
|
+
cpuUsage: number;
|
|
251
|
+
memoryUsage: number;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export declare interface TrackItem {
|
|
255
|
+
id: string;
|
|
256
|
+
assetId?: string;
|
|
257
|
+
type: TrackItemType;
|
|
258
|
+
startTime: number;
|
|
259
|
+
duration: number;
|
|
260
|
+
offset: number;
|
|
261
|
+
properties: TrackItemProperties;
|
|
262
|
+
effects: Effect[];
|
|
263
|
+
transitions: Transition[];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export declare interface TrackItemProperties {
|
|
267
|
+
x?: number;
|
|
268
|
+
y?: number;
|
|
269
|
+
width?: number;
|
|
270
|
+
height?: number;
|
|
271
|
+
rotation?: number;
|
|
272
|
+
opacity?: number;
|
|
273
|
+
scale?: number;
|
|
274
|
+
volume?: number;
|
|
275
|
+
text?: string;
|
|
276
|
+
font?: string;
|
|
277
|
+
fontSize?: number;
|
|
278
|
+
color?: string;
|
|
279
|
+
backgroundColor?: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export declare type TrackItemType = 'video' | 'audio' | 'image' | 'text' | 'shape';
|
|
283
|
+
|
|
284
|
+
export declare type TrackType = 'video' | 'audio' | 'text' | 'effects';
|
|
285
|
+
|
|
286
|
+
export declare interface Transition {
|
|
287
|
+
id: string;
|
|
288
|
+
type: TransitionType;
|
|
289
|
+
duration: number;
|
|
290
|
+
position: 'start' | 'end';
|
|
291
|
+
parameters?: Record<string, unknown>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export declare type TransitionType = 'fade' | 'dissolve' | 'wipe' | 'slide' | 'zoom' | 'push' | 'reveal' | 'barn' | 'iris';
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @package @nice2dev/ui-video
|
|
298
|
+
* Video Components Type Definitions
|
|
299
|
+
*/
|
|
300
|
+
export declare interface VideoProject {
|
|
301
|
+
id: string;
|
|
302
|
+
name: string;
|
|
303
|
+
resolution: VideoResolution;
|
|
304
|
+
frameRate: number;
|
|
305
|
+
duration: number;
|
|
306
|
+
tracks: VideoTrack[];
|
|
307
|
+
assets: MediaAsset[];
|
|
308
|
+
settings: ProjectSettings;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export declare interface VideoResolution {
|
|
312
|
+
width: number;
|
|
313
|
+
height: number;
|
|
314
|
+
label?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export declare interface VideoTrack {
|
|
318
|
+
id: string;
|
|
319
|
+
type: TrackType;
|
|
320
|
+
name: string;
|
|
321
|
+
items: TrackItem[];
|
|
322
|
+
muted: boolean;
|
|
323
|
+
locked: boolean;
|
|
324
|
+
visible: boolean;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export { }
|