@xylink/xy-rtc-sdk 3.8.0 → 3.9.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.
Files changed (45) hide show
  1. package/README.MD +37 -37
  2. package/lib/action/index.d.ts +21 -6
  3. package/lib/enum/client.d.ts +15 -0
  4. package/lib/enum/contraints.d.ts +33 -96
  5. package/lib/enum/device.d.ts +1 -0
  6. package/lib/enum/errorCode.d.ts +58 -1
  7. package/lib/enum/i18n.d.ts +39 -0
  8. package/lib/enum/index.d.ts +65 -16
  9. package/lib/index.d.ts +11 -8
  10. package/lib/main/client.d.ts +101 -71
  11. package/lib/main/deviceManager.d.ts +23 -4
  12. package/lib/main/helper.d.ts +2 -2
  13. package/lib/main/iauth.d.ts +14 -1
  14. package/lib/main/layoutManager.d.ts +43 -13
  15. package/lib/main/meeting.d.ts +75 -21
  16. package/lib/main/peer.d.ts +70 -121
  17. package/lib/main/qualityManager.d.ts +38 -9
  18. package/lib/main/stream.d.ts +237 -104
  19. package/lib/main/videoManager.d.ts +1 -9
  20. package/lib/tools/dbManager.d.ts +106 -0
  21. package/lib/tools/detect.d.ts +2 -2
  22. package/lib/tools/enum.d.ts +1 -1
  23. package/lib/tools/httpClient.d.ts +4 -4
  24. package/lib/tools/i18n.d.ts +1 -1
  25. package/lib/tools/logger.d.ts +75 -74
  26. package/lib/tools/logger.worker.d.ts +13 -0
  27. package/lib/tools/quality.d.ts +113 -0
  28. package/lib/tools/quality.worker.d.ts +13 -0
  29. package/lib/tools/queue.d.ts +38 -3
  30. package/lib/tools/template.d.ts +8 -1
  31. package/lib/tools/utils.d.ts +8 -0
  32. package/lib/type/base.d.ts +2 -2
  33. package/lib/type/client.d.ts +286 -183
  34. package/lib/type/device.d.ts +21 -15
  35. package/lib/type/index.d.ts +3 -0
  36. package/lib/type/layout.d.ts +25 -6
  37. package/lib/type/logger.d.ts +112 -0
  38. package/lib/type/meeting.d.ts +29 -0
  39. package/lib/type/peer.d.ts +20 -0
  40. package/lib/type/quality.d.ts +101 -0
  41. package/lib/type/stream.d.ts +340 -102
  42. package/lib/xyrtc.cjs.js +1 -1
  43. package/lib/xyrtc.umd.js +1 -1
  44. package/package.json +119 -119
  45. package/lib/tools/db.d.ts +0 -85
@@ -4,19 +4,38 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-30 14:12:52
6
6
  */
7
- import { IDefault, IMUTE_MAP, ITemplateMode, IContentTemplateMode, IRoster, IFeatureConfig } from '../type';
7
+ import { IDefault, IOPERATE_MAP, ITemplateMode, IContentTemplateMode, IRoster, IFeatureConfig, StreamStatus, StreamType, ILoggerConfig, FacingMode } from '../type';
8
8
  export * from './contraints';
9
9
  export declare const LOG_CACHE_COUNT = 10;
10
10
  export declare const DB_TABLE_COUNT = 10;
11
11
  export declare const DETECT_LOCATOR_SERVER_NAME = "WebrtcSigGW";
12
12
  export declare const MIME_TYPE = "video/H264";
13
+ export declare const MIME_AUDIO_TYPE = "audio/opus";
13
14
  export declare const DEVICE_TYPE = 17;
14
15
  export declare const SELF_MOCK_PID = 9999999999;
15
16
  export declare const STREAM_CHANNEL_COUNT = 11;
17
+ export declare const STREAM_OUTSIDE_CHANNEL_COUNT = 3;
16
18
  export declare const MAX_PARTICIPANT_COUNT = 112;
17
19
  export declare const MAX_CUSTOM_MESSAGE_LEN = 1846666;
18
20
  export declare const MAX_CUSTOM_MESSAGE_LOG_LEN = 13333;
19
21
  export declare const STREAM_ERROR_CODE_MAP: string[];
22
+ export declare const STREAM_RECREATE_CODE_MAP: string[];
23
+ /**
24
+ * 失效的StreamStatus列表
25
+ */
26
+ export declare const DISENABLED_STREAM_STATUS_MAP: StreamStatus[];
27
+ /**
28
+ * 支持采集视频流的StreamStatus列表
29
+ */
30
+ export declare const ENABLE_STREAM_STATUS_MAP: StreamStatus[];
31
+ /**
32
+ * 可用的StreamStatus列表
33
+ */
34
+ export declare const NORMAL_STREAM_STATUS_MAP: StreamStatus[];
35
+ /**
36
+ * 可用于发送的Stream Type列表
37
+ */
38
+ export declare const NORMAL_STREAM_TYPE_MAP: StreamType[];
20
39
  /**
21
40
  * 支持呼叫的会议室类型
22
41
  */
@@ -51,7 +70,7 @@ export declare const NETWORK_TYPE_MAP: {
51
70
  /**
52
71
  * 音视频状态
53
72
  */
54
- export declare const MUTE_MAP: IMUTE_MAP;
73
+ export declare const OPERATE_MAP: IOPERATE_MAP;
55
74
  export declare const CONFIGURATION: RTCConfiguration;
56
75
  /**
57
76
  * stop call 对应错误码
@@ -96,20 +115,6 @@ export declare const APP_NAME: {
96
115
  export declare const EVENT_TYPE_MAP: {
97
116
  [key: string]: string;
98
117
  };
99
- /**
100
- * content audio offer 状态
101
- */
102
- export declare const CONTENT_AUDIO_OFFER_STATE: {
103
- NOT_SEND: number;
104
- SEND: number;
105
- SENDED: number;
106
- };
107
- /**
108
- * 支持的分辨率
109
- */
110
- export declare const SCALE_RESOLUTION_MAP: {
111
- [key: string]: number;
112
- };
113
118
  /**
114
119
  * 隐身入会
115
120
  *
@@ -137,3 +142,47 @@ export declare const HIDE_KEY_INFOS: string[];
137
142
  * SDK功能控制开关
138
143
  */
139
144
  export declare const DEFAULT_FEATURE_CONFIG: IFeatureConfig;
145
+ /**
146
+ * Steam模块init方法config参数默认值
147
+ */
148
+ export declare const DEFAULT_STREAM_CONFIG_DEVICES: {
149
+ audioInputValue: string;
150
+ videoInValue: string;
151
+ };
152
+ /**
153
+ * 默认数据库版本
154
+ */
155
+ export declare const DEF_DB_VERSION = 1;
156
+ /**
157
+ * 默认数据表的起始索引序列
158
+ */
159
+ export declare const DEF_TABLE_INDEX = 1;
160
+ /**
161
+ * 默认数据库配置
162
+ */
163
+ export declare const DEFAULT_LOGGER_CONFIG: ILoggerConfig;
164
+ /**
165
+ * 相机方向
166
+ */
167
+ export declare const FACING_MODE_LIST: readonly [FacingMode.FRONT, FacingMode.BACK];
168
+ /**
169
+ * 企业配置信息
170
+ *
171
+ * @property downLinkCeilingRate 下行带宽配置
172
+ * @property upLinkCeilingRate 上行带宽配置(暂不支持)
173
+ * @property pvrxResolution 请流能力配置
174
+ */
175
+ export declare const ENTERPRISE_CONFIG: {
176
+ downLinkCeilingRate: {
177
+ clientConfigName: string;
178
+ configName: string;
179
+ };
180
+ upLinkCeilingRate: {
181
+ clientConfigName: string;
182
+ configName: string;
183
+ };
184
+ pvrxResolution: {
185
+ clientConfigName: string;
186
+ configName: string;
187
+ };
188
+ };
package/lib/index.d.ts CHANGED
@@ -6,29 +6,32 @@
6
6
  * @authors Luo-jinghui (luojinghui424@gmail.com)
7
7
  * @date 2019-10-14 18:20:28
8
8
  */
9
+ import { IClientConfig, IConfig, TLocale, ICheckSystemRequirements, ISteamConfig } from './type';
10
+ import DeviceManager from './main/deviceManager';
9
11
  import Logger from './tools/logger';
10
12
  import Client from './main/client';
11
13
  import Stream from './main/stream';
12
- import { IClientConfig, IConfig, TLocale, ICheckSystemRequirements } from './type';
13
- import DeviceManager from './main/deviceManager';
14
- import { getLayoutItemState, getVideoInfoByRotation, getLayoutRotateInfo, getSendSupportedCodec, detectLocator } from './main/helper';
15
- interface IXyRTC {
14
+ import { getVideoInfoByRotation, getSendSupportedCodec, getLayoutRotateInfo, getLayoutItemState, detectLocator } from './main/helper';
15
+ /**
16
+ * XYLink WebRTC SDK 操作入口
17
+ */
18
+ interface XYLinkRTC {
16
19
  version: string;
17
20
  client: Client | null;
18
21
  logger: Logger;
22
+ createClient: (config: IClientConfig, logger?: Logger) => Client;
23
+ createStream: (config?: ISteamConfig, logger?: Logger) => Stream;
19
24
  checkSupportWebRTC: () => Promise<ICheckSystemRequirements>;
20
25
  checkSupportMobileWebRTC: () => Promise<ICheckSystemRequirements>;
21
26
  checkSupportShareContent: () => boolean;
22
27
  setLocale: (language: TLocale) => void;
23
- createClient: (config: IClientConfig) => Client;
24
- createStream: () => Stream;
25
28
  setConfig: (config: IConfig) => void;
26
29
  closePreviewStream: (stream: MediaStream) => void;
27
30
  setOutputAudioDevice: (element: HTMLMediaElement, outputValue: string) => void;
28
31
  render: void;
29
32
  }
30
- declare const xyRTC: IXyRTC;
33
+ declare const xyRTC: XYLinkRTC;
31
34
  export default xyRTC;
32
- export { Client, Stream, DeviceManager, getLayoutItemState, getVideoInfoByRotation as getVideoInfoByRotaion, getLayoutRotateInfo, getSendSupportedCodec, detectLocator };
35
+ export { Client, Stream, Logger, DeviceManager, getLayoutItemState, getVideoInfoByRotation as getVideoInfoByRotaion, getLayoutRotateInfo, getSendSupportedCodec, detectLocator };
33
36
  export * from './type';
34
37
  export { ERROR_CODE } from './enum/errorCode';
@@ -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, IConferenceInfo, 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 } 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,8 +61,6 @@ export default class Client extends Emitter {
61
61
  private errorcode;
62
62
  private i18nCode;
63
63
  private clientErrorState;
64
- private limitResolution;
65
- private conferenceInfo;
66
64
  private customLayoutCacheList;
67
65
  private contentMode;
68
66
  private contentOnholdInfo;
@@ -74,8 +72,12 @@ export default class Client extends Emitter {
74
72
  private handStatus;
75
73
  private featureConfig;
76
74
  private meeting;
77
- private speakerInfos;
75
+ private cacheSpeakersInfo;
76
+ private speakersInfo;
78
77
  private operateQueue;
78
+ private facingMode;
79
+ private wsReConnectCount;
80
+ private localSpeakerTimer;
79
81
  private onDocumentChange;
80
82
  constructor(config: IClientConfig, logger: Logger);
81
83
  static instance: Client;
@@ -98,6 +100,7 @@ export default class Client extends Emitter {
98
100
  getFeatureConfig(): IFeatureConfig;
99
101
  getCallInfo(): ICall;
100
102
  getClientConfig(): IClientConfig;
103
+ getAutoMode(): boolean;
101
104
  getVideoManagers(): import("../type").IVideoRenders | undefined;
102
105
  getPreviewStreams(): import("../type").IGetMediaStreams | {
103
106
  previewStreams: never[];
@@ -109,7 +112,6 @@ export default class Client extends Emitter {
109
112
  total: ILayoutRoster[];
110
113
  };
111
114
  getOriginRosters(): IRoster[];
112
- getConferenceInfo(): IConferenceInfo | null;
113
115
  getInviteInfo(): IInvite;
114
116
  getContentSenderPid(): number;
115
117
  getSpeakerInfo(): ISpeakerInfo;
@@ -118,7 +120,7 @@ export default class Client extends Emitter {
118
120
  getPeerConnectionStatus(): boolean;
119
121
  getOnHold(): boolean;
120
122
  getAudioTrackList(): ICustomStreamTrack[];
121
- getLayoutList(): Map<string, ILayout> | undefined;
123
+ getLayoutMap(): Map<any, any>;
122
124
  /**
123
125
  * 获取Local roster信息
124
126
  *
@@ -131,6 +133,21 @@ export default class Client extends Emitter {
131
133
  * @returns { boolean }
132
134
  */
133
135
  getLocalShareContent(): boolean;
136
+ getFacingMode(): FacingMode;
137
+ /**
138
+ * 获取ws重连次数
139
+ */
140
+ getWsReConnectCount(): number;
141
+ /**
142
+ * 获取Layout头像配置类型
143
+ */
144
+ getLayoutAvatarType(): import("../type").LayoutAvatarType;
145
+ /**
146
+ * 企业媒体相关配置信息
147
+ *
148
+ * @returns { IMediaConfig }
149
+ */
150
+ getEnterpriseMediaConfig(): import("../type").IMediaConfig;
134
151
  /**
135
152
  * 设置本地是否在等候室
136
153
  *
@@ -154,12 +171,26 @@ export default class Client extends Emitter {
154
171
  * @return { Promise<Object> } 登录结果
155
172
  */
156
173
  loginExternalAccount(params: ILoginExtAccount): Promise<Object>;
174
+ /**
175
+ * 授权码登录
176
+ *
177
+ * @public
178
+ * @param { ILoginWidthAuthCode } params 参数
179
+ * @param {string} params.extId 企业id
180
+ * @param {string} params.extUserId 用户id
181
+ * @param {string} params.displayName 用户名称
182
+ * @param {string} params.oauthCode 授权码
183
+ * @param {boolean} params.isTempUser 是否临时账户
184
+ * @param {string} params.channelId 渠道id
185
+ * @return { Promise<Object> } 登录结果
186
+ */
187
+ loginWithAuthCode(params: ILoginWidthAuthCode): Promise<Object>;
157
188
  /**
158
189
  * 退会时 重置初始化参数
159
190
  *
160
191
  */
161
192
  resetInitParameter(): void;
162
- setContentMode(mode: IContentMode): void;
193
+ setContentMode(mode: ContentMode): void;
163
194
  /**
164
195
  * SDK功能控制开关
165
196
  *
@@ -176,15 +207,10 @@ export default class Client extends Emitter {
176
207
  * @property { boolean } config.enableSpeakerInfo 是否启用推送实时讲话人信息,每秒2条消息推送,默认不启用,设置为false;
177
208
  * @property { boolean } config.enableLayoutAvatar 是否启用获取参会者头像,默认不启用,设置为false;
178
209
  * @property { boolean } config.enableMobileNotAuth 是否启用移动端无授权入会,默认不启用,设置为false;
210
+ * @property { boolean } config.enableWatermarkContent 是否启用获取content水印内容, 默认启用, 设置为true
179
211
  * @returns { IResult }
180
212
  */
181
213
  setFeatureConfig(config: IFeatureConfig): import("../type").IReturnResult | undefined;
182
- /**
183
- * 限制Content和People发送能力
184
- *
185
- * @param { boolean } limitPeople - 是否限制People的发送能力
186
- */
187
- private setLimitResolution;
188
214
  /**
189
215
  * 获取会控地址
190
216
  */
@@ -231,6 +257,13 @@ export default class Client extends Emitter {
231
257
  * 重新播放音频
232
258
  */
233
259
  playAudio(): Promise<boolean>;
260
+ /**
261
+ * 设置相机方向
262
+ *
263
+ * @param { IFacingMode } position 相机方向
264
+ * @returns { Promise<IFacingMode> } 最终切换的相机方向
265
+ */
266
+ switchCamera(facingMode?: IFacingMode): Promise<IFacingMode>;
234
267
  /**
235
268
  * 绑定streamId和audio ele元素,内部维护状态
236
269
  *
@@ -415,7 +448,7 @@ export default class Client extends Emitter {
415
448
  * @public
416
449
  * @param { Stream } stream 本地contentStream
417
450
  */
418
- sendContentCapabilityMessage(stream?: Stream): void;
451
+ sendContentCapability(): void;
419
452
  /**
420
453
  * 分享content
421
454
  *
@@ -441,7 +474,7 @@ export default class Client extends Emitter {
441
474
  */
442
475
  private handleContentOnholdAudio;
443
476
  /**
444
- * 合并track
477
+ * 合并tTrack
445
478
  *
446
479
  * @param { RTCTrackEvent } e
447
480
  */
@@ -480,36 +513,52 @@ export default class Client extends Emitter {
480
513
  */
481
514
  private getCodeByJson;
482
515
  /**
483
- * 音视频开启关闭操作
516
+ * 音视频开启/关闭操作
484
517
  *
485
518
  * @private
486
- * @param { 'muteAudio' | 'muteVideo' | 'unmuteAudio' | 'unmuteVideo' } type 操作类型
519
+ * @param { OperateType } type 操作类型
487
520
  * @returns Promise<IVideoAudioType> 类型
488
521
  */
489
- private videoAudioOperate;
522
+ private operateVideoAudio;
523
+ /**
524
+ * 操作Stream中的音视频流
525
+ *
526
+ * @param { OperateType } type - 操作类型
527
+ */
528
+ private operateStreamStatus;
490
529
  /**
491
- * 静音 操作
530
+ * 清除Local Speaker Timer
531
+ */
532
+ private clearSpeakerTimer;
533
+ /**
534
+ * 推流到PeerConnection上
535
+ *
536
+ * @param pushType
537
+ */
538
+ peerPublish(pushType: PushType): void;
539
+ /**
540
+ * 关闭麦克风
492
541
  *
493
542
  * @public
494
543
  * @returns { Promise<IVideoAudioType> } 操作类型
495
544
  */
496
545
  muteAudio(): Promise<IVideoAudioType>;
497
546
  /**
498
- * 关闭摄像头 操作
547
+ * 关闭摄像头
499
548
  *
500
549
  * @public
501
550
  * @returns { Promise<IVideoAudioType> } 操作类型
502
551
  */
503
552
  muteVideo(): Promise<IVideoAudioType>;
504
553
  /**
505
- * 开启摄像头 操作
554
+ * 开启麦克风
506
555
  *
507
556
  * @public
508
557
  * @returns { Promise<IVideoAudioType> } 操作类型
509
558
  */
510
559
  unmuteAudio(): Promise<IVideoAudioType>;
511
560
  /**
512
- * 取消静音 操作
561
+ * 开启摄像头
513
562
  *
514
563
  * @public
515
564
  * @returns { Promise<IVideoAudioType> } 操作类型
@@ -574,18 +623,15 @@ export default class Client extends Emitter {
574
623
  */
575
624
  setPeerConnectionStatus(status: boolean): void;
576
625
  /**
577
- * 处理会议室静音状态
578
- *
579
- * @param { string } automute // "" | "mute" | "forcemute" 会议室静音属性
626
+ * 发送带宽配置
580
627
  */
581
- private handleAutoMute;
628
+ private sendWebRxBandwidth;
582
629
  /**
583
- * 根据 autoMute 或 muteOperation 的值发送音频流
630
+ * 处理会议室静音状态
584
631
  *
585
- * @private
586
- * @param { string } audioMute 是否静音
632
+ * @param { string } automute - "" | "mute" | "forcemute" 会议室静音属性
587
633
  */
588
- private onSetAudioStream;
634
+ private handleAutoMute;
589
635
  /**
590
636
  * 处理会控消息,如音频、主会场、content等
591
637
  *
@@ -623,6 +669,12 @@ export default class Client extends Emitter {
623
669
  * @private
624
670
  */
625
671
  private onSpeakerInfoMessage;
672
+ /**
673
+ * 推送实时讲话人信息
674
+ *
675
+ * @param { SpeakersInfoObj[] } speakersInfo - 说话人信息
676
+ */
677
+ private emitSpeakersInfo;
626
678
  /**
627
679
  * 处理contentOnhold
628
680
  *
@@ -695,27 +747,18 @@ export default class Client extends Emitter {
695
747
  * @returns { Promise<boolean> } 是否请求成功
696
748
  */
697
749
  requestAutoPollingLayout(command: TCommand, interval: number | undefined, reqList: IReqInfo[]): Promise<boolean>;
698
- /**
699
- * 应用替换已经更新的的people video track轨道流,如果之前无流,则需重新setStream, replaceTrack
700
- * 第一次开启音频、或视频,需重新协商offer。改变通道方向
701
- *
702
- * @public
703
- * @param { 'video' | 'audio' } kind 设备类型
704
- * @param { boolean } isFirst 是否之前无流
705
- */
706
- applyVideoOrAudio(kind: 'video' | 'audio', isFirst?: boolean): void;
707
750
  /**
708
751
  * 推送本地Audio状态
709
752
  *
710
753
  * @param { boolean | string } status
711
754
  */
712
- sendAudioStatus(status: boolean | string): void;
755
+ emitAudioStatus(type: OperateType): void;
713
756
  /**
714
757
  * 推送本地Video状态
715
758
  *
716
- * @param { boolean | string } status
759
+ * @param { OperateType } type - 操作类型
717
760
  */
718
- sendVideoStatus(status: boolean | string): void;
761
+ emitVideoStatus(type: OperateType): void;
719
762
  /**
720
763
  * 发布 自动布局/自定义布局 layout布局信息(参会人最新的布局列表数据)
721
764
  *
@@ -756,13 +799,6 @@ export default class Client extends Emitter {
756
799
  * @param { IMode } templateMode 布局模式
757
800
  */
758
801
  sendTemplateMode(templateMode: IMode): void;
759
- /**
760
- * ws 发送摄像头、麦克风开启关闭操作
761
- *
762
- * @private
763
- * @param { IVideoAudioMessageType } type 操作类型
764
- */
765
- private sendOperationMessage;
766
802
  /**
767
803
  * 处理旋转信息
768
804
  *
@@ -780,23 +816,23 @@ export default class Client extends Emitter {
780
816
  * 上报会议质量数据
781
817
  *
782
818
  * @public
783
- * @param { IInternels } internels Internels统计数据
819
+ * @param { IInternals } internals Internals统计数据
784
820
  */
785
- reportQualityData(internels: IInternels): void;
821
+ reportQualityData(internals: IInternals): void;
786
822
  /**
787
- * Internels统计数据-期望带宽
823
+ * Internals统计数据-期望带宽
788
824
  *
789
- * @param internels
825
+ * @param internals
790
826
  * @returns
791
827
  */
792
- private getInternels;
828
+ private getNewInternals;
793
829
  /**
794
- * 发布Internels统计数据
830
+ * 上报给业务层Internals统计数据
795
831
  *
796
832
  * @public
797
- * @param { IInternels } internels Internels统计数据
833
+ * @param { IInternals } internals Internals统计数据
798
834
  */
799
- sendInternels(internels: IInternels): void;
835
+ sendInternals(internals: IInternals): void;
800
836
  /**
801
837
  * 取消监听事件
802
838
  *
@@ -823,7 +859,7 @@ export default class Client extends Emitter {
823
859
  */
824
860
  private removeWindowResizeEvent;
825
861
  /**
826
- * 发送wss peopleCapability,通知本地采集能力,用于vom进行分配
862
+ * 通知本地采集能力,用于vom进行分配
827
863
  *
828
864
  * @public
829
865
  */
@@ -927,18 +963,6 @@ export default class Client extends Emitter {
927
963
  * @public
928
964
  */
929
965
  stopCloudRecord(): Promise<undefined>;
930
- /**
931
- * 配置web节点接收带宽
932
- *
933
- * @public
934
- */
935
- setWebRxBandwidth(): Promise<undefined>;
936
- /**
937
- * 重新发送content offer
938
- *
939
- * @public
940
- */
941
- reSendContentOffer(): void;
942
966
  /**
943
967
  * 重新计算Layout布局数据
944
968
  *
@@ -985,6 +1009,12 @@ export default class Client extends Emitter {
985
1009
  * @returns { boolean }
986
1010
  */
987
1011
  private setMonitorGroup;
1012
+ /**
1013
+ * 校验clientId/clientSecret
1014
+ *
1015
+ * @returns
1016
+ */
1017
+ private verifyParameter;
988
1018
  /**
989
1019
  * 初始化DeviceManager事件
990
1020
  *
@@ -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,7 +2,7 @@
2
2
  * 登录模块
3
3
  *
4
4
  */
5
- import { ILoginExtAccount, ISdkUserInfo, ILoginInfo } from '../type';
5
+ import { ILoginExtAccount, ISdkUserInfo, ILoginInfo, ILoginWidthAuthCode } from '../type';
6
6
  import Logger from '../tools/logger';
7
7
  declare class IAuth {
8
8
  private logger;
@@ -25,5 +25,18 @@ declare class IAuth {
25
25
  * @param { ILoginExtAccount } params
26
26
  */
27
27
  login(sdkUserInfo: ISdkUserInfo, params?: ILoginExtAccount): Promise<import("../type").IReturnResult>;
28
+ /**
29
+ * 授权码登录
30
+ *
31
+ * @param { ILoginWidthAuthCode } params 参数
32
+ * @param {string} params.extID 企业id
33
+ * @param {string} params.extUserId 用户id
34
+ * @param {string} params.displayName 用户名称
35
+ * @param {string} params.oauthCode 授权码
36
+ * @param {boolean} params.isTempUser 是否临时账户
37
+ * @param {string} params.channelId 渠道id
38
+ * @return {*}
39
+ */
40
+ loginWithAuthCode(params: ILoginWidthAuthCode): Promise<import("../type").IReturnResult>;
28
41
  }
29
42
  export default IAuth;