@xylink/xy-rtc-sdk 3.8.1 → 3.9.1-beta.6
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/lib/action/index.d.ts +29 -5
- package/lib/enum/client.d.ts +15 -0
- package/lib/enum/contraints.d.ts +30 -102
- package/lib/enum/device.d.ts +1 -0
- package/lib/enum/errorCode.d.ts +58 -1
- package/lib/enum/index.d.ts +53 -16
- package/lib/index.d.ts +11 -8
- package/lib/main/client.d.ts +157 -79
- package/lib/main/deviceManager.d.ts +23 -4
- package/lib/main/helper.d.ts +2 -2
- package/lib/main/iauth.d.ts +67 -5
- package/lib/main/layoutManager.d.ts +29 -11
- package/lib/main/meeting.d.ts +73 -35
- package/lib/main/peer.d.ts +70 -121
- package/lib/main/qualityManager.d.ts +38 -9
- package/lib/main/stream.d.ts +237 -104
- package/lib/main/videoManager.d.ts +1 -9
- package/lib/tools/config.d.ts +5 -1
- package/lib/tools/dbManager.d.ts +106 -0
- package/lib/tools/detect.d.ts +2 -2
- package/lib/tools/enum.d.ts +1 -1
- package/lib/tools/httpClient.d.ts +15 -23
- package/lib/tools/i18n.d.ts +1 -1
- package/lib/tools/logger.d.ts +75 -74
- package/lib/tools/logger.worker.d.ts +13 -0
- package/lib/tools/quality.d.ts +113 -0
- package/lib/tools/quality.worker.d.ts +13 -0
- package/lib/tools/queue.d.ts +38 -3
- package/lib/tools/template.d.ts +3 -3
- package/lib/tools/utils.d.ts +8 -0
- package/lib/type/action.d.ts +4 -0
- package/lib/type/base.d.ts +2 -2
- package/lib/type/client.d.ts +280 -186
- package/lib/type/device.d.ts +21 -15
- package/lib/type/iauth.d.ts +112 -0
- package/lib/type/index.d.ts +4 -0
- package/lib/type/layout.d.ts +18 -1
- package/lib/type/logger.d.ts +112 -0
- package/lib/type/meeting.d.ts +11 -2
- package/lib/type/peer.d.ts +20 -0
- package/lib/type/quality.d.ts +101 -0
- package/lib/type/stream.d.ts +332 -134
- package/lib/xyrtc.cjs.js +1 -1
- package/lib/xyrtc.umd.js +1 -1
- package/package.json +5 -4
- package/lib/tools/db.d.ts +0 -85
package/lib/type/stream.d.ts
CHANGED
|
@@ -1,100 +1,275 @@
|
|
|
1
|
+
import { FACING_MODE_LIST } from 'src/enum';
|
|
1
2
|
import { IStatus } from './base';
|
|
2
3
|
/**
|
|
3
4
|
* MediaTrack状态
|
|
4
5
|
*
|
|
5
|
-
* @
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
6
|
+
* @param ENABLED 默认状态,无异常
|
|
7
|
+
* @param MUTE 流正在请求中
|
|
8
|
+
* @param ENDED 流已关闭
|
|
8
9
|
*/
|
|
9
|
-
export
|
|
10
|
+
export type IStreamTrackStatus = 'ENABLED' | 'MUTE' | 'ENDED';
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* 设备类型枚举列表
|
|
12
13
|
*
|
|
13
|
-
* @
|
|
14
|
+
* @param VIDEO video 视频设备
|
|
15
|
+
* @param AUDIO audio 音频设备
|
|
14
16
|
*/
|
|
15
|
-
export declare
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
export declare enum DeviceKind {
|
|
18
|
+
VIDEO = "video",
|
|
19
|
+
AUDIO = "audio"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 设备类型枚举列表
|
|
23
|
+
*
|
|
24
|
+
* @param VIDEO video 视频设备
|
|
25
|
+
* @param AUDIO audio 音频设备
|
|
26
|
+
*/
|
|
27
|
+
export type TDeviceKind = `${DeviceKind}`;
|
|
28
|
+
/**
|
|
29
|
+
* 请流时,控制流的帧率
|
|
30
|
+
*
|
|
31
|
+
* @param 0 无
|
|
32
|
+
* @param 100 低帧率
|
|
33
|
+
* @param 200 高帧率
|
|
34
|
+
*/
|
|
35
|
+
export type IMediaQualityType = 0 | 100 | 200;
|
|
36
|
+
/**
|
|
37
|
+
* content采集支持分辨率
|
|
38
|
+
*
|
|
39
|
+
* @param 720 1280*720
|
|
40
|
+
* @param 1080 1920*1080
|
|
41
|
+
*/
|
|
42
|
+
export type IContentResolutionType = 720 | 1080;
|
|
18
43
|
/**
|
|
19
|
-
* 采集
|
|
44
|
+
* 采集MediaStream状态
|
|
20
45
|
*
|
|
21
|
-
* @
|
|
22
|
-
* @
|
|
23
|
-
* @
|
|
24
|
-
* @
|
|
46
|
+
* @param NORMAL NORMAL 正常采集状态
|
|
47
|
+
* @param FAILED FAILED 采集失败状态,当前流采集失败/约束失败状态
|
|
48
|
+
* @param DISABLED DISABLED 禁用状态,不允许采集
|
|
49
|
+
* @param UNKNOWN UNKNOWN 初始化状态
|
|
25
50
|
*/
|
|
26
|
-
export declare
|
|
51
|
+
export declare enum StreamStatus {
|
|
52
|
+
'NORMAL' = "NORMAL",
|
|
53
|
+
'FAILED' = "FAILED",
|
|
54
|
+
'DISABLED' = "DISABLED",
|
|
55
|
+
'UNKNOWN' = "UNKNOWN"
|
|
56
|
+
}
|
|
27
57
|
/**
|
|
28
58
|
* 自定义采集流时产生的状态
|
|
29
59
|
*
|
|
30
|
-
* @
|
|
31
|
-
* @
|
|
32
|
-
* @
|
|
33
|
-
* @
|
|
34
|
-
* @
|
|
60
|
+
* @param NORMAL NORMAL 采集正常
|
|
61
|
+
* @param RECEIVE_ONLY RECEIVE_ONLY 仅发送(无权限、无设备等无流入会情况)
|
|
62
|
+
* @param NORMAL_AUDIO NORMAL_AUDIO 仅采集麦克风流,视频流转仅接收模式
|
|
63
|
+
* @param NORMAL_VIDEO NORMAL_VIDEO 仅采集摄像头流,麦克风转仅接收模式
|
|
64
|
+
* @param FAILED FAILED 其他异常
|
|
65
|
+
* @param UNKNOWN UNKNOWN 初始状态,未知情况
|
|
35
66
|
*/
|
|
36
|
-
export declare
|
|
67
|
+
export declare enum StreamCurrentType {
|
|
68
|
+
'NORMAL' = "NORMAL",
|
|
69
|
+
'NORMAL_VIDEO' = "NORMAL_VIDEO",
|
|
70
|
+
'NORMAL_AUDIO' = "NORMAL_AUDIO",
|
|
71
|
+
'RECEIVE_ONLY' = "RECEIVE_ONLY",
|
|
72
|
+
'FAILED' = "FAILED",
|
|
73
|
+
'UNKNOWN' = "UNKNOWN"
|
|
74
|
+
}
|
|
37
75
|
/**
|
|
38
76
|
* 自定义流类型
|
|
39
77
|
*
|
|
40
|
-
* @
|
|
41
|
-
* @
|
|
42
|
-
* @
|
|
43
|
-
* @
|
|
78
|
+
* @param CONTENT CONTENT 共享内容流
|
|
79
|
+
* @param PREVIEW PREVIEW 本地预览流
|
|
80
|
+
* @param PIPELINE PIPELINE 建立通道流
|
|
81
|
+
* @param REMOTE REMOTE 推送远端画面流
|
|
44
82
|
*/
|
|
45
|
-
export declare
|
|
83
|
+
export declare enum StreamType {
|
|
84
|
+
'CONTENT' = "CONTENT",
|
|
85
|
+
'PREVIEW' = "PREVIEW",
|
|
86
|
+
'PIPELINE' = "PIPELINE",
|
|
87
|
+
'REMOTE' = "REMOTE"
|
|
88
|
+
}
|
|
46
89
|
/**
|
|
47
|
-
*
|
|
90
|
+
* 分辨率枚举列表
|
|
91
|
+
*/
|
|
92
|
+
export declare enum StreamResolution {
|
|
93
|
+
RS90 = 90,
|
|
94
|
+
RS180 = 180,
|
|
95
|
+
RS360 = 360,
|
|
96
|
+
RS720 = 720,
|
|
97
|
+
RS1080 = 1080
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 帧率枚举列表
|
|
101
|
+
*/
|
|
102
|
+
export declare enum StreamFrameRate {
|
|
103
|
+
FR30 = 30,
|
|
104
|
+
FR15 = 15,
|
|
105
|
+
FR8 = 8
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 分辨率等级枚举列表
|
|
109
|
+
*/
|
|
110
|
+
export declare enum StreamResolutionLevel {
|
|
111
|
+
LEVEL90 = 0,
|
|
112
|
+
LEVEL180 = 1,
|
|
113
|
+
LEVEL360 = 2,
|
|
114
|
+
LEVEL720 = 3,
|
|
115
|
+
LEVEL1080 = 4
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 视频质量
|
|
48
119
|
*
|
|
49
|
-
* @
|
|
50
|
-
* @
|
|
120
|
+
* @param LOW - 低画面质量,帧率会自动降低到15帧接收;
|
|
121
|
+
* @param NORMAL - 普通画面质量,会基于带宽信息自动在30/15帧切换;
|
|
122
|
+
* @param HIGH - 高画面质量,会优先匹配高帧率高分辨率画面;
|
|
51
123
|
*/
|
|
52
|
-
export declare
|
|
124
|
+
export declare enum VideoQuality {
|
|
125
|
+
LOW = 0,
|
|
126
|
+
NORMAL = 1,
|
|
127
|
+
HIGH = 2
|
|
128
|
+
}
|
|
53
129
|
/**
|
|
54
|
-
*
|
|
130
|
+
* 流类型枚举列表
|
|
55
131
|
*
|
|
56
|
-
* @
|
|
57
|
-
* @
|
|
132
|
+
* @param VIDEO VIDEO 视频流
|
|
133
|
+
* @param AUDIO AUDIO 音频流
|
|
134
|
+
* @param ALL ALL 音频+视频流
|
|
58
135
|
*/
|
|
59
|
-
export declare
|
|
136
|
+
export declare enum StreamKind {
|
|
137
|
+
VIDEO = "VIDEO",
|
|
138
|
+
AUDIO = "AUDIO",
|
|
139
|
+
ALL = "ALL"
|
|
140
|
+
}
|
|
60
141
|
/**
|
|
61
|
-
*
|
|
142
|
+
* 流来源
|
|
62
143
|
*
|
|
63
|
-
* @
|
|
64
|
-
* @
|
|
65
|
-
* @value 720 1280*720
|
|
144
|
+
* @param SDK SDK 通过SDK内部创建
|
|
145
|
+
* @param CUSTOM CUSTOM 通过外部用户创建
|
|
66
146
|
*/
|
|
67
|
-
export declare
|
|
147
|
+
export declare enum StreamOrigin {
|
|
148
|
+
'SDK' = "SDK",
|
|
149
|
+
'CUSTOM' = "CUSTOM"
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 约束配置方式
|
|
153
|
+
*
|
|
154
|
+
* @param COMMON COMMON 通用配置
|
|
155
|
+
* @param ADVANCED ADVANCED 高级约束配置,强制约束采集
|
|
156
|
+
* @param FAILED FAILED 配置采集失败
|
|
157
|
+
*/
|
|
158
|
+
export declare enum ConstraintMode {
|
|
159
|
+
'COMMON' = "COMMON",
|
|
160
|
+
'ADVANCED' = "ADVANCED",
|
|
161
|
+
'FAILED' = "FAILED"
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 联播模式
|
|
165
|
+
*
|
|
166
|
+
* @param MULTI_RES MULTI_RESOLUTION 多路分辨率
|
|
167
|
+
* @param SCALE_RES SCALE_RESOLUTION 多路Scale分辨率
|
|
168
|
+
*/
|
|
169
|
+
export declare enum SimulcastMode {
|
|
170
|
+
'MULTI_RES' = "MULTI_RESOLUTION",
|
|
171
|
+
'SCALE_RES' = "SCALE_RESOLUTION"
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 摄像头前置后置
|
|
175
|
+
*
|
|
176
|
+
* @param user 前置
|
|
177
|
+
* @param environment 后置
|
|
178
|
+
*/
|
|
179
|
+
export type IDevicePosition = (typeof FACING_MODE_LIST)[number] | '';
|
|
180
|
+
/**
|
|
181
|
+
* 编码的优先级。在多个编码器存在的情况下,编码器的优先级决定了编码器的使用顺序
|
|
182
|
+
* 优先级的值越高,表示编码器的优先级越高,将会优先使用
|
|
183
|
+
*
|
|
184
|
+
* @param VERY_LOW very-low 编解码器优先级最低
|
|
185
|
+
* @param LOW low 默认值,编解码器优先级较低
|
|
186
|
+
* @param MEDIUM medium 编码器的优先级适中
|
|
187
|
+
* @param HIGH high 编码器的优先级较高,使编码器在其他编码器之前使用,以便在网络带宽受限的情况下,选择最优的编码器进行编码
|
|
188
|
+
*/
|
|
189
|
+
export declare enum PriorityMode {
|
|
190
|
+
'VERY_LOW' = "very-low",
|
|
191
|
+
'LOW' = "low",
|
|
192
|
+
'MEDIUM' = "medium",
|
|
193
|
+
'HIGH' = "high"
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 编解码器优先级
|
|
197
|
+
*
|
|
198
|
+
* @property { 'video' | 'audio' } kind - 流类型,分video和audio
|
|
199
|
+
*/
|
|
200
|
+
export interface TCustomStream {
|
|
201
|
+
kind: 'video' | 'audio';
|
|
202
|
+
}
|
|
68
203
|
/**
|
|
69
204
|
* 自定义流数据
|
|
70
205
|
*
|
|
71
|
-
* @property {
|
|
72
|
-
* @property {
|
|
73
|
-
* @property {
|
|
74
|
-
* @property {
|
|
75
|
-
* @property {
|
|
206
|
+
* @property { StreamType } type - 自定义流类型
|
|
207
|
+
* @property { MediaStream | null } stream - 采集设备流
|
|
208
|
+
* @property { TCustomStream[] } pipeStream - 协商通道流
|
|
209
|
+
* @property { StreamStatus } status - 状态
|
|
210
|
+
* @property { StreamResolution } resolution - 分辨率
|
|
211
|
+
* @property { StreamFrameRate } frameRate - 帧率
|
|
212
|
+
* @property { StreamOrigin } origin - 创建源
|
|
213
|
+
* @property { StreamKind } kind - 流画面种类:Video/Audio
|
|
214
|
+
* @property { ConstraintMode } constraintMode - 失败的约束模式
|
|
215
|
+
* @property { SimulcastMode } simulcastMode - 联播模式:多分辨率模式或者RTPSender Scale裁剪
|
|
216
|
+
* @property { boolean } enableAspectRatio - 采集时是否支持设置视频流的宽高比, 默认支持
|
|
76
217
|
*/
|
|
77
|
-
export interface
|
|
218
|
+
export interface IStreamConfig {
|
|
219
|
+
id: string;
|
|
220
|
+
type: StreamType;
|
|
221
|
+
status: StreamStatus;
|
|
78
222
|
stream: MediaStream | null;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
223
|
+
pipeStream: TCustomStream[];
|
|
224
|
+
resolution: StreamResolution;
|
|
225
|
+
kind?: StreamKind;
|
|
226
|
+
frameRate?: StreamFrameRate;
|
|
227
|
+
origin?: StreamOrigin;
|
|
228
|
+
constraintMode?: ConstraintMode;
|
|
229
|
+
simulcastMode?: SimulcastMode;
|
|
230
|
+
priorityMode?: PriorityMode;
|
|
231
|
+
enableAspectRatio?: boolean;
|
|
83
232
|
}
|
|
84
233
|
/**
|
|
85
234
|
* 流集合
|
|
86
235
|
*
|
|
87
|
-
* @property {
|
|
88
|
-
* @property {
|
|
89
|
-
* @property {
|
|
90
|
-
* @property {
|
|
236
|
+
* @property { IStreamConfig[] } previewStreams 本地预览流
|
|
237
|
+
* @property { IStreamConfig[] } streams 发送远端流
|
|
238
|
+
* @property { IStreamConfig[] } pipelineStreams 协商通道流
|
|
239
|
+
* @property { IStreamConfig[] } contentStreams 共享内容流
|
|
91
240
|
*/
|
|
92
241
|
export interface IGetMediaStreams {
|
|
93
|
-
previewStreams:
|
|
94
|
-
streams:
|
|
95
|
-
pipelineStreams:
|
|
96
|
-
contentStreams:
|
|
242
|
+
previewStreams: IStreamConfig[];
|
|
243
|
+
streams: IStreamConfig[];
|
|
244
|
+
pipelineStreams: IStreamConfig[];
|
|
245
|
+
contentStreams: IStreamConfig[];
|
|
97
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* 包含摄像头和共享视频的视频/音频的约束配置
|
|
249
|
+
*
|
|
250
|
+
* TODO:需要包含People和Content的约束类型
|
|
251
|
+
*/
|
|
252
|
+
export type TConstraintsConfig = {
|
|
253
|
+
video: any;
|
|
254
|
+
audio: any;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Map所有分辨率的约束类型
|
|
258
|
+
*/
|
|
259
|
+
export type IConstraintsConfigMap = {
|
|
260
|
+
[key in StreamResolution]?: Omit<{
|
|
261
|
+
[key in ConstraintMode]: TConstraintsConfig;
|
|
262
|
+
}, ConstraintMode.FAILED>;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* 初始Remote预配置,基于此配置生成Stream Config
|
|
266
|
+
*/
|
|
267
|
+
export type StreamsConfigMap = {
|
|
268
|
+
kind: StreamKind;
|
|
269
|
+
resolution: StreamResolution;
|
|
270
|
+
status: StreamStatus;
|
|
271
|
+
priorityMode?: PriorityMode;
|
|
272
|
+
};
|
|
98
273
|
/**
|
|
99
274
|
* Stream类采集流的状态和信息
|
|
100
275
|
*
|
|
@@ -102,7 +277,7 @@ export interface IGetMediaStreams {
|
|
|
102
277
|
* @property { string } detail 错误消息
|
|
103
278
|
*/
|
|
104
279
|
export interface IStreamCurrent {
|
|
105
|
-
type:
|
|
280
|
+
type: StreamCurrentType;
|
|
106
281
|
detail: string | IStatus;
|
|
107
282
|
}
|
|
108
283
|
/**
|
|
@@ -129,12 +304,28 @@ export interface IPublishParams {
|
|
|
129
304
|
* @property { string } type 类型
|
|
130
305
|
*/
|
|
131
306
|
export interface IStreamSender {
|
|
132
|
-
resolution:
|
|
307
|
+
resolution: StreamResolution;
|
|
133
308
|
track: MediaStreamTrack | null;
|
|
134
309
|
sender: RTCRtpSender;
|
|
135
310
|
status: string;
|
|
136
|
-
type:
|
|
311
|
+
type: StreamType;
|
|
312
|
+
id: string;
|
|
137
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* 封装Stream Sender
|
|
316
|
+
*
|
|
317
|
+
* @property { IStreamConfig } config - 自定义流配置
|
|
318
|
+
* @property { MediaStreamTrack | null } track - 当前通道发送的Track流
|
|
319
|
+
* @property { RTCRtpSender | null } sender - RTC发送器
|
|
320
|
+
*/
|
|
321
|
+
export interface ISenderConfig {
|
|
322
|
+
config: IStreamConfig;
|
|
323
|
+
track: MediaStreamTrack | null;
|
|
324
|
+
sender: RTCRtpSender;
|
|
325
|
+
}
|
|
326
|
+
export type ISenderMap = {
|
|
327
|
+
[key: string]: ISenderConfig;
|
|
328
|
+
};
|
|
138
329
|
/**
|
|
139
330
|
* Electron选择分享应用/屏幕资源
|
|
140
331
|
*
|
|
@@ -155,19 +346,31 @@ export interface ISource {
|
|
|
155
346
|
* stream init配置参数,用于在初始采集视频/音频流时指定设备信息
|
|
156
347
|
*
|
|
157
348
|
* @property { Object } devices 麦克风/摄像头/扬声器 设备id
|
|
158
|
-
* @
|
|
159
|
-
* @
|
|
160
|
-
* @
|
|
349
|
+
* @property { string } devices.audioInputValue 音频输入
|
|
350
|
+
* @property { string } devices.videoInValue 视频输入
|
|
351
|
+
* @property { string } devices.audioOutputValue 音频输出
|
|
161
352
|
*/
|
|
162
|
-
export
|
|
353
|
+
export interface IStreamInitConfig {
|
|
163
354
|
devices: {
|
|
164
355
|
audioInputValue?: string;
|
|
165
356
|
videoInValue?: string;
|
|
166
357
|
audioOutputValue?: string;
|
|
167
358
|
};
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* stream init第二个参数配置
|
|
362
|
+
*
|
|
363
|
+
* @property { boolean } muteVideo - 是否是关闭摄像头入会,默认是true,关闭摄像头
|
|
364
|
+
* @property { boolean } muteAudio - 是否是关闭麦克风入会,默认是true,关闭麦克风
|
|
365
|
+
* @property { boolean } enabledCustomStream - 是否启用自定义视频流
|
|
366
|
+
*/
|
|
367
|
+
export type IStreamInitParams = {
|
|
368
|
+
muteVideo?: boolean;
|
|
369
|
+
muteAudio?: boolean;
|
|
370
|
+
enabledCustomStream?: boolean;
|
|
168
371
|
};
|
|
169
372
|
/**
|
|
170
|
-
*
|
|
373
|
+
* Internals 统计数据
|
|
171
374
|
*
|
|
172
375
|
* @property { number } bytesReceived 接收的字节总数
|
|
173
376
|
* @property { number } bytesReceivedSecond 每秒接收字节数
|
|
@@ -178,7 +381,8 @@ export declare type IStreamInitConfig = {
|
|
|
178
381
|
* @property { number } roundTripTime 往返延时 (ms)
|
|
179
382
|
* @property { number } fractionLostSent 视频发送的丢包率
|
|
180
383
|
* @property { number } fractionLostReceived 视频接受的丢包率
|
|
181
|
-
* @property { string } mimeType
|
|
384
|
+
* @property { string } mimeType 视频Codec类型
|
|
385
|
+
* @property { string } audioMimeType 音频Codec类型
|
|
182
386
|
* @property { number } timestamp 时间戳
|
|
183
387
|
* @property { [prop: string]: IReceiver } receiver 所有接收视频的列表数据
|
|
184
388
|
* @property { [prop: string]: ISender } sender 所有发送视频的列表数据
|
|
@@ -187,7 +391,7 @@ export declare type IStreamInitConfig = {
|
|
|
187
391
|
* @property { number } audioSendLost 音频发送的丢包率
|
|
188
392
|
* @property { number } audioRecvLost 音频接受的丢包率
|
|
189
393
|
*/
|
|
190
|
-
export interface
|
|
394
|
+
export interface IInternals {
|
|
191
395
|
bytesReceived: number;
|
|
192
396
|
bytesReceivedSecond: number;
|
|
193
397
|
bytesSent: number;
|
|
@@ -199,6 +403,7 @@ export interface IInternels {
|
|
|
199
403
|
fractionLostSent: number;
|
|
200
404
|
fractionLostReceived: number;
|
|
201
405
|
mimeType: string;
|
|
406
|
+
audioMimeType: string;
|
|
202
407
|
timestamp: number;
|
|
203
408
|
receiver: {
|
|
204
409
|
[prop: string]: IReceiver;
|
|
@@ -215,6 +420,7 @@ export interface IInternels {
|
|
|
215
420
|
audioSendLost?: number;
|
|
216
421
|
audioRecvLost?: number;
|
|
217
422
|
}
|
|
423
|
+
export type IInternels = IInternals;
|
|
218
424
|
/**
|
|
219
425
|
* 接收器 Receiver 统计数据
|
|
220
426
|
* 详情可参考:https://w3c.github.io/webrtc-stats/#dictionary-rtcreceivedrtpstreamstats-members
|
|
@@ -254,33 +460,33 @@ export interface IInternels {
|
|
|
254
460
|
* @property { number } removedSamplesForAcceleration
|
|
255
461
|
*/
|
|
256
462
|
export interface IReceiver {
|
|
257
|
-
bytesReceived
|
|
258
|
-
bytesReceivedSecond
|
|
259
|
-
frameHeight
|
|
260
|
-
frameWidth
|
|
261
|
-
framesDecoded
|
|
262
|
-
framesDecodedSecond
|
|
263
|
-
framesReceived
|
|
264
|
-
framesReceivedSecond
|
|
265
|
-
isContent
|
|
266
|
-
isSupport
|
|
267
|
-
jitterBufferDelay
|
|
268
|
-
keyFramesDecoded
|
|
269
|
-
nackCount
|
|
270
|
-
name
|
|
271
|
-
packetsReceived
|
|
272
|
-
packetsReceivedSecond
|
|
273
|
-
packetsLost
|
|
274
|
-
packetsLostSecond
|
|
275
|
-
pliCount
|
|
276
|
-
timestamp
|
|
277
|
-
type
|
|
278
|
-
expResolution
|
|
279
|
-
status
|
|
280
|
-
framesPerSecond
|
|
281
|
-
framesDropped
|
|
282
|
-
ssrc
|
|
283
|
-
jitter
|
|
463
|
+
bytesReceived?: number;
|
|
464
|
+
bytesReceivedSecond?: number;
|
|
465
|
+
frameHeight?: number;
|
|
466
|
+
frameWidth?: number;
|
|
467
|
+
framesDecoded?: number;
|
|
468
|
+
framesDecodedSecond?: number;
|
|
469
|
+
framesReceived?: number;
|
|
470
|
+
framesReceivedSecond?: number;
|
|
471
|
+
isContent?: boolean;
|
|
472
|
+
isSupport?: boolean;
|
|
473
|
+
jitterBufferDelay?: number;
|
|
474
|
+
keyFramesDecoded?: number;
|
|
475
|
+
nackCount?: number;
|
|
476
|
+
name?: string;
|
|
477
|
+
packetsReceived?: number;
|
|
478
|
+
packetsReceivedSecond?: number;
|
|
479
|
+
packetsLost?: number;
|
|
480
|
+
packetsLostSecond?: number;
|
|
481
|
+
pliCount?: number;
|
|
482
|
+
timestamp?: number;
|
|
483
|
+
type?: string;
|
|
484
|
+
expResolution?: number;
|
|
485
|
+
status?: string;
|
|
486
|
+
framesPerSecond?: number;
|
|
487
|
+
framesDropped?: number;
|
|
488
|
+
ssrc?: string;
|
|
489
|
+
jitter?: number;
|
|
284
490
|
endpointId?: string;
|
|
285
491
|
participantId?: number;
|
|
286
492
|
mimeType?: string;
|
|
@@ -341,9 +547,9 @@ export interface ISender {
|
|
|
341
547
|
packetsSent: number;
|
|
342
548
|
packetsSentSecond: number;
|
|
343
549
|
timestamp: number;
|
|
344
|
-
type:
|
|
550
|
+
type: StreamType;
|
|
345
551
|
expBandwidth: number;
|
|
346
|
-
resolution:
|
|
552
|
+
resolution: StreamResolution;
|
|
347
553
|
pliCount: number;
|
|
348
554
|
firCount: number;
|
|
349
555
|
nackCount: number;
|
|
@@ -365,10 +571,10 @@ export interface ISender {
|
|
|
365
571
|
* @property { number } width 采集分辨率-width
|
|
366
572
|
* @property { number } height 采集分辨率-height
|
|
367
573
|
*/
|
|
368
|
-
export interface
|
|
574
|
+
export interface I_PEOPLE_CONSTRAINTS {
|
|
369
575
|
frameRate?: ConstrainDouble;
|
|
370
|
-
aspectRatio
|
|
371
|
-
resizeMode
|
|
576
|
+
aspectRatio?: number;
|
|
577
|
+
resizeMode?: 'crop-and-scale';
|
|
372
578
|
width?: number;
|
|
373
579
|
height?: number;
|
|
374
580
|
}
|
|
@@ -382,10 +588,10 @@ export interface IBASE_CONTRAINTS {
|
|
|
382
588
|
* @property { boolean } logicalSurface 指示是否允许用户选择不直接对应于显示区域的源表面;
|
|
383
589
|
* 详见:https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/logicalSurface
|
|
384
590
|
*/
|
|
385
|
-
export interface
|
|
591
|
+
export interface I_CONTENT_CONSTRAINTS {
|
|
386
592
|
cursor: string;
|
|
387
|
-
aspectRatio
|
|
388
|
-
resizeMode
|
|
593
|
+
aspectRatio?: number;
|
|
594
|
+
resizeMode?: 'crop-and-scale';
|
|
389
595
|
logicalSurface: true;
|
|
390
596
|
frameRate?: ConstrainDouble;
|
|
391
597
|
}
|
|
@@ -426,42 +632,34 @@ export interface IStreamChangeListType {
|
|
|
426
632
|
people: IStreamChange[];
|
|
427
633
|
}
|
|
428
634
|
/**
|
|
429
|
-
*
|
|
635
|
+
* 采集控制
|
|
636
|
+
*
|
|
637
|
+
* @param CAPTURE CAPTURE 启用采集
|
|
638
|
+
* @param KEEP KEEP 不处理
|
|
639
|
+
* @param FAILED FAILED 采集失败
|
|
430
640
|
*/
|
|
431
|
-
export declare enum
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
RS720 = 720,
|
|
436
|
-
RS1080 = 1080
|
|
641
|
+
export declare enum CaptureStatus {
|
|
642
|
+
'CAPTURE' = "CAPTURE",
|
|
643
|
+
'KEEP' = "KEEP",
|
|
644
|
+
'FAILED' = "FAILED"
|
|
437
645
|
}
|
|
438
646
|
/**
|
|
439
|
-
*
|
|
647
|
+
* 视频/音频采集状态控制
|
|
440
648
|
*/
|
|
441
|
-
export
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
FR8 = 8
|
|
649
|
+
export interface IEnabledCapture {
|
|
650
|
+
video: CaptureStatus;
|
|
651
|
+
audio: CaptureStatus;
|
|
445
652
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
LEVEL90 = 0,
|
|
451
|
-
LEVEL180 = 1,
|
|
452
|
-
LEVEL360 = 2,
|
|
453
|
-
LEVEL720 = 3,
|
|
454
|
-
LEVEL1080 = 4
|
|
653
|
+
export interface BaseStreamErrorParams {
|
|
654
|
+
type: StreamKind;
|
|
655
|
+
videoCapture: CaptureStatus;
|
|
656
|
+
audioCapture: CaptureStatus;
|
|
455
657
|
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
export declare enum VideoQuality {
|
|
464
|
-
LOW = 0,
|
|
465
|
-
NORMAL = 1,
|
|
466
|
-
HIGH = 2
|
|
658
|
+
export interface ICreateContentConfig {
|
|
659
|
+
screenAudio?: boolean;
|
|
660
|
+
}
|
|
661
|
+
export interface IFrameRateConfig {
|
|
662
|
+
frameRate?: ConstrainDouble;
|
|
663
|
+
}
|
|
664
|
+
export interface ISteamConfig {
|
|
467
665
|
}
|