@xylink/xy-rtc-sdk 2.1.2-beta.7 → 3.8.0-beta.1
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 +2 -37
- package/lib/{src/action → action}/index.d.ts +237 -230
- package/lib/{src/enum → enum}/contraints.d.ts +116 -115
- package/lib/{src/enum → enum}/errorCode.d.ts +880 -880
- package/lib/{src/enum → enum}/index.d.ts +137 -133
- package/lib/{src/index.d.ts → index.d.ts} +34 -34
- package/lib/{src/main → main}/client.d.ts +878 -797
- package/lib/{src/main → main}/deviceManager.d.ts +164 -165
- package/lib/{src/main → main}/helper.d.ts +51 -51
- package/lib/{src/main → main}/iauth.d.ts +33 -33
- package/lib/{src/main → main}/layoutManager.d.ts +214 -214
- package/lib/{src/main → main}/peer.d.ts +311 -295
- package/lib/{src/main → main}/qualityManager.d.ts +39 -39
- package/lib/{src/main → main}/stream.d.ts +263 -243
- package/lib/{src/main → main}/videoManager.d.ts +65 -65
- package/lib/{src/tools → tools}/audioLevel.d.ts +23 -23
- package/lib/{src/tools → tools}/browser.d.ts +55 -55
- package/lib/{src/tools → tools}/config.d.ts +12 -12
- package/lib/{src/tools → tools}/db.d.ts +85 -84
- package/lib/tools/detect.d.ts +44 -0
- package/lib/{src/tools → tools}/emmitter.d.ts +15 -15
- package/lib/{src/tools → tools}/enum.d.ts +6 -6
- package/lib/{src/tools → tools}/httpClient.d.ts +64 -61
- package/lib/{src/tools → tools}/i18n.d.ts +8 -8
- package/lib/{src/tools → tools}/index.d.ts +8 -3
- package/lib/{src/tools → tools}/logger.d.ts +151 -151
- package/lib/{src/tools → tools}/socket.d.ts +53 -50
- package/lib/{src/tools → tools}/store.d.ts +15 -15
- package/lib/{src/tools → tools}/template.d.ts +14 -14
- package/lib/{src/tools → tools}/utils.d.ts +73 -67
- package/lib/{src/tools → tools}/verify.d.ts +7 -7
- package/lib/{src/type → type}/base.d.ts +71 -67
- package/lib/{src/type → type}/client.d.ts +1121 -1106
- package/lib/{src/type → type}/device.d.ts +77 -77
- package/lib/{src/type → type}/index.d.ts +11 -11
- package/lib/{src/type → type}/quality.d.ts +77 -77
- package/lib/{src/type → type}/stream.d.ts +426 -422
- package/lib/xyrtc.cjs.js +1 -0
- package/lib/xyrtc.umd.js +1 -0
- package/package.json +43 -54
- package/scripts/build_lib.js +16 -0
- package/scripts/utils.js +27 -0
- package/scripts/webpack.common.js +139 -0
- package/scripts/webpack.dev.js +27 -0
- package/scripts/webpack.sdk.js +68 -0
- package/tsconfig.lib.json +37 -0
- package/lib/index.es.js +0 -3
- package/lib/index.js +0 -3
- package/lib/src/tools/detect.d.ts +0 -19
|
@@ -1,295 +1,311 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* XYLink WebRTC PeerConnection Manager Lib
|
|
3
|
-
*
|
|
4
|
-
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
-
* @date 2019-10-25 18:53:01
|
|
6
|
-
*/
|
|
7
|
-
import { IInvite, IStreamObj, IStreamSender, IInternels, IPushType, ICandidate } from '../type';
|
|
8
|
-
import Client from './client';
|
|
9
|
-
import Logger from '../tools/logger';
|
|
10
|
-
import Stream from './stream';
|
|
11
|
-
/**
|
|
12
|
-
* Peer模块,用于管理 P2P 连接和内部事件
|
|
13
|
-
*
|
|
14
|
-
* @class Peer
|
|
15
|
-
*/
|
|
16
|
-
export default class Peer {
|
|
17
|
-
private connectTimmer;
|
|
18
|
-
private connectCount;
|
|
19
|
-
client: Client;
|
|
20
|
-
peerConnection: RTCPeerConnection | null;
|
|
21
|
-
logger: Logger;
|
|
22
|
-
invite: IInvite;
|
|
23
|
-
peerStatus: {
|
|
24
|
-
peerconnectionStatus: string;
|
|
25
|
-
iceConnectionState: string;
|
|
26
|
-
};
|
|
27
|
-
stream: Stream;
|
|
28
|
-
streamSenders: IStreamSender[];
|
|
29
|
-
private senderTimmer;
|
|
30
|
-
private internels;
|
|
31
|
-
private isShareContent;
|
|
32
|
-
private senderInterval;
|
|
33
|
-
private isResendContentOffer;
|
|
34
|
-
private isRestartIceConnection;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
* @param { string }
|
|
51
|
-
* @param { string }
|
|
52
|
-
* @param {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @
|
|
78
|
-
* @param
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @
|
|
86
|
-
* @param {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* @
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* @
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* @
|
|
108
|
-
* @param {
|
|
109
|
-
* @param {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* @
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
*
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
*
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
*
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* @
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* @
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* @param
|
|
200
|
-
* @param
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* @
|
|
208
|
-
* @param {
|
|
209
|
-
* @param {
|
|
210
|
-
*/
|
|
211
|
-
private
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* @
|
|
217
|
-
* @param {
|
|
218
|
-
* @param {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
* @private
|
|
226
|
-
* @param { TCustomStream | MediaStreamTrack } track Track轨道数据
|
|
227
|
-
* @param {
|
|
228
|
-
* @param {
|
|
229
|
-
*/
|
|
230
|
-
private
|
|
231
|
-
/**
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* @private
|
|
235
|
-
* @param {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* @
|
|
258
|
-
* @param {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* @
|
|
268
|
-
* @param {
|
|
269
|
-
* @param {
|
|
270
|
-
* @
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
* @
|
|
284
|
-
* @param {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
*
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* XYLink WebRTC PeerConnection Manager Lib
|
|
3
|
+
*
|
|
4
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
+
* @date 2019-10-25 18:53:01
|
|
6
|
+
*/
|
|
7
|
+
import { IInvite, IStreamObj, IStreamSender, IInternels, IPushType, ICandidate } from '../type';
|
|
8
|
+
import Client from './client';
|
|
9
|
+
import Logger from '../tools/logger';
|
|
10
|
+
import Stream from './stream';
|
|
11
|
+
/**
|
|
12
|
+
* Peer模块,用于管理 P2P 连接和内部事件
|
|
13
|
+
*
|
|
14
|
+
* @class Peer
|
|
15
|
+
*/
|
|
16
|
+
export default class Peer {
|
|
17
|
+
private connectTimmer;
|
|
18
|
+
private connectCount;
|
|
19
|
+
client: Client;
|
|
20
|
+
peerConnection: RTCPeerConnection | null;
|
|
21
|
+
logger: Logger;
|
|
22
|
+
invite: IInvite;
|
|
23
|
+
peerStatus: {
|
|
24
|
+
peerconnectionStatus: string;
|
|
25
|
+
iceConnectionState: string;
|
|
26
|
+
};
|
|
27
|
+
stream: Stream;
|
|
28
|
+
streamSenders: IStreamSender[];
|
|
29
|
+
private senderTimmer;
|
|
30
|
+
private internels;
|
|
31
|
+
private isShareContent;
|
|
32
|
+
private senderInterval;
|
|
33
|
+
private isResendContentOffer;
|
|
34
|
+
private isRestartIceConnection;
|
|
35
|
+
private isFirstConnected;
|
|
36
|
+
constructor(client: Client, stream: Stream);
|
|
37
|
+
getInternels(): IInternels;
|
|
38
|
+
/**
|
|
39
|
+
* 初始化Peer模块
|
|
40
|
+
* 1. 创建PeerConnection
|
|
41
|
+
* 2. 初始化监听事件
|
|
42
|
+
*
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
private init;
|
|
46
|
+
/**
|
|
47
|
+
* 向client发送呼叫状态
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
* @param { string } type 消息Key
|
|
51
|
+
* @param { string } code 状态码
|
|
52
|
+
* @param { string } msg 消息内容
|
|
53
|
+
* @param { any } detail 消息数据
|
|
54
|
+
*/
|
|
55
|
+
private sendEmmit;
|
|
56
|
+
/**
|
|
57
|
+
* 停止呼叫状态检查timmer
|
|
58
|
+
*
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
private stopConnectTimmer;
|
|
62
|
+
/**
|
|
63
|
+
* 监听peer连接状态,Timeout:40s
|
|
64
|
+
*
|
|
65
|
+
* @private
|
|
66
|
+
*/
|
|
67
|
+
private initTimmer;
|
|
68
|
+
/**
|
|
69
|
+
* ice协商回调事件
|
|
70
|
+
*
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
private onHandleNegotiationNeeded;
|
|
74
|
+
/**
|
|
75
|
+
* 创建offer,并针对stream设置初始带宽
|
|
76
|
+
*
|
|
77
|
+
* @private
|
|
78
|
+
* @param { RTCOfferOptions } options createOffer options
|
|
79
|
+
* @param isSetBandwidth 是否设置初始带宽,180:100,360: 500, 720: 1000
|
|
80
|
+
*/
|
|
81
|
+
private createBaseOfferConnection;
|
|
82
|
+
/**
|
|
83
|
+
* 通过client模块统一发送socket消息
|
|
84
|
+
*
|
|
85
|
+
* @public
|
|
86
|
+
* @param { string } type 消息key
|
|
87
|
+
* @param { any } data 消息内容
|
|
88
|
+
*/
|
|
89
|
+
sendSocketMessage(type: string, data: any): void;
|
|
90
|
+
/**
|
|
91
|
+
* 处理candidate消息
|
|
92
|
+
*
|
|
93
|
+
* @public
|
|
94
|
+
* @param { ICandidate } body candidate消息内容
|
|
95
|
+
*/
|
|
96
|
+
handleCandidate(body: ICandidate): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* 响应offer
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
* @param { RTCSessionDescriptionInit } answer answerSDP内容,设置到peerconnection上
|
|
102
|
+
*/
|
|
103
|
+
handleAnswer(answer: RTCSessionDescriptionInit): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* 对Track轨道进行动态带宽调整
|
|
106
|
+
*
|
|
107
|
+
* @public
|
|
108
|
+
* @param { string } trackId Track轨道id
|
|
109
|
+
* @param { number } bandwidth 需要限定的带宽值
|
|
110
|
+
* @param { boolean } isIncreaseBase 带宽是否需要✖️系数1000
|
|
111
|
+
*/
|
|
112
|
+
setBandWidth(trackId: string, bandwidth: number | undefined, isIncreaseBase: boolean | undefined, stream: MediaStream | null): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* View the cb of ice connection status change
|
|
115
|
+
* Maybe status:'new', 'checking', 'connected', 'completed', 'failed', 'disconnected', 'closed'
|
|
116
|
+
*
|
|
117
|
+
* @private
|
|
118
|
+
* @param { Event } e ice连接回调状态事件
|
|
119
|
+
*/
|
|
120
|
+
private onHandleIceConnectionStateChange;
|
|
121
|
+
/**
|
|
122
|
+
* peerconnection connect status change cb, only supports Chrome 72 or higher
|
|
123
|
+
* pc.connectionState: connected,disconnected,failed,closed,connecting,new
|
|
124
|
+
*
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
private onHandleConnectionStateChange;
|
|
128
|
+
onHandleIcecandidateerror(e: Event): void;
|
|
129
|
+
/**
|
|
130
|
+
* 重连PeerConnection
|
|
131
|
+
*
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
restartIceConnection(isRestartIceConnection?: boolean): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* 关闭PeerConnection连接、销毁状态
|
|
137
|
+
*/
|
|
138
|
+
close(): void;
|
|
139
|
+
setRestartIceConnection(isRestartIceConnection?: boolean): void;
|
|
140
|
+
/**
|
|
141
|
+
* add Track for stream, default push all
|
|
142
|
+
*
|
|
143
|
+
* @public
|
|
144
|
+
* @param { Stream } stream Local stream
|
|
145
|
+
* @param { IPushType } pushType 推送类型,all全推送,video只推送video,audio只推送audio, content只推送content video流
|
|
146
|
+
*/
|
|
147
|
+
publish(stream: Stream, pushType?: IPushType): void;
|
|
148
|
+
reSendContentOffer(): void;
|
|
149
|
+
resetContentStream(contentStreams: IStreamObj[]): void;
|
|
150
|
+
/**
|
|
151
|
+
* 替换People Video Track轨道
|
|
152
|
+
*
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
replacePeopleVideoTrack(stream: Stream, kind?: string): void;
|
|
156
|
+
/**
|
|
157
|
+
* people and content sender status
|
|
158
|
+
*
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
initSenderStatus(): void;
|
|
162
|
+
/**
|
|
163
|
+
* Reset content sender track
|
|
164
|
+
*
|
|
165
|
+
* @public
|
|
166
|
+
*/
|
|
167
|
+
closeContentStream(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Get peerconnection status
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
getPeerStatus(): boolean;
|
|
174
|
+
/**
|
|
175
|
+
* 无流切换至有流,需向transceiver重新setStream/replaceTrack
|
|
176
|
+
*
|
|
177
|
+
* @public
|
|
178
|
+
* @param { IStreamObj[] } streamList 流数据
|
|
179
|
+
* @param { 'video' | 'audio' } kind 流类型
|
|
180
|
+
*/
|
|
181
|
+
setStream(streamList: IStreamObj[], kind: 'video' | 'audio'): void;
|
|
182
|
+
/**
|
|
183
|
+
* 计算发送/接收端internels统计数据,更新存储到到Layout结果数据中
|
|
184
|
+
* 自动每隔6s记录一次内容统计数据到数据库中
|
|
185
|
+
*
|
|
186
|
+
* @private
|
|
187
|
+
*/
|
|
188
|
+
private calcMeetingStats;
|
|
189
|
+
/**
|
|
190
|
+
* 过滤远端音频中没有带宽或者没有音量的数据
|
|
191
|
+
*
|
|
192
|
+
* @param { IInternels } internels
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
private filterInternels;
|
|
196
|
+
/**
|
|
197
|
+
* 计算丢包率
|
|
198
|
+
*
|
|
199
|
+
* @param sum 包的总数
|
|
200
|
+
* @param lost 丢失包的数量
|
|
201
|
+
* @returns 丢包率
|
|
202
|
+
*/
|
|
203
|
+
private getLost;
|
|
204
|
+
/**
|
|
205
|
+
* 批量向peer通道添加Track轨道数据
|
|
206
|
+
*
|
|
207
|
+
* @private
|
|
208
|
+
* @param { IStreamObj[] } streamList 媒体流/协商流列表
|
|
209
|
+
* @param { RTCRtpTransceiverDirection } direction 指定添加到peer上的方向
|
|
210
|
+
*/
|
|
211
|
+
private addTransceiver;
|
|
212
|
+
/**
|
|
213
|
+
* 向peer添加Track轨道数据
|
|
214
|
+
*
|
|
215
|
+
* @private
|
|
216
|
+
* @param { TCustomStream | MediaStreamTrack } track Track轨道数据
|
|
217
|
+
* @param { RTCRtpTransceiverDirection } direction 指定添加到peer上的方向
|
|
218
|
+
* @param { IStreamObj } item 自定义Stream流对象
|
|
219
|
+
*/
|
|
220
|
+
private addStreamRenders;
|
|
221
|
+
preferCodec(codecs: RTCRtpCodecCapability[], mimeType: string): RTCRtpCodecCapability[];
|
|
222
|
+
/**
|
|
223
|
+
* 向peer添加Track轨道数据
|
|
224
|
+
*
|
|
225
|
+
* @private
|
|
226
|
+
* @param { TCustomStream | MediaStreamTrack } track Track轨道数据
|
|
227
|
+
* @param { RTCRtpTransceiverDirection } direction 指定添加到peer上的方向
|
|
228
|
+
* @param { IStreamObj } item 自定义Stream流对象
|
|
229
|
+
*/
|
|
230
|
+
private addTransceiverByPeer;
|
|
231
|
+
/**
|
|
232
|
+
* 关联自定义stream对象和Sender发送器数据
|
|
233
|
+
*
|
|
234
|
+
* @private
|
|
235
|
+
* @param { TCustomStream | MediaStreamTrack } track Track轨道数据
|
|
236
|
+
* @param { IStreamObj } item 自定义Stream流对象
|
|
237
|
+
* @param { RTCRtpTransceiver } rtcRtpTransceiver 流的发送器,由向peer添加track生成
|
|
238
|
+
*/
|
|
239
|
+
private setStreamSenders;
|
|
240
|
+
/**
|
|
241
|
+
* 替换音频Track轨道
|
|
242
|
+
*
|
|
243
|
+
* @private
|
|
244
|
+
* @param { IStreamObj[] } streamList 自定义媒体流对象列表数据
|
|
245
|
+
*/
|
|
246
|
+
private replaceAudioTrack;
|
|
247
|
+
/**
|
|
248
|
+
* 替换视频Track轨道
|
|
249
|
+
*
|
|
250
|
+
* @private
|
|
251
|
+
* @param { IStreamObj[] } streamList 自定义媒体流对象列表数据
|
|
252
|
+
*/
|
|
253
|
+
private replaceVideoTrack;
|
|
254
|
+
/**
|
|
255
|
+
* Replace all Track
|
|
256
|
+
*
|
|
257
|
+
* @private
|
|
258
|
+
* @param { IStreamObj[] } streamList 自定义媒体流对象列表数据
|
|
259
|
+
*/
|
|
260
|
+
private replaceTrack;
|
|
261
|
+
/**
|
|
262
|
+
* 获取sender的发送数据
|
|
263
|
+
*
|
|
264
|
+
* @private
|
|
265
|
+
* @param { 'sender' | 'audioSender' } key
|
|
266
|
+
* @param { RTCStatsReport } stats sender发送器的统计数据
|
|
267
|
+
* @param { IInternels } internels 自定义internels统计数据
|
|
268
|
+
* @param { IStreamSender } senderItem sender发送器对象
|
|
269
|
+
* @param { boolean } firstMatch match第一次数据,记录一些通用数据
|
|
270
|
+
* @returns { ISender } 自定义统计数据内容
|
|
271
|
+
*/
|
|
272
|
+
private getSenderStatus;
|
|
273
|
+
/**
|
|
274
|
+
* 计算音量值, 显示0-100
|
|
275
|
+
*
|
|
276
|
+
* @param { number } audioLevel
|
|
277
|
+
* @returns
|
|
278
|
+
*/
|
|
279
|
+
private calcAudioLevel;
|
|
280
|
+
/**
|
|
281
|
+
* 获取receiver的数据
|
|
282
|
+
*
|
|
283
|
+
* @private
|
|
284
|
+
* @param { RTCStatsReport } stats sender发送器的统计数据
|
|
285
|
+
* @param { ILayout } layoutItem layout布局数据
|
|
286
|
+
* @param { IInternels } internels 自定义internels统计数据
|
|
287
|
+
* @returns { IReceiver } 接收端的统计数据
|
|
288
|
+
*/
|
|
289
|
+
private getReceiverStatus;
|
|
290
|
+
private getReceiverAudioTrackStatus;
|
|
291
|
+
/**
|
|
292
|
+
* 计算速率
|
|
293
|
+
*
|
|
294
|
+
* @private
|
|
295
|
+
* @param { any } report 上一次report总值
|
|
296
|
+
* @param { string } accumulativeMetric key
|
|
297
|
+
* @param { string } samplesMetric timeLong
|
|
298
|
+
* @param { number } bitsRate bite转换值
|
|
299
|
+
* @param { number } timeRatio 事件单位
|
|
300
|
+
* @param { any } dataOrigin 上一次的数据
|
|
301
|
+
*/
|
|
302
|
+
private rateBytesCalculator;
|
|
303
|
+
/**
|
|
304
|
+
* 监听远端更新Track事件
|
|
305
|
+
*
|
|
306
|
+
* @private
|
|
307
|
+
* @event
|
|
308
|
+
* @param { RTCTrackEvent } e peer回调track数据
|
|
309
|
+
*/
|
|
310
|
+
private onTrack;
|
|
311
|
+
}
|