@xylink/xy-rtc-sdk 3.9.9 → 3.9.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.
@@ -5,7 +5,6 @@
5
5
  * @date 2019-10-30 14:12:52
6
6
  */
7
7
  import { IDefault, IOPERATE_MAP, IRoster, IFeatureConfig, StreamStatus, StreamType, ILoggerConfig, FacingMode, TemplateMode, ContentTemplateMode, LayoutConfig } from '../type';
8
- export * from './contraints';
9
8
  export declare const LOG_CACHE_COUNT = 10;
10
9
  export declare const DB_TABLE_COUNT = 10;
11
10
  export declare const DETECT_LOCATOR_SERVER_NAME = "WebrtcSigGW";
@@ -208,3 +207,4 @@ export declare const DEFAULT_LAYOUT_CONFIG: LayoutConfig;
208
207
  * Web支持的轮询画面
209
208
  */
210
209
  export declare const MULTI_IMAGE: string[];
210
+ export * from './contraints';
@@ -5,7 +5,7 @@
5
5
  * @author JingHui Luo <luojinghui424@gmail.com>
6
6
  *
7
7
  * Created at : 2024-02-28 18:30:52
8
- * Last modified : 2024-03-08 19:05:02
8
+ * Last modified : 2024-04-16 11:40:05
9
9
  */
10
10
  import { PollingLayout } from '../type/polling';
11
11
  export declare const DEFAULT_POLLING_LAYOUT: PollingLayout;
package/lib/index.d.ts CHANGED
@@ -27,7 +27,6 @@ interface XYLinkRTC {
27
27
  createClient: (config: IClientConfig, logger?: Logger) => Client;
28
28
  createStream: (config?: ISteamConfig, logger?: Logger) => Stream;
29
29
  checkSupportWebRTC: () => Promise<ICheckSystemRequirements>;
30
- checkSupportMobileWebRTC: () => Promise<ICheckSystemRequirements>;
31
30
  checkSupportShareContent: () => boolean;
32
31
  setLocale: (language: TLocale) => void;
33
32
  closePreviewStream: (stream: MediaStream) => void;
@@ -129,7 +129,7 @@ export default class Client extends Emitter {
129
129
  * @param { Stream } stream - Stream实例模块
130
130
  */
131
131
  bindStreamInstance(stream: Stream): void;
132
- getLayoutMap(): Map<any, any>;
132
+ getLayoutMap(): import("../type").TLayoutMap | undefined;
133
133
  getLayoutManger(): LayoutManager | null;
134
134
  /**
135
135
  * 获取Local roster信息
@@ -234,7 +234,6 @@ export default class Client extends Emitter {
234
234
  loginWithAuthCode(params: ILoginWidthAuthCode): Promise<IReturnResult>;
235
235
  /**
236
236
  * 退会时 重置初始化参数
237
- *
238
237
  */
239
238
  resetInitParameter(): void;
240
239
  setContentMode(mode: ContentMode): void;
@@ -279,27 +278,25 @@ export default class Client extends Emitter {
279
278
  */
280
279
  toggleHideId(): Promise<boolean>;
281
280
  /**
282
- * 绑定streamId和video ele元素,内部维护状态
281
+ * 设置画面渲染元素并播放Video画面
283
282
  *
284
283
  * @public
285
- * @param { string } key endpointId + mediagroupId 唯一的用户id值
286
- * @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
284
+ * @param { string } id - 参会者Layout Id
285
+ * @param { string } wrapEle - 包裹video组件的容器ID字段,此元素必须提供宽高信息,内部会基于此宽高信息计算video的旋转信息
287
286
  */
288
- setVideoRenderer(key: string, wrapEleId: string): void;
287
+ setVideoRenderer(id: string, wrapEleId: string): void;
289
288
  /**
290
- * 移除绑定的streamId
289
+ * 移除指定Video容器
291
290
  *
292
- * @param { string } key endpointId + mediagroupId 唯一的用户id值
293
- * @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
291
+ * @param { string } id - 参会者Layout Id
294
292
  */
295
- removeVideoRender(key: string, wrapEleId: string): void;
293
+ removeVideoRender(id: string): void;
296
294
  /**
297
- * 重新播放视频
295
+ * 重新播放Video画面组件
298
296
  *
299
- * @public
300
- * @param { string[] ? } keys 指定重新播放的video
297
+ * @param { string[]? } idList - Layout Id 列表
301
298
  */
302
- playVideo(keys?: string[]): Promise<boolean>;
299
+ playVideo(idList?: string[]): Promise<boolean>;
303
300
  /**
304
301
  * 重新播放音频
305
302
  */
@@ -312,13 +309,19 @@ export default class Client extends Emitter {
312
309
  */
313
310
  switchCamera(facingMode?: IFacingMode): Promise<IFacingMode>;
314
311
  /**
315
- * 绑定streamId和audio ele元素,内部维护状态
312
+ * 设置音频播放容器并播放远端参会者声音
316
313
  *
317
314
  * @public
318
- * @param { string } key streamId流id
319
- * @param { HTMLAudioElement } ele audio元素
315
+ * @param { string } id - MediaStream的Id字段
316
+ * @param { HTMLAudioElement } ele - audio元素
320
317
  */
321
- setAudioRenderer(key: string, ele: HTMLAudioElement): Promise<void>;
318
+ setAudioRenderer(id: string, ele: HTMLAudioElement): Promise<void>;
319
+ /**
320
+ * 移除对应的AudioRender
321
+ *
322
+ * @param { string } id - MediaStream的Id字段
323
+ */
324
+ removeAudioRender(key: string): void;
322
325
  /**
323
326
  * 是否执行自动切换设备操作
324
327
  *
@@ -362,24 +365,24 @@ export default class Client extends Emitter {
362
365
  /**
363
366
  * 设置焦点画面
364
367
  *
365
- * @param { string } rosterId - 指定切换到焦点画面的rosterId
368
+ * @param { string } id - 指定切换到焦点画面的Layout Id
366
369
  * @returns { Promise<IReturnResult> } - 结果
367
370
  */
368
- startMeetingFocusView(rosterId: string): Promise<IReturnResult>;
371
+ startMeetingFocusView(id: string): Promise<IReturnResult>;
369
372
  /**
370
373
  * 取消焦点画面
371
374
  *
372
- * @param { string } rosterId - 取消指定终端为焦点画面
375
+ * @param { string } id - 取消指定终端为焦点画面的Layout Id
373
376
  * @returns { Promise<IReturnResult> } - 结果
374
377
  */
375
- stopMeetingFocusView(rosterId: string): Promise<IReturnResult>;
378
+ stopMeetingFocusView(id: string): Promise<IReturnResult>;
376
379
  /**
377
380
  * 本地切换主画面
378
381
  *
379
- * @param { string } rosterId - 指定切换到主画面的rosterId
380
- * @returns { Promise<string> } rosterId
382
+ * @param { string } id - 主画面的Layout Id
383
+ * @returns { Promise<string> } - Roster Id
381
384
  */
382
- setFocusView(rosterId: string): Promise<string>;
385
+ setFocusView(id: string): Promise<string>;
383
386
  /**
384
387
  * AUTO布局 分页
385
388
  *
@@ -825,20 +828,6 @@ export default class Client extends Emitter {
825
828
  * @returns { Promise<boolean> } 是否开启了debug模式
826
829
  */
827
830
  switchDebug(status: boolean): Promise<boolean>;
828
- /**
829
- * 请求自定义参会者成员的分辨率、质量视频数据 (2.0.2以前的版本方法)
830
- * 视频质量级别
831
- * people 720p 时:Low 表示15 fps,Normal和High 表示 30 fps
832
- * people 1080p时:Low 表示15 fps,Normal和High 表示 60 fps,(如果解码能力不够60,会被压低为30的)
833
- *
834
- * content 720p 时:Low 表示5 fps, Normal和High 表示 30 fps
835
- * content 1080p时:Low 表示15 fps,Normal和High 表示 30 fps
836
- *
837
- * @public
838
- * @param { IReqInfo[] } reqList 需要请求的参会者的信息
839
- * @returns { string } 是否成功
840
- */
841
- requestLayout(reqList: IReqInfo[]): Promise<string>;
842
831
  /**
843
832
  * 【newLayout】请求参会者成员的信息、视频数据等
844
833
  *
@@ -981,8 +970,8 @@ export default class Client extends Emitter {
981
970
  /**
982
971
  * 全屏请流
983
972
  *
984
- * @param { string } id rosterId
985
- * @returns Promise<string> rosterId
973
+ * @param { string } id - 需要强制全屏的Layout Id
974
+ * @returns { Promise<string> } - Roster Id
986
975
  */
987
976
  forceFullScreen(id?: string): Promise<string>;
988
977
  /**
@@ -1020,12 +1009,6 @@ export default class Client extends Emitter {
1020
1009
  * @param { string } deviceId 设备ID
1021
1010
  */
1022
1011
  setAudioOutputDevice(deviceId: string): void;
1023
- /**
1024
- * 移除对应的AudioRender
1025
- *
1026
- * @param { string } key endpointId + mediagroupId 唯一的用户id值
1027
- */
1028
- removeAudioRender(key: string): void;
1029
1012
  /**
1030
1013
  * 开始巡课
1031
1014
  *
@@ -1124,9 +1107,8 @@ export default class Client extends Emitter {
1124
1107
  * 修改参会者名称,暂只支持修改Local名称
1125
1108
  *
1126
1109
  * @param { string } newName - 新名称
1127
- * @param { string } rosterId - 需要修改的终端的rosterId, 无值则默认修改Local
1128
1110
  */
1129
- rename(newName: string, rosterId?: string): Promise<IReturnResult | undefined>;
1111
+ rename(newName: string): Promise<IReturnResult | undefined>;
1130
1112
  /**
1131
1113
  * 设置多分组通道,通用方法
1132
1114
  *
@@ -5,7 +5,7 @@
5
5
  * @email luojinghui424@gmail.com
6
6
  *
7
7
  * Created at : 2021-01-09 14:45:46
8
- * Last modified : 2024-02-29 15:03:32
8
+ * Last modified : 2024-04-19 14:13:30
9
9
  */
10
10
  import { ILayout, IVideoManagerState, IRotationInfoTotalItem } from '../type';
11
11
  export declare const getLayoutItemState: (item: ILayout | ILayout, stream: MediaStream | null, vmState: IVideoManagerState) => "REQUEST" | "NORMAL" | "MUTE" | "AUDIO_TEL" | "AUDIO_ONLY" | "AUDIO_CONTENT";
@@ -50,19 +50,30 @@ export declare const detectLocator: ({ extId, clientId, clientSecret, httpServer
50
50
  httpServer?: string | undefined;
51
51
  }) => Promise<string>;
52
52
  /**
53
- * 生成用户唯一ID值
53
+ * 生成用户唯一Layout ID值
54
54
  *
55
55
  * @param { string } callUri - callUri或者endpointId值
56
- * @param { number | string } mediagroupid - mid,多分组通道,常见:0代表people,1代表content,会控喊话有>10值
56
+ * @param { number | string } mediagroupid - 多分组通道ID,常见:0代表people,1代表content,会控喊话有>10值
57
+ * @param { string } customId - 自定义ID,默认是""
57
58
  * @return { string } 唯一ID
58
59
  */
60
+ export declare const getLayoutId: (callUri?: string, mediagroupid?: number | string, customId?: string) => string;
61
+ /**
62
+ * 生成用户Roster ID值
63
+ *
64
+ * @param { string } callUri - callUri或者endpointId值
65
+ * @param { number | string } mediagroupid - 多分组通道ID,常见:0代表people,1代表content,会控喊话有>10值
66
+ * @return { string } Roster ID
67
+ */
59
68
  export declare const getRosterId: (callUri?: string, mediagroupid?: number | string) => string;
60
69
  /**
61
- * 切割RosterId,获取endpointId和mediagroupId信息
70
+ * 获取Layout ID或Roster Id组合信息,依次是:endpointId、mediagroupId、customId、roster key信息
62
71
  *
63
- * @param { string } rosterId - 唯一ID
72
+ * @param { string } id - Layout ID/Roster ID
64
73
  */
65
- export declare const getRosterIdInfo: (rosterId: string) => {
74
+ export declare const getLayoutIdInfo: (id: string) => {
66
75
  endpointId: string;
67
- mediagroupId: string;
76
+ mediagroupId: string | number;
77
+ customId: string;
78
+ rosterId: string;
68
79
  };
@@ -6,10 +6,10 @@
6
6
  * @email luojinghui424@gmail.com
7
7
  *
8
8
  * Created at : 2021-01-05 17:24:07
9
- * Last modified : 2024-03-12 16:43:11
9
+ * Last modified : 2024-04-19 15:14:09
10
10
  */
11
11
  import Logger from '../../tools/logger';
12
- import { ILayout, IVideoRenders, IRoster, IScreenInfo, IOutputCustomLayout, ILayoutRoster, IConfInfo, IPageInfo, IReqInfo, VideoQuality, StreamResolutionLevel, TLayoutMap, TemplateMode, ContentTemplateMode, IMode, LayoutOrientationType, LayoutConfig, PollingState } from '../../type/index';
12
+ import { ILayout, IVideoRenders, IRoster, IScreenInfo, IOutputCustomLayout, ILayoutRoster, IConfInfo, IPageInfo, VideoQuality, StreamResolutionLevel, TLayoutMap, TemplateMode, ContentTemplateMode, IMode, LayoutOrientationType, LayoutConfig, PollingState } from '../../type/index';
13
13
  import Client from '../client';
14
14
  import Polling from './polling';
15
15
  export default class LayoutManager {
@@ -97,16 +97,18 @@ export default class LayoutManager {
97
97
  getPollingState(): PollingState | undefined;
98
98
  setOrderRosterList(orderRosterList: IRoster[]): void;
99
99
  setOriginOrderRosters(originOrderRosters: IRoster[]): void;
100
+ getUsedLayoutMap(): TLayoutMap;
100
101
  /**
101
- * 维护 Local roster 状态
102
+ * 更新本地Roster数据
102
103
  *
103
104
  * @param { Partial<IRoster> } data - 需要更新的roster数据
104
105
  */
105
106
  setLocalStatus(data: Partial<IRoster>): void;
106
107
  /**
107
- * 设置发布全屏layout id
108
+ * 设置强制全屏的参会者Roster Id
109
+ * 经过Client模块Layout Id转换为Roster Id
108
110
  *
109
- * @param { string } id - forceLayout roster id
111
+ * @param { string } id - Roster Id
110
112
  */
111
113
  setForceFullScreenId(id?: string): void;
112
114
  /**
@@ -134,37 +136,37 @@ export default class LayoutManager {
134
136
  */
135
137
  setLocalShareContent(is: boolean): void;
136
138
  /**
137
- * 回调 video 状态
139
+ * Video组件状态变更回调事件
140
+ *
138
141
  * state === (roster当前状态 + 上一次的status)
139
142
  *
140
- * @param { string } key - endpointId + mediagroupId 组成的id
143
+ * @param { string } id - 参会者Layout Id
141
144
  * @param { status: string; error?: any } data - 最新的会议状态 status === video track / video标签 监听到的状态
142
145
  */
143
146
  private onVideoStatusChange;
144
147
  /**
145
- * 使用wrap element元素更新 videoManagers 数据,并绑定视频流信息
148
+ * 设置画面渲染元素并播放Video画面
146
149
  *
147
- * @param { string } key - endpointId + mediagroupId 组成的id
148
- * @param { string } wrapEleId - wrap video element id
150
+ * @param { string } id - 参会者Layout Id
151
+ * @param { string } wrapEleId - 包裹video组件的容器ID字段
149
152
  */
150
- setVideoRenderer(key: string, wrapEleId: string): void;
153
+ setVideoRenderer(id: string, wrapEleId: string): void;
151
154
  /**
152
155
  * videoManagers 移除key对应的元素
153
156
  *
154
- * @param { string } key - endpointId + mediagroupId 组成的id
155
- * @param { string } wrapEleId - wrap video element id
157
+ * @param { string } id - 参会者Layout Id
156
158
  */
157
- removeVideoRenderer(key: string, wrapEleId: string): void;
159
+ removeVideoRenderer(id: string): void;
158
160
  /**
159
161
  * 播放本地画面
160
162
  */
161
163
  playLocalVideo(): Promise<void>;
162
164
  /**
163
- * 播放对应画面
165
+ * 重新播放Video画面组件
164
166
  *
165
- * @param { string[] } keys - videoID list
167
+ * @param { string[]? } idList - Layout Id 列表
166
168
  */
167
- playVideo(keys?: string[]): Promise<void>;
169
+ playVideo(idList?: string[]): Promise<void>;
168
170
  /**
169
171
  * 切换布局方向
170
172
  *
@@ -181,12 +183,12 @@ export default class LayoutManager {
181
183
  /**
182
184
  * 本地切换主画面, GALLERY布局/会控设置焦点画面 不支持
183
185
  *
184
- * @param { string } id - 指定切换到主画面的rosterId
186
+ * @param { string } id - 指定切换到主画面的参会者Layout Id
185
187
  * @returns { string } rosterId
186
188
  */
187
189
  setFocusView(id: string): string;
188
190
  /**
189
- * 更新Local video track
191
+ * 更新本地Video Track
190
192
  */
191
193
  updateLocalTrack(): void;
192
194
  /**
@@ -265,7 +267,7 @@ export default class LayoutManager {
265
267
  /**
266
268
  * 缓存主画面信息, 并请流
267
269
  *
268
- * @param { string } id - 指定切换到主画面的RosterId
270
+ * @param { string } rosterId - 指定切换到主画面的RosterId
269
271
  * @param { FocusViewKind } kind - 来源
270
272
  * @param { IRoster | null } roster - 焦点画面roster
271
273
  */
@@ -276,10 +278,6 @@ export default class LayoutManager {
276
278
  * @param { FocusViewConfig } config - 焦点画面参数
277
279
  */
278
280
  private updateFocusViewConfig;
279
- /**
280
- * 计算 custom layout 数据
281
- */
282
- private customLayoutCalculator;
283
281
  /**
284
282
  * 更新Template Rate模版容器比例配置
285
283
  *
@@ -316,7 +314,10 @@ export default class LayoutManager {
316
314
  */
317
315
  private getTemplateScreenInfo;
318
316
  /**
319
- * [AUTO] 2.创建LayoutMap, 移除无效Layout
317
+ * 2.创建LayoutMap, 移除无效Layout
318
+ *
319
+ * 普通模式下:list id类似roster id字段
320
+ * 轮询模式下:存在画面重复渲染、无符合条件终端(roster为空)等设备,需要合并数据
320
321
  */
321
322
  private createBaseLayout;
322
323
  /**
@@ -324,7 +325,7 @@ export default class LayoutManager {
324
325
  */
325
326
  private clearInvalidLayout;
326
327
  /**
327
- * [AUTO | CUSTOM] 使用最新的 videoTrackList 和 layoutResults 数据更新 layout 内容
328
+ * 基于最新的 videoTrackList 和 layoutResults 数据更新MediaStream内容
328
329
  *
329
330
  * @param { boolean } isAutoSendLayout - 是否上报Layout信息
330
331
  */
@@ -333,6 +334,12 @@ export default class LayoutManager {
333
334
  * 清理失效的 video manager 数据
334
335
  */
335
336
  clearInvalidVideoManagers(): void;
337
+ /**
338
+ * 通过TrackId找到VideoStream和AudioStream
339
+ *
340
+ * @param { string } videoTrackId - VideoTrackId
341
+ * @return { ResultVideoStream } 返回查找到的VideoStream数据
342
+ */
336
343
  private getVideoStreamByTrackId;
337
344
  /**
338
345
  * [AUTO] 计算位置信息
@@ -363,8 +370,9 @@ export default class LayoutManager {
363
370
  /**
364
371
  * 通过旋转信息获取在layout中的位置
365
372
  *
366
- * @param pid peopleId
367
- * @param mediagroupid type
373
+ * @param { number } pid - 参会者Pid
374
+ * @param { number } mid - 参会者当前通道类型,0/1等
375
+ * @return { string } LayoutId或者RosterId
368
376
  */
369
377
  private getLayoutKeyByRotateInfo;
370
378
  /**
@@ -404,17 +412,11 @@ export default class LayoutManager {
404
412
  /**
405
413
  * 查找对应的roster
406
414
  *
407
- * @param { string } id - LayoutId
415
+ * @param { string } id - Roster Id
408
416
  * @param { ILayoutRoster[]} list - layout list
409
417
  * @returns
410
418
  */
411
419
  private findRosterById;
412
- /**
413
- * 根据 reqList 计算最新的 layout 数据(2.0.2以前的版本方法)
414
- *
415
- * @param { IReqInfo[] } reqList - 请流数据
416
- */
417
- requestLayout(reqList: IReqInfo[]): void;
418
420
  /**
419
421
  * 销毁资源
420
422
  */
@@ -5,7 +5,7 @@
5
5
  * @author JingHui Luo <luojinghui424@gmail.com>
6
6
  *
7
7
  * Created at : 2024-02-26 14:47:53
8
- * Last modified : 2024-03-12 16:43:02
8
+ * Last modified : 2024-04-19 14:11:30
9
9
  */
10
10
  import LayoutManager from './index';
11
11
  import { IBulkRoster, ICustomizedLayout, IRoster, PollingLayout, PollingState } from '../../type';
@@ -95,7 +95,7 @@ export default class Polling {
95
95
  *
96
96
  * @param { BasePollingItem | null } item - 基础数据
97
97
  * @param { PollingLayout } layout - LayoutMap数据结构
98
- * @param { string } id - RosterId/LayoutId数据
98
+ * @param { string } customId - 自定义Id
99
99
  */
100
100
  private setPollingLayoutItem;
101
101
  /**
@@ -141,14 +141,6 @@ export default class Polling {
141
141
  * 创建Active Speaker数据
142
142
  */
143
143
  private calculateSpeaker;
144
- /**
145
- * 计算指定的DI是否包含在自动循环列表中
146
- *
147
- * @param { string } di - 需要查询的DI数据
148
- * @param { boolean } current - 是否指定当前页查询
149
- * @returns { boolean } - 返回是否包含
150
- */
151
- private isIncludeSpecifiedAutoList;
152
144
  /**
153
145
  * 计算指定的DI是否包含在指定循环列表中
154
146
  *
@@ -2,7 +2,7 @@
2
2
  * Meeting Info Control
3
3
  *
4
4
  * Created at : 2022-10-27 13:58:22
5
- * Last modified : 2024-03-06 18:52:25
5
+ * Last modified : 2024-04-18 16:37:07
6
6
  */
7
7
  import { IRecordPermission, IConfMgmtUrl, ILayout, IMediaConfig, IReqInfo, LayoutAvatarType, TLayoutMap, InviteInfo, IMeetingControl, FocusViewAction } from '../type';
8
8
  import Client from './client';
@@ -17,7 +17,6 @@ declare class Meeting {
17
17
  private confMgmtUrl;
18
18
  private layoutImageAvatarMap;
19
19
  private mediaConfig;
20
- private rxBandwidth;
21
20
  private enterpriseConfig;
22
21
  private meetingControlInfo;
23
22
  constructor(client: Client, logger: Logger);
@@ -27,7 +26,6 @@ declare class Meeting {
27
26
  isCustom: boolean;
28
27
  }>;
29
28
  getEnterpriseMediaConfig(): IMediaConfig;
30
- getRxBandwidth(): number;
31
29
  getLayoutAvatarType(): LayoutAvatarType;
32
30
  getMeetingControlInfo(): IMeetingControl | null;
33
31
  /**
@@ -78,11 +76,11 @@ declare class Meeting {
78
76
  *
79
77
  * 硬终端设备,无论oms配置什么,都使用对应的人物图标
80
78
  *
81
- * @param { ILayout } layout 参会者Layout
82
- * @param {string} key 参会者id
79
+ * @param { ILayout } layout - 参会者Layout
80
+ * @param {string} rosterId - 参会者Roster Id
83
81
  * @returns
84
82
  */
85
- setLayoutAvatar(layout: ILayout, key: string): void;
83
+ setLayoutAvatar(layout: ILayout, rosterId: string): void;
86
84
  /**
87
85
  * 处理layout图像
88
86
  *
@@ -142,9 +140,8 @@ declare class Meeting {
142
140
  * 修改参会者名称,目前仅支持修改Local
143
141
  *
144
142
  * @param { string } newName - 新名称
145
- * @param { string } rosterId - 需要修改的终端的rosterId, 无值则默认修改Local
146
143
  */
147
- rename(newName: string, rosterId?: string, callback?: () => void): Promise<import("../type").IReturnResult | undefined>;
144
+ rename(newName: string, callback?: () => void): Promise<import("../type").IReturnResult | undefined>;
148
145
  /**
149
146
  * 企业配置信息
150
147
  *
@@ -4,7 +4,7 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-25 18:53:01
6
6
  */
7
- import { IInvite, IStreamSender, ICandidate, PushType, ISenderMap } from '../type';
7
+ import { IInvite, IStreamSender, ICandidate, PushType, ISenderMap, PeerState, ICEState } from '../type';
8
8
  import Client from './client';
9
9
  import Logger from '../tools/logger';
10
10
  import Stream from './stream';
@@ -20,23 +20,28 @@ export default class Peer {
20
20
  peerConnection: RTCPeerConnection | null;
21
21
  logger: Logger;
22
22
  invite: IInvite;
23
- peerStatus: {
24
- peerConnectionStatus: string;
25
- iceConnectionState: string;
23
+ connectState: {
24
+ peer: PeerState;
25
+ ice: ICEState;
26
26
  };
27
27
  stream: Stream;
28
28
  streamSenders: IStreamSender[];
29
29
  senderMap: ISenderMap;
30
30
  private senderTimer;
31
- private isRestartIceConnection;
32
- private isFirstConnected;
33
31
  private videoCodecs;
34
32
  private audioCodecs;
35
33
  private qualityWorker;
36
34
  private localIPAddress;
37
- constructor(client: Client, stream: Stream);
35
+ private peerLibStatus;
36
+ private firstCallState;
37
+ private peerCallState;
38
+ private isReceivedTrackMsg;
39
+ private detectTrackMsgTimer;
40
+ constructor(client: Client, stream: Stream, isRenew?: boolean);
41
+ /**
42
+ * 初始化质量统计WebWorker模块
43
+ */
38
44
  private initQualityWorker;
39
- restart(): void;
40
45
  /**
41
46
  * 初始化Peer模块
42
47
  * 1. 创建PeerConnection
@@ -46,7 +51,7 @@ export default class Peer {
46
51
  */
47
52
  private init;
48
53
  /**
49
- * 向client发送呼叫状态
54
+ * 向Client发送消息
50
55
  *
51
56
  * @private
52
57
  * @param { string } type 消息Key
@@ -56,15 +61,22 @@ export default class Peer {
56
61
  */
57
62
  private sendEmmit;
58
63
  /**
59
- * 停止呼叫状态检查timer
60
- *
61
- * @private
64
+ * 停止状态检查定时器,重置重连状态
62
65
  */
63
66
  private stopConnectTimer;
64
67
  /**
65
- * 监听peer连接状态,Timeout:40s
68
+ * 启动检测监听到Track回调消息检测器
66
69
  *
67
- * @private
70
+ * 检测场景:当Peer连接成功,但是未收到Track消息,导致收音频/视频异常问题
71
+ * 检测次数:1次,如仍然失败,则直接退会
72
+ */
73
+ private startDetectTrackMsgTimer;
74
+ /**
75
+ * 清理Track回调检测器定时器
76
+ */
77
+ private stopDetectTrackMsgTimer;
78
+ /**
79
+ * 监听peer连接状态,Timeout:40s
68
80
  */
69
81
  private initTimer;
70
82
  /**
@@ -116,33 +128,38 @@ export default class Peer {
116
128
  frameRate?: number | undefined;
117
129
  } | undefined, isIncreaseBase: boolean | undefined, stream: MediaStream | null): Promise<void>;
118
130
  /**
119
- * View the cb of ice connection status change
120
- * Maybe status:'new', 'checking', 'connected', 'completed', 'failed', 'disconnected', 'closed'
131
+ * ICE Connection status change
121
132
  *
122
- * @private
123
- * @param { Event } e ice连接回调状态事件
133
+ * @param { Event } e - ICE状态回调事件
124
134
  */
125
135
  private onHandleIceConnectionStateChange;
126
136
  /**
127
- * peerConnection connect status change cb, only supports Chrome 72 or higher
128
- * pc.connectionState: connected,disconnected,failed,closed,connecting,new
137
+ * PeerConnection connect state change
129
138
  *
130
- * @private
139
+ * Only supports Chrome 72 or higher, Firefox 113 or higher
140
+ *
141
+ * @param { Event } e - ICE状态回调事件
131
142
  */
132
143
  private onHandleConnectionStateChange;
144
+ private peerStateChange;
133
145
  onHandleIcecandidateerror(e: Event): void;
134
146
  private onHandleIcecandidate;
147
+ /**
148
+ * Peer已经连接成功
149
+ *
150
+ * @returns { boolean } - True或者False
151
+ */
152
+ get isPeerConnected(): boolean;
135
153
  /**
136
154
  * 重连PeerConnection
137
155
  *
138
- * @public
156
+ * @param { 'socket' | 'peer' } entry - 重连入口
139
157
  */
140
- restartIceConnection(isRestartIceConnection?: boolean): Promise<void>;
158
+ restartIceConnection(entry: 'socket' | 'peer'): Promise<void>;
141
159
  /**
142
160
  * 关闭PeerConnection连接、销毁状态
143
161
  */
144
162
  close(): void;
145
- setRestartIceConnection(isRestartIceConnection?: boolean): void;
146
163
  /**
147
164
  * Push people and content tracks of stream
148
165
  *
@@ -173,8 +190,6 @@ export default class Peer {
173
190
  closeContentStream(): void;
174
191
  /**
175
192
  * Get peerConnection status
176
- *
177
- * @public
178
193
  */
179
194
  getPeerStatus(): boolean;
180
195
  /**
@@ -5,7 +5,7 @@
5
5
  * @author jinghui-Luo
6
6
  *
7
7
  * Created at : 2020-12-18 16:54:15
8
- * Last modified : 2024-03-12 14:39:41
8
+ * Last modified : 2024-04-18 16:43:44
9
9
  */
10
10
  import Logger from '../tools/logger';
11
11
  declare class VideoManager {
@@ -39,7 +39,7 @@ declare class VideoManager {
39
39
  private initStreamTrackEventListener;
40
40
  private removeStreamTrackEventListener;
41
41
  isHaveSrcObject(): MediaProvider | null;
42
- setSource(key: string, wrapEleId: string): void;
42
+ setSource(id: string, wrapEleId: string): void;
43
43
  destroy(): void;
44
44
  setVideoStatusChange(cb: any): void;
45
45
  private onEnded;
@@ -21,7 +21,6 @@ interface ISupportTest {
21
21
  }
22
22
  export declare const detect: {
23
23
  isMinBrowser: () => boolean;
24
- isMobile: () => boolean;
25
24
  isFirefox: () => boolean;
26
25
  isSupportAspectRatio: () => boolean;
27
26
  isSupportReauthorize: () => boolean;