@xylink/xy-rtc-sdk 3.10.0-beta.4 → 4.0.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/README.MD +36 -13
- package/lib/action/index.d.ts +61 -45
- package/lib/enum/analyser.d.ts +7 -0
- package/lib/enum/client.d.ts +8 -2
- package/lib/enum/constraints.d.ts +11 -16
- package/lib/enum/device.d.ts +0 -6
- package/lib/enum/errorCode.d.ts +5 -2
- package/lib/enum/index.d.ts +45 -7
- package/lib/enum/polling.d.ts +2 -0
- package/lib/feature/customMessage/index.d.ts +29 -0
- package/lib/feature/edu/index.d.ts +34 -0
- package/lib/feature/edu/index.type.d.ts +29 -0
- package/lib/feature/index.d.ts +3 -1
- package/lib/feature/{speaker.d.ts → speaker/index.d.ts} +29 -9
- package/lib/feature/speaker/index.type.d.ts +17 -0
- package/lib/index.d.ts +82 -28
- package/lib/interface/baseModule.type.d.ts +9 -0
- package/lib/interface/clientInterface.type.d.ts +128 -0
- package/lib/interface/contentTrackInterface.type.d.ts +15 -0
- package/lib/interface/event.type.d.ts +444 -0
- package/lib/interface/videoAudioTrackInterface.type.d.ts +17 -0
- package/lib/main/ability/const.d.ts +4 -1
- package/lib/main/ability/index.d.ts +7 -1
- package/lib/main/{auth.d.ts → auth/index.d.ts} +29 -19
- package/lib/main/client.d.ts +594 -633
- package/lib/main/clientBase.d.ts +40 -0
- package/lib/main/clientState.d.ts +56 -0
- package/lib/main/{deviceManager.d.ts → device/index.d.ts} +45 -13
- package/lib/{type/device.d.ts → main/device/index.type.d.ts} +65 -16
- package/lib/main/helper/index.d.ts +118 -0
- package/lib/main/helper/index.type.d.ts +12 -0
- package/lib/main/layout/index.d.ts +118 -105
- package/lib/main/layout/index.type.d.ts +282 -0
- package/lib/main/layout/polling.d.ts +212 -0
- package/lib/main/layout/state.d.ts +163 -0
- package/lib/main/layout/template.d.ts +15 -7
- package/lib/main/media/index.d.ts +177 -0
- package/lib/main/media/index.type.d.ts +29 -0
- package/lib/main/meeting/control.d.ts +107 -0
- package/lib/main/meeting/control.type.d.ts +24 -0
- package/lib/main/{meeting.d.ts → meeting/index.d.ts} +51 -7
- package/lib/main/meeting/verify.d.ts +70 -0
- package/lib/main/meeting/verify.type.d.ts +12 -0
- package/lib/main/peer.d.ts +120 -41
- package/lib/main/plugin/index.d.ts +28 -0
- package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
- package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
- package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
- package/lib/main/render/index.d.ts +116 -0
- package/lib/main/render/index.type.d.ts +36 -0
- package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
- package/lib/main/render/videoManager.type.d.ts +66 -0
- package/lib/main/roster/index.d.ts +39 -0
- package/lib/main/server/index.d.ts +79 -0
- package/lib/main/server/index.type.d.ts +21 -0
- package/lib/main/signal/index.d.ts +15 -0
- package/lib/main/socket/index.d.ts +95 -0
- package/lib/main/stream/index.d.ts +182 -0
- package/lib/main/track/baseTrack.d.ts +178 -0
- package/lib/main/track/contentTrack.d.ts +168 -0
- package/lib/main/track/customContentTrack.d.ts +18 -0
- package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
- package/lib/main/track/helper.d.ts +53 -0
- package/lib/main/track/videoAudioCapture.d.ts +90 -0
- package/lib/main/track/videoAudioTrack.d.ts +273 -0
- package/lib/main/vom/index.d.ts +44 -0
- package/lib/main/vom/index.type.d.ts +1 -0
- package/lib/tools/analyser.d.ts +30 -7
- package/lib/tools/analyserManager.d.ts +55 -0
- package/lib/tools/dbManager.d.ts +12 -1
- package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
- package/lib/tools/detectStream/index.d.ts +84 -0
- package/lib/tools/detectStream/index.type.d.ts +56 -0
- package/lib/tools/detectTool/index.d.ts +191 -0
- package/lib/tools/detectTool/index.type.d.ts +51 -0
- package/lib/tools/emitter.d.ts +27 -6
- package/lib/tools/enum.d.ts +1 -1
- package/lib/tools/httpClient.d.ts +5 -1
- package/lib/tools/i18n.d.ts +1 -1
- package/lib/tools/index.d.ts +1 -8
- package/lib/tools/log/logger.d.ts +44 -24
- package/lib/tools/log/logger.worker.d.ts +1 -1
- package/lib/tools/log/loggerManager.d.ts +3 -2
- package/lib/tools/pressure/index.d.ts +33 -0
- package/lib/tools/pressure/index.type.d.ts +22 -0
- package/lib/tools/promiseQueue.d.ts +6 -0
- package/lib/tools/regex.d.ts +4 -0
- package/lib/tools/resize.d.ts +3 -0
- package/lib/tools/snapshot.d.ts +1 -1
- package/lib/tools/socket.d.ts +12 -2
- package/lib/tools/template/index.d.ts +11 -88
- package/lib/tools/template/mobile.d.ts +1 -1
- package/lib/tools/template/polling.d.ts +8 -0
- package/lib/tools/utils.d.ts +25 -16
- package/lib/tools/verify.d.ts +7 -0
- package/lib/type/ability.d.ts +1 -1
- package/lib/type/analyser.d.ts +26 -1
- package/lib/type/auth.d.ts +22 -22
- package/lib/type/base.d.ts +36 -32
- package/lib/type/capture.d.ts +9 -0
- package/lib/type/client.d.ts +379 -498
- package/lib/type/index.d.ts +25 -2
- package/lib/type/layout.d.ts +84 -47
- package/lib/type/logger.d.ts +19 -12
- package/lib/type/meeting.d.ts +89 -68
- package/lib/type/peer.d.ts +65 -1
- package/lib/type/polling.d.ts +194 -0
- package/lib/type/quality.d.ts +16 -6
- package/lib/type/socket.d.ts +0 -18
- package/lib/type/stream.d.ts +138 -108
- package/lib/type/track.d.ts +139 -0
- package/lib/xyrtc.cjs.js +1 -1
- package/lib/xyrtc.umd.js +1 -1
- package/package.json +13 -10
- package/lib/main/clientImplements.d.ts +0 -99
- package/lib/main/helper.d.ts +0 -104
- package/lib/main/stream.d.ts +0 -418
- package/lib/tools/detect.d.ts +0 -44
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polling Lib Type Defined
|
|
3
|
+
*
|
|
4
|
+
* Created at : 2022-10-27 18:13:24
|
|
5
|
+
* Last modified : 2024-06-04 16:41:42
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* 轮询多画面布局模型
|
|
9
|
+
*
|
|
10
|
+
* @property 1x1 - 对称1画面
|
|
11
|
+
* @property 2x1 - 对称2画面
|
|
12
|
+
* @property 3x1 - 对称3画面
|
|
13
|
+
* @property 4x1 - 对称4画面
|
|
14
|
+
* @property 4x2 - 非对称4画面
|
|
15
|
+
* @property 5x1 - 非对称5画面
|
|
16
|
+
* @property 6x1 - 对称6画面
|
|
17
|
+
* @property 6x2 - 非对称6画面
|
|
18
|
+
* @property 8x1 - 非对称8画面
|
|
19
|
+
* @property 9x1 - 对称9画面
|
|
20
|
+
*/
|
|
21
|
+
export declare enum CustomizedMode {
|
|
22
|
+
'1x1' = "1x1",
|
|
23
|
+
'2x1' = "2x1",
|
|
24
|
+
'3x1' = "3x1",
|
|
25
|
+
'4x1' = "4x1",
|
|
26
|
+
'4x2' = "4x2",
|
|
27
|
+
'5x1' = "5x1",
|
|
28
|
+
'6x1' = "6x1",
|
|
29
|
+
'6x2' = "6x2",
|
|
30
|
+
'8x1' = "8x1",
|
|
31
|
+
'9x1' = "9x1"
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 多画面布局成员位置属性
|
|
35
|
+
*
|
|
36
|
+
* @property SPEAKER - 语音激励
|
|
37
|
+
* @property SPECIFIED - 指定成员
|
|
38
|
+
* @property AUTO - 自动轮询
|
|
39
|
+
*/
|
|
40
|
+
export declare enum CustomizedType {
|
|
41
|
+
'SPEAKER' = "speaker",
|
|
42
|
+
'SPECIFIED' = "specified",
|
|
43
|
+
'AUTO' = "auto"
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 轮询状态
|
|
47
|
+
*
|
|
48
|
+
* @property INIT - 初始化状态
|
|
49
|
+
* @property READY - 轮询准备状态
|
|
50
|
+
* @property PAUSE_MEETING - 会控轮询暂停状态
|
|
51
|
+
* @property PAUSE_SDK - SDK基于优先级暂停轮询状态
|
|
52
|
+
* @property POLLING - 正在轮询中
|
|
53
|
+
*/
|
|
54
|
+
export declare enum PollingState {
|
|
55
|
+
'INIT' = "INIT",
|
|
56
|
+
'READY' = "READY",
|
|
57
|
+
'PAUSE_MEETING' = "PAUSE_MEETING",
|
|
58
|
+
'PAUSE_SDK' = "PAUSE_SDK",
|
|
59
|
+
'POLLING' = "POLLING"
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 自动轮询多画面状态
|
|
63
|
+
*
|
|
64
|
+
* @property NORMAL - 画面正常
|
|
65
|
+
* @property NO_JOINED - 未入会
|
|
66
|
+
* @property VIDEO_MUTE - 视频暂停
|
|
67
|
+
* @property NOT_FOUND - 未符合条件的终端
|
|
68
|
+
* @property NULL - 画面为空
|
|
69
|
+
*/
|
|
70
|
+
export declare enum AutoState {
|
|
71
|
+
'NORMAL' = "NORMAL",
|
|
72
|
+
'NO_JOINED' = "NO_JOINED",
|
|
73
|
+
'VIDEO_MUTE' = "VIDEO_MUTE",
|
|
74
|
+
'NOT_FOUND' = "NOT_FOUND",
|
|
75
|
+
'NULL' = "NULL"
|
|
76
|
+
}
|
|
77
|
+
export declare enum AutoPollingDataEntry {
|
|
78
|
+
'FULL_ROSTER' = 0,
|
|
79
|
+
'SPECIFIED' = 1
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 会控指定成员基础数据
|
|
83
|
+
*
|
|
84
|
+
* @property { string } di - endpointId,参会者唯一ID
|
|
85
|
+
* @property { string } dn - deviceNumber,暂时未使用
|
|
86
|
+
*/
|
|
87
|
+
export type BaseSpecifiedInfo = {
|
|
88
|
+
di: string;
|
|
89
|
+
dn: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* 轮询布局模型
|
|
93
|
+
*/
|
|
94
|
+
export type PollingModeItem = CustomizedMode | null;
|
|
95
|
+
/**
|
|
96
|
+
* 轮询模型状态
|
|
97
|
+
*
|
|
98
|
+
* @property { PollingModeItem } pre - 上一次轮询模型状态
|
|
99
|
+
* @property { PollingModeItem } next - 最新的轮询模型状态
|
|
100
|
+
*/
|
|
101
|
+
export interface PollingMode {
|
|
102
|
+
pre: PollingModeItem;
|
|
103
|
+
next: PollingModeItem;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 封装轮询数据结构
|
|
107
|
+
*
|
|
108
|
+
* @property { string } endpointId - 参会者唯一ID
|
|
109
|
+
* @property { number } mediaGroupId - 参会者通道分组,0代表People,1代表Content
|
|
110
|
+
* @property { AutoState } state - 参会者当前画面状态
|
|
111
|
+
* @property { string } deviceName - 参会者名称
|
|
112
|
+
*/
|
|
113
|
+
export interface BasePollingItem {
|
|
114
|
+
endpointId: string;
|
|
115
|
+
mediaGroupId: number;
|
|
116
|
+
state: AutoState;
|
|
117
|
+
deviceName?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* 指定轮询列表
|
|
121
|
+
*
|
|
122
|
+
* @property { number } index - 当前轮询的页码数(pollingList的索引位置),翻页使用
|
|
123
|
+
* @property { BasePollingItem[] } pollingList - 当前指定轮询成员列表数据
|
|
124
|
+
*/
|
|
125
|
+
export interface SpecifiedMap {
|
|
126
|
+
index: number;
|
|
127
|
+
pollingList: BasePollingItem[];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* 自动轮询列表
|
|
131
|
+
*
|
|
132
|
+
* @property { number } pageSize - 当前页成员数
|
|
133
|
+
* @property { number } totalPage - 总页数
|
|
134
|
+
* @property { number } currentPage - 当前页码
|
|
135
|
+
* @property { BasePollingItem[] } pollingList - 当前自动轮询成员列表数据
|
|
136
|
+
*/
|
|
137
|
+
export interface AutoPollingMap {
|
|
138
|
+
pageSize: number;
|
|
139
|
+
totalPage: number;
|
|
140
|
+
currentPage: number;
|
|
141
|
+
pollingList: BasePollingItem[];
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 会控自动轮询消息-基础数据结构
|
|
145
|
+
*
|
|
146
|
+
* @property { number[] } layout - 坐标系数,[x,y,w,h],分辨代表X、Y、Width、Height系数,由于是硬件16:9容器的系数,因此SDK无法使用
|
|
147
|
+
* @property { number } sequence - 当前位置的索引位
|
|
148
|
+
* @property { number } pollingInterval - 当前轮询间隔时间
|
|
149
|
+
* @property { BaseSpecifiedInfo[] } items - 轮询的成员列表数据
|
|
150
|
+
* @property { CustomizedType } type - 多画面布局成员位置属性
|
|
151
|
+
* @property { boolean } autoFill - 是否自动裁剪
|
|
152
|
+
* @property { boolean } pollingPause - 轮询多画面是否暂停,true代表暂停,false代表轮询中
|
|
153
|
+
*/
|
|
154
|
+
export type CustomizedItem = {
|
|
155
|
+
layout: number[];
|
|
156
|
+
sequence: number;
|
|
157
|
+
pollingInterval: number;
|
|
158
|
+
items: BaseSpecifiedInfo[];
|
|
159
|
+
type: CustomizedType;
|
|
160
|
+
autoFill: boolean;
|
|
161
|
+
pollingPause: boolean;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* 混合轮询多画面消息
|
|
165
|
+
*
|
|
166
|
+
* @property { boolean } mix - 是否是混合轮询
|
|
167
|
+
* @property { boolean } auto - 是否是自动轮询,true代表启用自动轮询
|
|
168
|
+
* @property { CustomizedItem[] } detail - 轮询多画面列表数据,包含每一项的详细配置数据
|
|
169
|
+
* @property { boolean } useAvc - 是否是AVC合并画面模式
|
|
170
|
+
* @property { string } modeType - 多画面类型,分svc/是否是AVC合并画面模式
|
|
171
|
+
* @property { object } exFlags - 针对avc的额外配置项
|
|
172
|
+
* @property { CustomizedMode } mode - 多画面布局模型
|
|
173
|
+
* @property { BaseSpecifiedInfo[] } autoSpecified - 自动轮询/手动轮询的指定轮询列表
|
|
174
|
+
* @property { boolean } polling - 是否是轮询模式,true代表正在轮询
|
|
175
|
+
* @property { boolean } templatePolling - 忽略
|
|
176
|
+
* @property { array } templateDetails - 忽略
|
|
177
|
+
* @property { boolean } skipUnjoined - 自动/指定论序时,是否忽略未入会终端
|
|
178
|
+
* @property { boolean } skipMuteVideo - 自动/指定轮询时,是否忽略视频关闭终端
|
|
179
|
+
*/
|
|
180
|
+
export interface ICustomizedLayout {
|
|
181
|
+
mix: boolean;
|
|
182
|
+
auto: boolean;
|
|
183
|
+
detail: CustomizedItem[];
|
|
184
|
+
useAvc: boolean;
|
|
185
|
+
modeType: string;
|
|
186
|
+
exFlags: object;
|
|
187
|
+
mode: CustomizedMode;
|
|
188
|
+
autoSpecified: BaseSpecifiedInfo[];
|
|
189
|
+
polling: boolean;
|
|
190
|
+
templatePolling: boolean;
|
|
191
|
+
templateDetails: [];
|
|
192
|
+
skipUnjoined: boolean;
|
|
193
|
+
skipMuteVideo: boolean;
|
|
194
|
+
}
|
package/lib/type/quality.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Quality Type
|
|
3
3
|
*
|
|
4
4
|
* Created at : 2023-05-04 11:22:41
|
|
5
|
-
* Last modified :
|
|
5
|
+
* Last modified : 2024-06-05 11:07:38
|
|
6
6
|
*/
|
|
7
|
-
import { ILayout } from './
|
|
7
|
+
import { ILayout } from './index';
|
|
8
8
|
import { IStreamConfig } from './stream';
|
|
9
9
|
/**
|
|
10
10
|
* 网络质量信号等级
|
|
@@ -100,10 +100,10 @@ export interface IVideoQuality {
|
|
|
100
100
|
/**
|
|
101
101
|
* 远端网络质量信号等级
|
|
102
102
|
*
|
|
103
|
-
* @property { string } fromCallUri
|
|
104
|
-
* @property { number } fromPid
|
|
105
|
-
* @property { NetworkQualityLevel } networkLevel 网络质量信号等级
|
|
106
|
-
* @property { string } toCallUri
|
|
103
|
+
* @property { string } fromCallUri - 提供质量的callUri
|
|
104
|
+
* @property { number } fromPid - 提供质量的pid
|
|
105
|
+
* @property { NetworkQualityLevel } networkLevel - 网络质量信号等级
|
|
106
|
+
* @property { string } toCallUri - 发送给远端的CallUri
|
|
107
107
|
*
|
|
108
108
|
*/
|
|
109
109
|
export interface INetworkParameter {
|
|
@@ -136,6 +136,14 @@ export declare enum QualityOperateType {
|
|
|
136
136
|
REPORT_INTERNALS = "REPORT_INTERNALS",
|
|
137
137
|
REPORT_NETWORK_LEVEL = "REPORT_NETWORK_LEVEL"
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* 实时讲话人简化版本数据,用户匹配audio internal数据
|
|
141
|
+
*/
|
|
142
|
+
export interface IAudioSpeakerInfo {
|
|
143
|
+
name: string;
|
|
144
|
+
endpointId: string;
|
|
145
|
+
trackId: string;
|
|
146
|
+
}
|
|
139
147
|
/**
|
|
140
148
|
* 传递给Worker的原始数据
|
|
141
149
|
*
|
|
@@ -146,6 +154,7 @@ export declare enum QualityOperateType {
|
|
|
146
154
|
* @property { boolean } isContent - 是否是content
|
|
147
155
|
* @property { IStreamConfig } streamConfig - 流配置
|
|
148
156
|
* @property { boolean } isFirefox - 是否是火狐浏览器
|
|
157
|
+
* @property { IAudioSpeakerInfo } audioSpeaker - audio speaker讲话人信息
|
|
149
158
|
*/
|
|
150
159
|
export interface IWorkerVideoReceiver {
|
|
151
160
|
layoutItem?: ILayout;
|
|
@@ -155,6 +164,7 @@ export interface IWorkerVideoReceiver {
|
|
|
155
164
|
isContent?: boolean;
|
|
156
165
|
streamConfig?: IStreamConfig;
|
|
157
166
|
isFirefox?: boolean;
|
|
167
|
+
audioSpeaker?: IAudioSpeakerInfo;
|
|
158
168
|
}
|
|
159
169
|
/**
|
|
160
170
|
* 传递给Worker的结构数据
|
package/lib/type/socket.d.ts
CHANGED
|
@@ -40,21 +40,3 @@ export declare enum SocketMessage {
|
|
|
40
40
|
PING = "PING",
|
|
41
41
|
PONG = "PONG"
|
|
42
42
|
}
|
|
43
|
-
/**
|
|
44
|
-
* socket事件
|
|
45
|
-
*
|
|
46
|
-
* @param { OPEN } OPEN - socket连接成功
|
|
47
|
-
* @param { MESSAGE } MESSAGE - socket接收到消息
|
|
48
|
-
* @param { ERROR } ERROR - socket连接错误
|
|
49
|
-
* @param { CLOSE } CLOSE - socket连接关闭
|
|
50
|
-
* @param { TIMEOUT } TIMEOUT - socket连接超时
|
|
51
|
-
* @param { RECONNECT } RECONNECT - socket重连
|
|
52
|
-
*/
|
|
53
|
-
export declare enum SocketEvent {
|
|
54
|
-
OPEN = "open",
|
|
55
|
-
MESSAGE = "message",
|
|
56
|
-
ERROR = "error",
|
|
57
|
-
CLOSE = "close",
|
|
58
|
-
TIMEOUT = "timeout",
|
|
59
|
-
RECONNECT = "reconnect"
|
|
60
|
-
}
|
package/lib/type/stream.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { FACING_MODE_LIST } from '../enum';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* @param ENABLED 默认状态,无异常
|
|
7
|
-
* @param MUTE 流正在请求中
|
|
8
|
-
* @param ENDED 流已关闭
|
|
9
|
-
*/
|
|
10
|
-
export type IStreamTrackStatus = 'ENABLED' | 'MUTE' | 'ENDED';
|
|
1
|
+
import { FACING_MODE_LIST } from '../enum/index';
|
|
2
|
+
import { IReturnResult } from './base';
|
|
3
|
+
import { ContentMode } from './client';
|
|
4
|
+
import { XYDisplaySurface } from './track';
|
|
11
5
|
/**
|
|
12
6
|
* 设备类型枚举列表
|
|
13
7
|
*
|
|
@@ -84,7 +78,7 @@ export declare enum StreamType {
|
|
|
84
78
|
*
|
|
85
79
|
* @param RS90 - 160*90
|
|
86
80
|
* @param RS180 - 320*180
|
|
87
|
-
* @param RS360 - 640*
|
|
81
|
+
* @param RS360 - 640*360
|
|
88
82
|
* @param RS720 - 1280*720
|
|
89
83
|
* @param RS1080 - 1920*1080
|
|
90
84
|
*/
|
|
@@ -114,7 +108,7 @@ export declare enum StreamResolutionLevel {
|
|
|
114
108
|
LEVEL1080 = 4
|
|
115
109
|
}
|
|
116
110
|
/**
|
|
117
|
-
*
|
|
111
|
+
* 视频质量等级
|
|
118
112
|
*
|
|
119
113
|
* @param LOW - 低画面质量,帧率会自动降低到15帧接收;
|
|
120
114
|
* @param NORMAL - 普通画面质量,会基于带宽信息自动在30/15帧切换;
|
|
@@ -219,10 +213,11 @@ export interface IStreamConfig {
|
|
|
219
213
|
type: StreamType;
|
|
220
214
|
status: StreamStatus;
|
|
221
215
|
stream: MediaStream | null;
|
|
216
|
+
streamId?: string;
|
|
222
217
|
pipeStream: TCustomStream[];
|
|
223
218
|
resolution: StreamResolution;
|
|
219
|
+
frameRate: StreamFrameRate;
|
|
224
220
|
kind?: StreamKind;
|
|
225
|
-
frameRate?: StreamFrameRate;
|
|
226
221
|
origin?: StreamOrigin;
|
|
227
222
|
constraintMode?: ConstraintMode;
|
|
228
223
|
simulcastMode?: SimulcastMode;
|
|
@@ -277,7 +272,7 @@ export type StreamsConfigMap = {
|
|
|
277
272
|
*/
|
|
278
273
|
export interface IStreamCurrent {
|
|
279
274
|
type: StreamCurrentType;
|
|
280
|
-
detail: string |
|
|
275
|
+
detail: string | IReturnResult;
|
|
281
276
|
}
|
|
282
277
|
/**
|
|
283
278
|
* publish推送流数据到Peer链接
|
|
@@ -330,13 +325,13 @@ export type ISenderMap = {
|
|
|
330
325
|
/**
|
|
331
326
|
* Electron选择分享应用/屏幕资源
|
|
332
327
|
*
|
|
333
|
-
* @property { unknown } appIcon 资源icon
|
|
334
|
-
* @property { string } display_id 显示id
|
|
335
|
-
* @property { string } id 资源id
|
|
336
|
-
* @property { string } name 应用名称/屏幕名称
|
|
337
|
-
* @property { unknown } thumbnail thumbnail type is NativeImage
|
|
328
|
+
* @property { unknown } appIcon - 资源icon
|
|
329
|
+
* @property { string } display_id - 显示id
|
|
330
|
+
* @property { string } id - 资源id
|
|
331
|
+
* @property { string } name - 应用名称/屏幕名称
|
|
332
|
+
* @property { unknown } thumbnail - thumbnail type is NativeImage
|
|
338
333
|
*/
|
|
339
|
-
export interface
|
|
334
|
+
export interface XYElectronSource {
|
|
340
335
|
appIcon: any;
|
|
341
336
|
display_id: string;
|
|
342
337
|
id: string;
|
|
@@ -367,26 +362,27 @@ export type IStreamInitParams = {
|
|
|
367
362
|
enabledCustomStream?: boolean;
|
|
368
363
|
};
|
|
369
364
|
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* @property { number } bytesReceived 接收的字节总数
|
|
373
|
-
* @property { number } bytesReceivedSecond 每秒接收字节数
|
|
374
|
-
* @property { number } bytesSent 发送的字节总数
|
|
375
|
-
* @property { number } bytesSentSecond 每秒发送字节数
|
|
376
|
-
* @property { number } jitterSent 发送的抖动(ms)
|
|
377
|
-
* @property { number } jitterReceived 接受的抖动(ms)
|
|
378
|
-
* @property { number }
|
|
379
|
-
* @property { number }
|
|
380
|
-
* @property { number }
|
|
381
|
-
* @property {
|
|
382
|
-
* @property { string }
|
|
383
|
-
* @property {
|
|
384
|
-
* @property {
|
|
385
|
-
* @property { [prop: string]:
|
|
386
|
-
* @property { [prop: string]:
|
|
387
|
-
* @property { [prop: string]:
|
|
388
|
-
* @property {
|
|
389
|
-
* @property { number }
|
|
365
|
+
* 质量统计数据
|
|
366
|
+
*
|
|
367
|
+
* @property { number } bytesReceived - 接收的字节总数
|
|
368
|
+
* @property { number } bytesReceivedSecond - 每秒接收字节数
|
|
369
|
+
* @property { number } bytesSent - 发送的字节总数
|
|
370
|
+
* @property { number } bytesSentSecond - 每秒发送字节数
|
|
371
|
+
* @property { number } jitterSent - 发送的抖动(ms)
|
|
372
|
+
* @property { number } jitterReceived - 接受的抖动(ms)
|
|
373
|
+
* @property { number } audioSendJitter - 音频发送抖动
|
|
374
|
+
* @property { number } roundTripTime - 往返延时 (ms)
|
|
375
|
+
* @property { number } fractionLostSent - 视频发送的丢包率
|
|
376
|
+
* @property { number } fractionLostReceived - 视频接受的丢包率
|
|
377
|
+
* @property { string } mimeType - 视频Codec类型
|
|
378
|
+
* @property { string } audioMimeType - 音频Codec类型
|
|
379
|
+
* @property { number } timestamp - 时间戳
|
|
380
|
+
* @property { [prop: string]: IReceiver } receiver - 所有接收视频的列表数据
|
|
381
|
+
* @property { [prop: string]: ISender } sender - 所有发送视频的列表数据
|
|
382
|
+
* @property { [prop: string]: IReceiver } audioReceiver - 所有接收音频的列表数据
|
|
383
|
+
* @property { [prop: string]: ISender } audioSender - 所有发送音频的列表数据
|
|
384
|
+
* @property { number } audioSendLost - 音频发送的丢包率
|
|
385
|
+
* @property { number } audioRecvLost - 音频接受的丢包率
|
|
390
386
|
*/
|
|
391
387
|
export interface IInternals {
|
|
392
388
|
bytesReceived: number;
|
|
@@ -422,39 +418,47 @@ export type IInternels = IInternals;
|
|
|
422
418
|
* 接收器 Receiver 统计数据
|
|
423
419
|
* 详情可参考:https://w3c.github.io/webrtc-stats/#dictionary-rtcreceivedrtpstreamstats-members
|
|
424
420
|
*
|
|
425
|
-
* @property { number } bytesReceived 接收总量
|
|
426
|
-
* @property { number } bytesReceivedSecond 每秒接收数据
|
|
427
|
-
* @property { number } frameHeight 解码帧的height
|
|
428
|
-
* @property { number } frameWidth 解码帧的width
|
|
429
|
-
* @property { number } framesDecoded frame编码量
|
|
430
|
-
* @property { number } framesDecodedSecond 每秒frame编码量
|
|
431
|
-
* @property { number } framesReceived frame接收量
|
|
432
|
-
* @property { number } framesReceivedSecond 每秒frame接收量
|
|
433
|
-
* @property { boolean } isContent 是否是分享content
|
|
434
|
-
* @property { boolean } isSupport 忽略
|
|
435
|
-
* @property { number } jitterBufferDelay 音频样本或视频帧从接收到退出抖动缓冲区所花费的时间总和,以秒为单位
|
|
436
|
-
* @property { number } keyFramesDecoded 代表关键帧的总数
|
|
437
|
-
* @property { number } nackCount 计算此接收器发送的否定确认(NACK)数据包的总数
|
|
438
|
-
* @property { string } name 与会者昵称
|
|
439
|
-
* @property { number } packetsReceived 此传输上收到的数据包总数
|
|
440
|
-
* @property { number } packetsReceivedSecond 此传输上每秒收到的数据包数量
|
|
441
|
-
* @property { number } packetsLost 此传输上丢失的数据包总数
|
|
442
|
-
* @property { number } packetsLostSecond 此传输上每秒丢失的数据包数量
|
|
443
|
-
* @property { number } pliCount 接收器发送的图片丢失指示(PLI)数据包的总数
|
|
444
|
-
* @property { number } timestamp 时间戳
|
|
445
|
-
* @property { string } type 与会者
|
|
446
|
-
* @property { number } expResolution 当前通道期望流分辨率
|
|
447
|
-
* @property { string } status 状态
|
|
448
|
-
* @property { number } framesPerSecond 此接收器解码的帧的 QP 值的总和
|
|
449
|
-
* @property {
|
|
421
|
+
* @property { number } bytesReceived - 接收总量
|
|
422
|
+
* @property { number } bytesReceivedSecond - 每秒接收数据
|
|
423
|
+
* @property { number } frameHeight - 解码帧的height
|
|
424
|
+
* @property { number } frameWidth - 解码帧的width
|
|
425
|
+
* @property { number } framesDecoded - frame编码量
|
|
426
|
+
* @property { number } framesDecodedSecond - 每秒frame编码量
|
|
427
|
+
* @property { number } framesReceived - frame接收量
|
|
428
|
+
* @property { number } framesReceivedSecond - 每秒frame接收量
|
|
429
|
+
* @property { boolean } isContent - 是否是分享content
|
|
430
|
+
* @property { boolean } isSupport - 忽略
|
|
431
|
+
* @property { number } jitterBufferDelay - 音频样本或视频帧从接收到退出抖动缓冲区所花费的时间总和,以秒为单位
|
|
432
|
+
* @property { number } keyFramesDecoded - 代表关键帧的总数
|
|
433
|
+
* @property { number } nackCount - 计算此接收器发送的否定确认(NACK)数据包的总数
|
|
434
|
+
* @property { string } name - 与会者昵称
|
|
435
|
+
* @property { number } packetsReceived - 此传输上收到的数据包总数
|
|
436
|
+
* @property { number } packetsReceivedSecond - 此传输上每秒收到的数据包数量
|
|
437
|
+
* @property { number } packetsLost - 此传输上丢失的数据包总数
|
|
438
|
+
* @property { number } packetsLostSecond - 此传输上每秒丢失的数据包数量
|
|
439
|
+
* @property { number } pliCount - 接收器发送的图片丢失指示(PLI)数据包的总数
|
|
440
|
+
* @property { number } timestamp - 时间戳
|
|
441
|
+
* @property { string } type - 与会者Type
|
|
442
|
+
* @property { number } expResolution - 当前通道期望流分辨率
|
|
443
|
+
* @property { string } status - 状态
|
|
444
|
+
* @property { number } framesPerSecond - 此接收器解码的帧的 QP 值的总和
|
|
445
|
+
* @property { number } framesDropped - 丢弃的帧数,由于网络问题、解码器缓冲区溢出或其他原因而丢弃的帧的数量
|
|
446
|
+
* @property { string } ssrc - 同步源 (ssrc) 标识符是每个 [RFC3550] 的无符号整数值,用于标识此 stats 对象正在描述的 RTP 数据包流;
|
|
450
447
|
* 对于出站和入站本地,ssrc 描述了分别由这些端点发送和接收的轨道的统计信息;
|
|
451
448
|
* 对于远程入站和远程出站,ssrc 描述了由远程端点接收和发送到远程端点的轨道的统计信息;
|
|
452
|
-
* @property { number } jitter 视频接收抖动
|
|
453
|
-
* @property { string } endpointId 参会者的callUri
|
|
454
|
-
* @property { string } participantId participantId
|
|
455
|
-
* @property {
|
|
456
|
-
* @property { number }
|
|
457
|
-
* @property { number }
|
|
449
|
+
* @property { number } jitter - 视频接收抖动
|
|
450
|
+
* @property { string } endpointId - 参会者的callUri
|
|
451
|
+
* @property { string } participantId - participantId
|
|
452
|
+
* @property { string } mimeType - 编码器类型
|
|
453
|
+
* @property { number } audioLevel - 音频音量大小
|
|
454
|
+
* @property { number } insertedSamplesForDeceleration - 减速的插入样本数,用于音频流,同步音频流和视频流(或其他参考时间),插入的音频样本的数量。插入样本会导致播放速度减慢
|
|
455
|
+
* @property { number } insertedSamplesForDecelerationSecond - 每秒用于减速的插入样本数
|
|
456
|
+
* @property { number } totalSamplesReceived - 接收到的总样本数,开始到现在接收到的音频样本的总数量,用于评估接收数据的总体规模
|
|
457
|
+
* @property { number } totalSamplesReceivedSecond - 每秒接收到的样本总数
|
|
458
|
+
* @property { number } removedSamplesForAcceleration - 加速的移除样本数,同步音频流和视频流(或其他参考时间),移除的音频样本的数量。移除样本会导致播放速度加快
|
|
459
|
+
* @property { number } removedSamplesForAccelerationSecond - 每秒用于加速的移除样本数
|
|
460
|
+
* @property { number } ExpectWidth - 当前通道期望宽度
|
|
461
|
+
* @property { number } ExpectHeight - 当前通道期望高度
|
|
458
462
|
*/
|
|
459
463
|
export interface IReceiver {
|
|
460
464
|
bytesReceived?: number;
|
|
@@ -501,33 +505,36 @@ export interface IReceiver {
|
|
|
501
505
|
* 发送器 Sender 统计数据
|
|
502
506
|
* 详情可以参考:https://w3c.github.io/webrtc-stats/#dictionary-rtcoutboundrtpstreamstats-members
|
|
503
507
|
*
|
|
504
|
-
* @property { number } bytesSent 此RTCIceTransport上发送的有效负载字节总数
|
|
505
|
-
* @property { number } bytesSentSecond 每秒发送有效负载字节数
|
|
506
|
-
* @property { number } frameHeight 编码帧的高度
|
|
507
|
-
* @property { number } frameWidth 编码帧的宽度
|
|
508
|
-
* @property { number } framesEncoded 此RTP媒体流成功编码的帧总数
|
|
509
|
-
* @property { number } framesEncodedSecond 每秒成功编码的帧数
|
|
510
|
-
* @property { number } framesSent 此RTP流上发送的帧总数
|
|
511
|
-
* @property { number } framesSentSecond 每秒发送的帧数
|
|
512
|
-
* @property { number } hugeFramesSent 此RTP流发送的huge帧的总数
|
|
513
|
-
* @property { string } status 忽略
|
|
514
|
-
* @property { number } keyFramesEncoded 此RTP媒体流编码的关键帧总数
|
|
515
|
-
* @property { number } packetsSent 此传输发送的数据包总数
|
|
516
|
-
* @property { number } packetsSentSecond 此传输每秒发送的数据包数
|
|
517
|
-
* @property { number } timestamp 时间戳
|
|
518
|
-
* @property { string } type 发送器类型
|
|
519
|
-
* @property { number } expBandwidth 期望带宽
|
|
520
|
-
* @property {
|
|
521
|
-
* @property { number } pliCount 计算此发送方收到的图片丢失指示 (PLI) 数据包的总数
|
|
522
|
-
* @property { number } firCount 接收方已向发送方发送的完整帧内请求 (FIR) 数据包的数量
|
|
523
|
-
* @property { number } nackCount 计算此发送方收到的否定确认 (NACK) 数据包的总数
|
|
524
|
-
* @property { string } ssrc 标识此 stats 对象正在描述的 RTP 数据包流;
|
|
508
|
+
* @property { number } bytesSent - 此RTCIceTransport上发送的有效负载字节总数
|
|
509
|
+
* @property { number } bytesSentSecond - 每秒发送有效负载字节数
|
|
510
|
+
* @property { number } frameHeight - 编码帧的高度
|
|
511
|
+
* @property { number } frameWidth - 编码帧的宽度
|
|
512
|
+
* @property { number } framesEncoded - 此RTP媒体流成功编码的帧总数
|
|
513
|
+
* @property { number } framesEncodedSecond - 每秒成功编码的帧数
|
|
514
|
+
* @property { number } framesSent - 此RTP流上发送的帧总数
|
|
515
|
+
* @property { number } framesSentSecond - 每秒发送的帧数
|
|
516
|
+
* @property { number } hugeFramesSent - 此RTP流发送的huge帧的总数
|
|
517
|
+
* @property { string } status - 忽略
|
|
518
|
+
* @property { number } keyFramesEncoded - 此RTP媒体流编码的关键帧总数
|
|
519
|
+
* @property { number } packetsSent - 此传输发送的数据包总数
|
|
520
|
+
* @property { number } packetsSentSecond - 此传输每秒发送的数据包数
|
|
521
|
+
* @property { number } timestamp - 时间戳
|
|
522
|
+
* @property { string } type - 发送器类型
|
|
523
|
+
* @property { number } expBandwidth - 期望带宽
|
|
524
|
+
* @property { StreamResolution } resolution - 分辨率
|
|
525
|
+
* @property { number } pliCount - 计算此发送方收到的图片丢失指示 (PLI) 数据包的总数
|
|
526
|
+
* @property { number } firCount - 接收方已向发送方发送的完整帧内请求 (FIR) 数据包的数量
|
|
527
|
+
* @property { number } nackCount - 计算此发送方收到的否定确认 (NACK) 数据包的总数
|
|
528
|
+
* @property { string } ssrc - 标识此 stats 对象正在描述的 RTP 数据包流;
|
|
525
529
|
* 对于出站和入站本地,ssrc 描述了分别由这些端点发送和接收的轨道的统计信息;
|
|
526
530
|
* 对于远程入站和远程出站,ssrc 描述了由远程端点接收和发送到远程端点的轨道的统计信息;
|
|
527
|
-
* @property {
|
|
528
|
-
* @property {
|
|
529
|
-
* @property {
|
|
530
|
-
* @property {
|
|
531
|
+
* @property { string } mimeType - 编码器类型
|
|
532
|
+
* @property { number } audioLevel - 音量大小
|
|
533
|
+
* @property { number } packetsLost - 丢包总数
|
|
534
|
+
* @property { number } packetsLostSecond - 丢包率
|
|
535
|
+
* @property { boolean } isContent - 是否是分享content
|
|
536
|
+
* @property { boolean } jitter - 抖动
|
|
537
|
+
* @property { boolean } roundTripTime - 往返延时
|
|
531
538
|
*/
|
|
532
539
|
export interface ISender {
|
|
533
540
|
bytesSent: number;
|
|
@@ -568,7 +575,7 @@ export interface ISender {
|
|
|
568
575
|
* @property { number } width 采集分辨率-width
|
|
569
576
|
* @property { number } height 采集分辨率-height
|
|
570
577
|
*/
|
|
571
|
-
export interface
|
|
578
|
+
export interface XYPeopleConfig {
|
|
572
579
|
frameRate?: ConstrainDouble;
|
|
573
580
|
aspectRatio?: number;
|
|
574
581
|
resizeMode?: 'crop-and-scale';
|
|
@@ -578,19 +585,22 @@ export interface I_PEOPLE_CONSTRAINTS {
|
|
|
578
585
|
/**
|
|
579
586
|
* 初始化视频约束设置
|
|
580
587
|
*
|
|
581
|
-
* @property { string } cursor 用于指定content分享时,是否指定显示鼠标指针的显示/隐藏或者是否需要录制鼠标
|
|
582
|
-
* @property { number } aspectRatio 期待采集视频比例
|
|
583
|
-
* @property { 'crop-and-scale' } resizeMode 裁剪模式,此处使用裁剪比例模式,以满足分辨率要求;
|
|
584
|
-
* @property { ConstrainDouble } frameRate
|
|
585
|
-
* @property { boolean } logicalSurface
|
|
586
|
-
*
|
|
588
|
+
* @property { string } cursor - 用于指定content分享时,是否指定显示鼠标指针的显示/隐藏或者是否需要录制鼠标
|
|
589
|
+
* @property { number } aspectRatio - 期待采集视频比例
|
|
590
|
+
* @property { 'crop-and-scale' } resizeMode - 裁剪模式,此处使用裁剪比例模式,以满足分辨率要求;
|
|
591
|
+
* @property { ConstrainDouble } frameRate - 帧率
|
|
592
|
+
* @property { boolean } logicalSurface - 指示是否允许用户共享应用时采集非活跃的画面内容(生效异常)
|
|
593
|
+
* @property { boolean } displaySurface - 指示用户分享应用的默认类型,可选:browser(浏览器标签)、monitor(屏幕)、window(应用),默认是monitor屏幕
|
|
594
|
+
*
|
|
595
|
+
* API详见:https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/logicalSurface
|
|
587
596
|
*/
|
|
588
|
-
export interface
|
|
597
|
+
export interface XYContentConfig {
|
|
589
598
|
cursor: string;
|
|
590
599
|
aspectRatio?: number;
|
|
591
600
|
resizeMode?: 'crop-and-scale';
|
|
592
|
-
logicalSurface
|
|
601
|
+
logicalSurface?: boolean;
|
|
593
602
|
frameRate?: ConstrainDouble;
|
|
603
|
+
displaySurface?: XYDisplaySurface;
|
|
594
604
|
}
|
|
595
605
|
/**
|
|
596
606
|
* 媒体通知Web对视频流的分辨率、带宽信息、帧率进行限制
|
|
@@ -663,11 +673,31 @@ export interface ISteamConfig {
|
|
|
663
673
|
/**
|
|
664
674
|
* 切换设备方法额外配置
|
|
665
675
|
*
|
|
666
|
-
* @property { boolean } isDefault -
|
|
667
|
-
* @property { boolean } allowSpecifiedId -
|
|
668
|
-
*
|
|
676
|
+
* @property { boolean } isDefault - 可选,是否是系统默认设备,如果指定默认设备,则DeviceId可以提供空值
|
|
677
|
+
* @property { boolean } allowSpecifiedId - 可选,是否需要记录当前设备ID信息,默认内部的切换设备行为不需要记录,仅用户主动触发才会强制记录当前的设备ID信息
|
|
669
678
|
*/
|
|
670
679
|
export interface SwitchDeviceConfig {
|
|
671
680
|
isDefault?: boolean;
|
|
672
681
|
allowSpecifiedId?: boolean;
|
|
673
682
|
}
|
|
683
|
+
/**
|
|
684
|
+
* 控制分享Content的状态
|
|
685
|
+
*
|
|
686
|
+
* @property ACQUIRING - 应答中
|
|
687
|
+
* @property SENDING - 允许发送Content流
|
|
688
|
+
* @property IDLE - 结束分享
|
|
689
|
+
*/
|
|
690
|
+
export declare enum DualStreamState {
|
|
691
|
+
'ACQUIRING' = "ACQUIRING",
|
|
692
|
+
'SENDING' = "SENDING",
|
|
693
|
+
'IDLE' = "IDLE"
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* 信令控制Content状态消息
|
|
697
|
+
*/
|
|
698
|
+
export interface DualStreamMsg {
|
|
699
|
+
code: string;
|
|
700
|
+
mode: ContentMode;
|
|
701
|
+
state: DualStreamState;
|
|
702
|
+
type: 'DualStreamReport';
|
|
703
|
+
}
|