@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.
Files changed (46) hide show
  1. package/lib/action/index.d.ts +29 -5
  2. package/lib/enum/client.d.ts +15 -0
  3. package/lib/enum/contraints.d.ts +30 -102
  4. package/lib/enum/device.d.ts +1 -0
  5. package/lib/enum/errorCode.d.ts +58 -1
  6. package/lib/enum/index.d.ts +53 -16
  7. package/lib/index.d.ts +11 -8
  8. package/lib/main/client.d.ts +157 -79
  9. package/lib/main/deviceManager.d.ts +23 -4
  10. package/lib/main/helper.d.ts +2 -2
  11. package/lib/main/iauth.d.ts +67 -5
  12. package/lib/main/layoutManager.d.ts +29 -11
  13. package/lib/main/meeting.d.ts +73 -35
  14. package/lib/main/peer.d.ts +70 -121
  15. package/lib/main/qualityManager.d.ts +38 -9
  16. package/lib/main/stream.d.ts +237 -104
  17. package/lib/main/videoManager.d.ts +1 -9
  18. package/lib/tools/config.d.ts +5 -1
  19. package/lib/tools/dbManager.d.ts +106 -0
  20. package/lib/tools/detect.d.ts +2 -2
  21. package/lib/tools/enum.d.ts +1 -1
  22. package/lib/tools/httpClient.d.ts +15 -23
  23. package/lib/tools/i18n.d.ts +1 -1
  24. package/lib/tools/logger.d.ts +75 -74
  25. package/lib/tools/logger.worker.d.ts +13 -0
  26. package/lib/tools/quality.d.ts +113 -0
  27. package/lib/tools/quality.worker.d.ts +13 -0
  28. package/lib/tools/queue.d.ts +38 -3
  29. package/lib/tools/template.d.ts +3 -3
  30. package/lib/tools/utils.d.ts +8 -0
  31. package/lib/type/action.d.ts +4 -0
  32. package/lib/type/base.d.ts +2 -2
  33. package/lib/type/client.d.ts +280 -186
  34. package/lib/type/device.d.ts +21 -15
  35. package/lib/type/iauth.d.ts +112 -0
  36. package/lib/type/index.d.ts +4 -0
  37. package/lib/type/layout.d.ts +18 -1
  38. package/lib/type/logger.d.ts +112 -0
  39. package/lib/type/meeting.d.ts +11 -2
  40. package/lib/type/peer.d.ts +20 -0
  41. package/lib/type/quality.d.ts +101 -0
  42. package/lib/type/stream.d.ts +332 -134
  43. package/lib/xyrtc.cjs.js +1 -1
  44. package/lib/xyrtc.umd.js +1 -1
  45. package/package.json +5 -4
  46. package/lib/tools/db.d.ts +0 -85
@@ -4,7 +4,7 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-23 12:04:44
6
6
  */
7
- import { IClientConfig, ICall, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternels, IVideoAudioType, IShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, IContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage, IFeatureConfig, IConfMgmtUrl, IVideoControlResult, ICustomMessageConfig } from '../type';
7
+ import { IClientConfig, ICall, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternals, IVideoAudioType, ShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, ContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage, IFeatureConfig, IConfMgmtUrl, IVideoControlResult, ICustomMessageConfig, OperateType, PushType, FacingMode, IFacingMode, ILoginWidthAuthCode, LoginXYAccountParams, LoginExtTokenParams, IReturnResult, InviteInfo } from '../type';
8
8
  import Emitter from '../tools/emitter';
9
9
  import Socket from '../tools/socket';
10
10
  import Stream from './stream';
@@ -29,7 +29,7 @@ export default class Client extends Emitter {
29
29
  pushType: IPushType;
30
30
  isAutoBandwidth: boolean;
31
31
  debug: boolean;
32
- shareContentStatus: IShareContentStatus;
32
+ shareContentStatus: ShareContentStatus;
33
33
  deviceManager: DeviceManager | null;
34
34
  localHide: boolean;
35
35
  hideId: string;
@@ -61,7 +61,6 @@ export default class Client extends Emitter {
61
61
  private errorcode;
62
62
  private i18nCode;
63
63
  private clientErrorState;
64
- private limitResolution;
65
64
  private customLayoutCacheList;
66
65
  private contentMode;
67
66
  private contentOnholdInfo;
@@ -73,8 +72,12 @@ export default class Client extends Emitter {
73
72
  private handStatus;
74
73
  private featureConfig;
75
74
  private meeting;
76
- private speakerInfos;
75
+ private cacheSpeakersInfo;
76
+ private speakersInfo;
77
77
  private operateQueue;
78
+ private facingMode;
79
+ private wsReConnectCount;
80
+ private localSpeakerTimer;
78
81
  private onDocumentChange;
79
82
  constructor(config: IClientConfig, logger: Logger);
80
83
  static instance: Client;
@@ -97,6 +100,7 @@ export default class Client extends Emitter {
97
100
  getFeatureConfig(): IFeatureConfig;
98
101
  getCallInfo(): ICall;
99
102
  getClientConfig(): IClientConfig;
103
+ getAutoMode(): boolean;
100
104
  getVideoManagers(): import("../type").IVideoRenders | undefined;
101
105
  getPreviewStreams(): import("../type").IGetMediaStreams | {
102
106
  previewStreams: never[];
@@ -116,7 +120,7 @@ export default class Client extends Emitter {
116
120
  getPeerConnectionStatus(): boolean;
117
121
  getOnHold(): boolean;
118
122
  getAudioTrackList(): ICustomStreamTrack[];
119
- getLayoutList(): Map<string, ILayout> | undefined;
123
+ getLayoutMap(): Map<any, any>;
120
124
  /**
121
125
  * 获取Local roster信息
122
126
  *
@@ -129,6 +133,15 @@ export default class Client extends Emitter {
129
133
  * @returns { boolean }
130
134
  */
131
135
  getLocalShareContent(): boolean;
136
+ getFacingMode(): FacingMode;
137
+ /**
138
+ * 获取ws重连次数
139
+ */
140
+ getWsReConnectCount(): number;
141
+ /**
142
+ * 获取Layout头像配置类型
143
+ */
144
+ getLayoutAvatarType(): import("../type").LayoutAvatarType;
132
145
  /**
133
146
  * 企业媒体相关配置信息
134
147
  *
@@ -144,26 +157,66 @@ export default class Client extends Emitter {
144
157
  /**
145
158
  * 小鱼账号初始登录,获取token方法
146
159
  *
160
+ * @deprecated 已废弃 但不影响老客户调用,建议使用新登录方式:loginXYAccount
147
161
  * @public
148
162
  * @param { string } userName 小鱼用户账号
149
163
  * @param { string } password 小鱼用户账号密码
150
- * @returns { Promise<Object> } { access_token }
164
+ * @returns { Promise<IReturnResult> } 登录结果
151
165
  */
152
- loginXYlinkAccount(userName: string, password: string): Promise<Object>;
166
+ loginXYlinkAccount(userName: string, password: string): Promise<IReturnResult>;
153
167
  /**
154
- * 第三方登录方法
168
+ * 第三方账号登录
155
169
  *
156
170
  * @public
157
171
  * @param { ILoginExtAccount } params 参数
158
- * @return { Promise<Object> } 登录结果
172
+ * @param { string } params.displayName 用户名称
173
+ * @param { string } params.extId 企业ID
174
+ * @param { string } params.extUserId 三方用户ID
175
+ * @param { string } params.authCode 授权码 v3.8.2新增
176
+ * @param { string } params.tempUser 是否是临时账号 v3.8.2新增
177
+ * @return { Promise<IReturnResult> } 登录结果
159
178
  */
160
- loginExternalAccount(params: ILoginExtAccount): Promise<Object>;
179
+ loginExternalAccount(params: ILoginExtAccount): Promise<IReturnResult>;
180
+ /**
181
+ * 三方账号统一认证登录 - 小鱼账号登录
182
+ *
183
+ * @param { LoginXYAccountParams } params 参数
184
+ * @param { string } params.account 用户账号
185
+ * @param { string } params.password 用户密码
186
+ * @param { string } params.countryCode 国家码:默认+86
187
+ * @param { string } params.extId 企业ID
188
+ * @return { Promise<IReturnResult> } 登录结果
189
+ */
190
+ loginXYAccount(params: LoginXYAccountParams): Promise<IReturnResult>;
191
+ /**
192
+ * 三方账号统一认证登录 - token登录
193
+ *
194
+ * @param { LoginExtTokenParams } params 参数
195
+ * @param { string } params.authCode 登录码
196
+ * @param { string? } params.extId 企业ID
197
+ * @return { Promise<IReturnResult> } 登录结果
198
+ */
199
+ loginExtToken(params: LoginExtTokenParams): Promise<IReturnResult>;
200
+ /**
201
+ * 建行授权码登录
202
+ *
203
+ * @public
204
+ * @param { ILoginWidthAuthCode } params 参数
205
+ * @param { string } params.extId 企业id
206
+ * @param { string } params.extUserId 用户id
207
+ * @param { string } params.displayName 用户名称
208
+ * @param { string } params.oauthCode 授权码
209
+ * @param { boolean } params.isTempUser 是否临时账户
210
+ * @param { string } params.channelId 渠道id
211
+ * @return { Promise<IReturnResult> } 登录结果
212
+ */
213
+ loginWithAuthCode(params: ILoginWidthAuthCode): Promise<IReturnResult>;
161
214
  /**
162
215
  * 退会时 重置初始化参数
163
216
  *
164
217
  */
165
218
  resetInitParameter(): void;
166
- setContentMode(mode: IContentMode): void;
219
+ setContentMode(mode: ContentMode): void;
167
220
  /**
168
221
  * SDK功能控制开关
169
222
  *
@@ -183,13 +236,7 @@ export default class Client extends Emitter {
183
236
  * @property { boolean } config.enableWatermarkContent 是否启用获取content水印内容, 默认启用, 设置为true
184
237
  * @returns { IResult }
185
238
  */
186
- setFeatureConfig(config: IFeatureConfig): import("../type").IReturnResult | undefined;
187
- /**
188
- * 限制Content和People发送能力
189
- *
190
- * @param { boolean } limitPeople - 是否限制People的发送能力
191
- */
192
- private setLimitResolution;
239
+ setFeatureConfig(config: IFeatureConfig): IReturnResult | undefined;
193
240
  /**
194
241
  * 获取会控地址
195
242
  */
@@ -236,6 +283,13 @@ export default class Client extends Emitter {
236
283
  * 重新播放音频
237
284
  */
238
285
  playAudio(): Promise<boolean>;
286
+ /**
287
+ * 设置相机方向
288
+ *
289
+ * @param { IFacingMode } position 相机方向
290
+ * @returns { Promise<IFacingMode> } 最终切换的相机方向
291
+ */
292
+ switchCamera(facingMode?: IFacingMode): Promise<IFacingMode>;
239
293
  /**
240
294
  * 绑定streamId和audio ele元素,内部维护状态
241
295
  *
@@ -308,6 +362,12 @@ export default class Client extends Emitter {
308
362
  * @param { Object } data 远端数据
309
363
  */
310
364
  private onEPMessage;
365
+ /**
366
+ * 处理联席主持人消息
367
+ *
368
+ * @param data
369
+ */
370
+ private onNotification;
311
371
  /**
312
372
  * 通知会控打开/关闭摄像头结果
313
373
  *
@@ -315,26 +375,26 @@ export default class Client extends Emitter {
315
375
  * @param { IVideoControlResult } data - 数据详情
316
376
  * @returns { Promise<IReturnResult | null> }
317
377
  */
318
- sendVideoControlResult(type: 'muteVideo' | 'unMuteVideo', data: IVideoControlResult): Promise<import("../type").IReturnResult>;
378
+ sendVideoControlResult(type: 'muteVideo' | 'unMuteVideo', data: IVideoControlResult): Promise<IReturnResult>;
319
379
  /**
320
- * 处理录制状态上报
380
+ * 处理远端录制状态上报
321
381
  *
322
382
  * @private
323
- * @param { Object } data 远端数据
383
+ * @param { IRecordStatusNotification } data
324
384
  */
325
385
  private onRecordStatusNotfiMessage;
326
386
  /**
327
- * 处理录制结果上报Message
387
+ * 处理本地录制结果上报Message
328
388
  *
329
389
  * @private
330
- * @param { Object } data 远端数据
390
+ * @param { IRecordingStateChanged } data
331
391
  */
332
392
  private onRecordingStateChangedMessage;
333
393
  /**
334
394
  * 处理Content状态控制消息
335
395
  *
336
396
  * @private
337
- * @param { Object } data 远端数据
397
+ * @param { Object } data
338
398
  */
339
399
  private onDualStreamMessage;
340
400
  /**
@@ -420,7 +480,7 @@ export default class Client extends Emitter {
420
480
  * @public
421
481
  * @param { Stream } stream 本地contentStream
422
482
  */
423
- sendContentCapabilityMessage(stream?: Stream): void;
483
+ sendContentCapability(): void;
424
484
  /**
425
485
  * 分享content
426
486
  *
@@ -446,7 +506,7 @@ export default class Client extends Emitter {
446
506
  */
447
507
  private handleContentOnholdAudio;
448
508
  /**
449
- * 合并track
509
+ * 合并tTrack
450
510
  *
451
511
  * @param { RTCTrackEvent } e
452
512
  */
@@ -485,36 +545,62 @@ export default class Client extends Emitter {
485
545
  */
486
546
  private getCodeByJson;
487
547
  /**
488
- * 音视频开启关闭操作
548
+ * 添加音视频开启/关闭 同步任务
549
+ *
550
+ * @private
551
+ * @param { OperateType } type 操作类型
552
+ * @param { boolean } isSendWs 是否向信令发送对应消息,默认:发送(true); 信令下发的音频mute/unmute,不再向信令发送此消息
553
+ * @returns Promise
554
+ */
555
+ private addOperateVideoAudioTask;
556
+ /**
557
+ * 音视频开启/关闭操作
489
558
  *
490
559
  * @private
491
- * @param { 'muteAudio' | 'muteVideo' | 'unmuteAudio' | 'unmuteVideo' } type 操作类型
560
+ * @param { OperateType } type 操作类型
561
+ * @param { boolean } isSendWs 是否向信令发送对应消息,默认:发送(true); 信令下发的音频mute/unmute,不再向信令发送此消息
492
562
  * @returns Promise<IVideoAudioType> 类型
493
563
  */
494
- private videoAudioOperate;
564
+ private operateVideoAudio;
565
+ /**
566
+ * 操作Stream中的音视频流
567
+ *
568
+ * @param { OperateType } type - 操作类型
569
+ */
570
+ private operateStreamStatus;
495
571
  /**
496
- * 静音 操作
572
+ * 清除Local Speaker Timer
573
+ */
574
+ private clearSpeakerTimer;
575
+ /**
576
+ * 推流到PeerConnection上
577
+ *
578
+ * @param pushType
579
+ */
580
+ peerPublish(pushType: PushType): void;
581
+ /**
582
+ * 关闭麦克风
497
583
  *
498
584
  * @public
499
585
  * @returns { Promise<IVideoAudioType> } 操作类型
500
586
  */
501
587
  muteAudio(): Promise<IVideoAudioType>;
502
588
  /**
503
- * 关闭摄像头 操作
589
+ * 关闭摄像头
504
590
  *
505
591
  * @public
506
592
  * @returns { Promise<IVideoAudioType> } 操作类型
507
593
  */
508
594
  muteVideo(): Promise<IVideoAudioType>;
509
595
  /**
510
- * 开启摄像头 操作
596
+ * 开启麦克风
511
597
  *
512
598
  * @public
513
599
  * @returns { Promise<IVideoAudioType> } 操作类型
514
600
  */
515
601
  unmuteAudio(): Promise<IVideoAudioType>;
516
602
  /**
517
- * 取消静音 操作
603
+ * 开启摄像头
518
604
  *
519
605
  * @public
520
606
  * @returns { Promise<IVideoAudioType> } 操作类型
@@ -578,20 +664,16 @@ export default class Client extends Emitter {
578
664
  * @param { boolean } status peer连接状态
579
665
  */
580
666
  setPeerConnectionStatus(status: boolean): void;
667
+ /**
668
+ * 发送带宽配置
669
+ */
581
670
  private sendWebRxBandwidth;
582
671
  /**
583
672
  * 处理会议室静音状态
584
673
  *
585
- * @param { string } automute // "" | "mute" | "forcemute" 会议室静音属性
674
+ * @param { string } automute - "" | "mute" | "forcemute" 会议室静音属性
586
675
  */
587
676
  private handleAutoMute;
588
- /**
589
- * 根据 autoMute 或 muteOperation 的值发送音频流
590
- *
591
- * @private
592
- * @param { string } audioMute 是否静音
593
- */
594
- private onSetAudioStream;
595
677
  /**
596
678
  * 处理会控消息,如音频、主会场、content等
597
679
  *
@@ -615,7 +697,7 @@ export default class Client extends Emitter {
615
697
  * @param { string } config.data - 消息内容,JSON字符串;因业务数据可能会传输图片,需要对二进制数据进行base64编码,消息长度限制最大:1030KB
616
698
  * @return { { code: string, message: string, data: null | object } } 返回结果
617
699
  */
618
- sendCustomMessage(config: ICustomMessageConfig): import("../type").IReturnResult;
700
+ sendCustomMessage(config: ICustomMessageConfig): IReturnResult;
619
701
  /**
620
702
  * 处理媒体消息
621
703
  *
@@ -629,6 +711,12 @@ export default class Client extends Emitter {
629
711
  * @private
630
712
  */
631
713
  private onSpeakerInfoMessage;
714
+ /**
715
+ * 推送实时讲话人信息
716
+ *
717
+ * @param { SpeakersInfoObj[] } speakersInfo - 说话人信息
718
+ */
719
+ private emitSpeakersInfo;
632
720
  /**
633
721
  * 处理contentOnhold
634
722
  *
@@ -701,27 +789,18 @@ export default class Client extends Emitter {
701
789
  * @returns { Promise<boolean> } 是否请求成功
702
790
  */
703
791
  requestAutoPollingLayout(command: TCommand, interval: number | undefined, reqList: IReqInfo[]): Promise<boolean>;
704
- /**
705
- * 应用替换已经更新的的people video track轨道流,如果之前无流,则需重新setStream, replaceTrack
706
- * 第一次开启音频、或视频,需重新协商offer。改变通道方向
707
- *
708
- * @public
709
- * @param { 'video' | 'audio' } kind 设备类型
710
- * @param { boolean } isFirst 是否之前无流
711
- */
712
- applyVideoOrAudio(kind: 'video' | 'audio', isFirst?: boolean): void;
713
792
  /**
714
793
  * 推送本地Audio状态
715
794
  *
716
795
  * @param { boolean | string } status
717
796
  */
718
- sendAudioStatus(status: boolean | string): void;
797
+ emitAudioStatus(type: OperateType): void;
719
798
  /**
720
799
  * 推送本地Video状态
721
800
  *
722
- * @param { boolean | string } status
801
+ * @param { OperateType } type - 操作类型
723
802
  */
724
- sendVideoStatus(status: boolean | string): void;
803
+ emitVideoStatus(type: OperateType): void;
725
804
  /**
726
805
  * 发布 自动布局/自定义布局 layout布局信息(参会人最新的布局列表数据)
727
806
  *
@@ -762,13 +841,6 @@ export default class Client extends Emitter {
762
841
  * @param { IMode } templateMode 布局模式
763
842
  */
764
843
  sendTemplateMode(templateMode: IMode): void;
765
- /**
766
- * ws 发送摄像头、麦克风开启关闭操作
767
- *
768
- * @private
769
- * @param { IVideoAudioMessageType } type 操作类型
770
- */
771
- private sendOperationMessage;
772
844
  /**
773
845
  * 处理旋转信息
774
846
  *
@@ -786,23 +858,23 @@ export default class Client extends Emitter {
786
858
  * 上报会议质量数据
787
859
  *
788
860
  * @public
789
- * @param { IInternels } internels Internels统计数据
861
+ * @param { IInternals } internals Internals统计数据
790
862
  */
791
- reportQualityData(internels: IInternels): void;
863
+ reportQualityData(internals: IInternals): void;
792
864
  /**
793
- * Internels统计数据-期望带宽
865
+ * Internals统计数据-期望带宽
794
866
  *
795
- * @param internels
867
+ * @param internals
796
868
  * @returns
797
869
  */
798
- private getInternels;
870
+ private getNewInternals;
799
871
  /**
800
- * 发布Internels统计数据
872
+ * 上报给业务层Internals统计数据
801
873
  *
802
874
  * @public
803
- * @param { IInternels } internels Internels统计数据
875
+ * @param { IInternals } internals Internals统计数据
804
876
  */
805
- sendInternels(internels: IInternels): void;
877
+ sendInternals(internals: IInternals): void;
806
878
  /**
807
879
  * 取消监听事件
808
880
  *
@@ -829,7 +901,7 @@ export default class Client extends Emitter {
829
901
  */
830
902
  private removeWindowResizeEvent;
831
903
  /**
832
- * 发送wss peopleCapability,通知本地采集能力,用于vom进行分配
904
+ * 通知本地采集能力,用于vom进行分配
833
905
  *
834
906
  * @public
835
907
  */
@@ -933,12 +1005,6 @@ export default class Client extends Emitter {
933
1005
  * @public
934
1006
  */
935
1007
  stopCloudRecord(): Promise<undefined>;
936
- /**
937
- * 重新发送content offer
938
- *
939
- * @public
940
- */
941
- reSendContentOffer(): void;
942
1008
  /**
943
1009
  * 重新计算Layout布局数据
944
1010
  *
@@ -959,7 +1025,7 @@ export default class Client extends Emitter {
959
1025
  * @param { number } mediagroupId 分组id,也称sessionId或者mediaGroupId,代表只向此分组通道发送音频数据
960
1026
  * @returns { boolean }
961
1027
  */
962
- bindTrackGroup(trackType: 'audio' | 'video', mediagroupId: number): true | import("../type").IReturnResult;
1028
+ bindTrackGroup(trackType: 'audio' | 'video', mediagroupId: number): true | IReturnResult;
963
1029
  /**
964
1030
  * 启用多分组通道,接收多分组通道数据
965
1031
  *
@@ -967,7 +1033,7 @@ export default class Client extends Emitter {
967
1033
  * @param { Key[] } mediagrpIds 多分组sessionId,可以配置多个或一个值
968
1034
  * @returns { boolean }
969
1035
  */
970
- startMonitorGroup(mediagrpIds: Key[]): true | import("../type").IReturnResult;
1036
+ startMonitorGroup(mediagrpIds: Key[]): true | IReturnResult;
971
1037
  /**
972
1038
  * 停止多分组通道,销毁资源
973
1039
  *
@@ -975,7 +1041,13 @@ export default class Client extends Emitter {
975
1041
  * @param { Key[] } mediagrpIds 多分组sessionId,可以配置多个或一个值
976
1042
  * @returns { boolean }
977
1043
  */
978
- stopMonitorGroup(mediagrpIds: Key[]): true | import("../type").IReturnResult;
1044
+ stopMonitorGroup(mediagrpIds: Key[]): true | IReturnResult;
1045
+ /**
1046
+ * 获取会议分享详情信息
1047
+ *
1048
+ * @returns {Promise<InviteInfo>}
1049
+ */
1050
+ getMeetingInviteInfo(): Promise<InviteInfo>;
979
1051
  /**
980
1052
  * 设置多分组通道,通用方法
981
1053
  *
@@ -985,6 +1057,12 @@ export default class Client extends Emitter {
985
1057
  * @returns { boolean }
986
1058
  */
987
1059
  private setMonitorGroup;
1060
+ /**
1061
+ * 校验clientId/clientSecret
1062
+ *
1063
+ * @returns
1064
+ */
1065
+ private verifyParameter;
988
1066
  /**
989
1067
  * 初始化DeviceManager事件
990
1068
  *
@@ -2,15 +2,14 @@
2
2
  * XYLink WebRTC Device & Permission Manager Lib
3
3
  *
4
4
  * @summary device and permission manager
5
- * @email luojinghui424@gmail.com
6
5
  * @author jinghui-luo、chengfei
7
6
  *
8
7
  * Created at : 2020-11-26 14:41:51
9
- * Last modified : 2022-06-09 17:33:47
8
+ * Last modified : 2023-04-24 14:38:52
10
9
  */
11
10
  import Logger from '../tools/logger';
12
11
  import Emitter from '../tools/emitter';
13
- import { IDeviceList, ISelectedDevice, ICurrentPermission } from '../type';
12
+ import { IDeviceInfo, IDeviceList, ISelectedDevice, ICurrentPermission, PermissionType, DeviceKind, FacingMode } from '../type';
14
13
  /**
15
14
  * DeviceManager模块,用于管理枚举设备列表、监听设备变动、处理设备权限等功能
16
15
  *
@@ -26,6 +25,7 @@ declare class DeviceManager extends Emitter {
26
25
  private permissionCameraStatus;
27
26
  private permissionPhoneStatus;
28
27
  logger: Logger;
28
+ isNewLogger: boolean;
29
29
  constructor(logger?: Logger);
30
30
  /**
31
31
  * 获取设备权限数据
@@ -49,7 +49,7 @@ declare class DeviceManager extends Emitter {
49
49
  * @param type
50
50
  * @param deviceId
51
51
  */
52
- setCurrentUsedDeviceByType(type: 'audio' | 'video', deviceId: string): void;
52
+ setCurrentUsedDeviceByType(type: DeviceKind, deviceId: string): void;
53
53
  /**
54
54
  * 设置输出设备
55
55
  *
@@ -80,7 +80,19 @@ declare class DeviceManager extends Emitter {
80
80
  * 获取设备列表数据
81
81
  */
82
82
  getDevices(): Promise<IDeviceList>;
83
+ /**
84
+ * 设置当前麦克风/摄像头权限
85
+ *
86
+ * @param { ICurrentPermission } permission - 新的权限状态
87
+ */
83
88
  setPermission(permission: ICurrentPermission): void;
89
+ /**
90
+ * 通过采集能力更新设备权限
91
+ *
92
+ * @param { PermissionType } video - 摄像头权限
93
+ * @param { PermissionType } audio - 麦克风权限
94
+ */
95
+ updateDevicePermission(video: PermissionType, audio: PermissionType): void;
84
96
  /**
85
97
  * 【私有方法】
86
98
  * 向外提供权限信息
@@ -114,6 +126,13 @@ declare class DeviceManager extends Emitter {
114
126
  * TODO:可以通过looping的形式检测,后续在处理
115
127
  */
116
128
  getPermission(): Promise<ICurrentPermission>;
129
+ /**
130
+ * 获取手机前置/后置摄像头
131
+ *
132
+ * @param { FacingMode } type
133
+ * @returns { IDeviceInfo } 摄像头信息
134
+ */
135
+ getCameraDeviceByMode(type: FacingMode): Promise<IDeviceInfo>;
117
136
  /**
118
137
  * 【私有方法】
119
138
  * 如果有音频设备插入,则选取最新设备
@@ -5,10 +5,10 @@
5
5
  * @email luojinghui424@gmail.com
6
6
  *
7
7
  * Created at : 2021-01-09 14:45:46
8
- * Last modified : 2022-11-03 19:20:11
8
+ * Last modified : 2023-05-16 18:54:50
9
9
  */
10
10
  import { ILayout, IVideoManagerState, IRotationInfoTotalItem } from '../type';
11
- export declare const getLayoutItemState: (item: ILayout | ILayout, stream: MediaStream | null, vmState: IVideoManagerState) => "REQUEST" | "NORMAL" | "AUDIO_ONLY" | "MUTE" | "AUDIO_TEL" | "AUDIO_CONTENT";
11
+ export declare const getLayoutItemState: (item: ILayout | ILayout, stream: MediaStream | null, vmState: IVideoManagerState) => "REQUEST" | "NORMAL" | "MUTE" | "AUDIO_TEL" | "AUDIO_ONLY" | "AUDIO_CONTENT";
12
12
  /**
13
13
  * Get video real display size and rotate of transform infos
14
14
  * @param width video real width of resolution
@@ -2,28 +2,90 @@
2
2
  * 登录模块
3
3
  *
4
4
  */
5
- import { ILoginExtAccount, ISdkUserInfo, ILoginInfo } from '../type';
5
+ import { ILoginExtAccount, ISdkUserInfo, ILoginInfo, ILoginWidthAuthCode, LoginXYAccountParams, LoginExtTokenParams, ExtInfo } from '../type';
6
6
  import Logger from '../tools/logger';
7
7
  declare class IAuth {
8
8
  private logger;
9
9
  private loginInfo;
10
- constructor(logger: Logger);
10
+ private extInfo;
11
+ constructor(logger: Logger, extInfo?: ExtInfo);
11
12
  getLoginInfo(): ILoginInfo;
12
13
  setLoginInfo(loginInfo: ILoginInfo): void;
14
+ setExtInfo(info: ExtInfo): void;
13
15
  /**
14
- * 第三方登录方法
16
+ * 第三方账号登录 - 旧方法
15
17
  *
16
18
  * @public
17
19
  * @param { ILoginExtAccount } params 参数
18
- * @return { Promise<Object> } 登录结果
20
+ * @param { string } params.displayName 用户名称
21
+ * @param { string } params.extId 企业id
22
+ * @param { string? } params.extUserId 三方用户ID
23
+ * @return
19
24
  */
20
- loginExternalAccount(params: ILoginExtAccount): Promise<Object>;
25
+ loginExternalAccount(params: ILoginExtAccount): Promise<import("../type").IReturnResult>;
26
+ /**
27
+ * 授权码登录
28
+ *
29
+ * @param { ILoginWidthAuthCode } params 参数
30
+ * @param {string} params.extID 企业id
31
+ * @param {string} params.extUserId 用户id
32
+ * @param {string} params.displayName 用户名称
33
+ * @param {string} params.oauthCode 授权码
34
+ * @param {boolean} params.isTempUser 是否临时账户
35
+ * @param {string} params.channelId 渠道id
36
+ * @return
37
+ */
38
+ loginWithAuthCode(params: ILoginWidthAuthCode): Promise<import("../type").IReturnResult>;
21
39
  /**
22
40
  * 登录
23
41
  *
24
42
  * @param { ISdkUserInfo } sdkUserInfo
25
43
  * @param { ILoginExtAccount } params
44
+ * @return
26
45
  */
27
46
  login(sdkUserInfo: ISdkUserInfo, params?: ILoginExtAccount): Promise<import("../type").IReturnResult>;
47
+ /**
48
+ * 三方用户统一认证-小鱼账号登录
49
+ *
50
+ * @param { LoginXYAccountParams } params 参数
51
+ * @return
52
+ */
53
+ loginXYAccount(params: LoginXYAccountParams): Promise<import("../type").IReturnResult>;
54
+ /**
55
+ * 三方用户统一认证-三方id登录
56
+ *
57
+ * @param { ILoginExtAccount } params 参数
58
+ * @return
59
+ */
60
+ loginExtUserId(params: ILoginExtAccount): Promise<import("../type").IReturnResult>;
61
+ /**
62
+ * 三方用户统一认证-token登录
63
+ *
64
+ * @param { LoginExtTokenParams } params 参数
65
+ * @return
66
+ */
67
+ loginExtToken(params: LoginExtTokenParams): Promise<import("../type").IReturnResult>;
68
+ /**
69
+ * 统一处理登录后的信息
70
+ *
71
+ * @param { any } result 接口返回值
72
+ * @param { ILoginExtAccount } params
73
+ * @returns
74
+ */
75
+ private handleLoginResult;
76
+ /**
77
+ * 校验必填参数
78
+ *
79
+ * @param { Record<string, any> | any } requiredField 校验参数
80
+ * @returns
81
+ */
82
+ private verifyRequiredField;
83
+ /**
84
+ * 校验三方用户ID
85
+ *
86
+ * @param { string } extUserId 三方用户ID
87
+ * @returns
88
+ */
89
+ private verifyExtUserId;
28
90
  }
29
91
  export default IAuth;