@xylink/xy-rtc-sdk 3.10.0-beta.4 → 100.0.0-beta.44

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 (116) hide show
  1. package/README.MD +30 -12
  2. package/build.config.json +10 -0
  3. package/lib/action/index.d.ts +57 -45
  4. package/lib/enum/analyser.d.ts +7 -0
  5. package/lib/enum/client.d.ts +8 -2
  6. package/lib/enum/constraints.d.ts +11 -16
  7. package/lib/enum/device.d.ts +0 -6
  8. package/lib/enum/errorCode.d.ts +5 -2
  9. package/lib/enum/index.d.ts +43 -5
  10. package/lib/enum/polling.d.ts +2 -0
  11. package/lib/feature/customMessage/index.d.ts +29 -0
  12. package/lib/feature/edu/index.d.ts +34 -0
  13. package/lib/feature/edu/index.type.d.ts +29 -0
  14. package/lib/feature/index.d.ts +3 -1
  15. package/lib/feature/{speaker.d.ts → speaker/index.d.ts} +29 -9
  16. package/lib/feature/speaker/index.type.d.ts +17 -0
  17. package/lib/index.d.ts +65 -28
  18. package/lib/interface/baseModule.type.d.ts +9 -0
  19. package/lib/interface/clientInterface.type.d.ts +83 -0
  20. package/lib/interface/contentTrackInterface.type.d.ts +15 -0
  21. package/lib/interface/event.type.d.ts +316 -0
  22. package/lib/interface/peopleTrackInterface.type.d.ts +17 -0
  23. package/lib/main/ability/const.d.ts +4 -1
  24. package/lib/main/ability/index.d.ts +7 -1
  25. package/lib/main/{auth.d.ts → auth/index.d.ts} +29 -19
  26. package/lib/main/client.d.ts +365 -595
  27. package/lib/main/clientBase.d.ts +38 -0
  28. package/lib/main/clientState.d.ts +56 -0
  29. package/lib/main/{deviceManager.d.ts → device/index.d.ts} +45 -13
  30. package/lib/{type/device.d.ts → main/device/index.type.d.ts} +65 -16
  31. package/lib/main/helper/index.d.ts +120 -0
  32. package/lib/main/layout/index.d.ts +118 -105
  33. package/lib/main/layout/index.type.d.ts +270 -0
  34. package/lib/main/layout/polling.d.ts +212 -0
  35. package/lib/main/layout/state.d.ts +163 -0
  36. package/lib/main/layout/template.d.ts +15 -7
  37. package/lib/main/media/index.d.ts +177 -0
  38. package/lib/main/media/index.type.d.ts +9 -0
  39. package/lib/main/meeting/control.d.ts +107 -0
  40. package/lib/main/meeting/control.type.d.ts +24 -0
  41. package/lib/main/{meeting.d.ts → meeting/index.d.ts} +46 -7
  42. package/lib/main/meeting/verify.d.ts +69 -0
  43. package/lib/main/peer.d.ts +120 -41
  44. package/lib/main/plugin/index.d.ts +28 -0
  45. package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
  46. package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
  47. package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
  48. package/lib/main/render/index.d.ts +116 -0
  49. package/lib/main/render/index.type.d.ts +24 -0
  50. package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
  51. package/lib/main/render/videoManager.type.d.ts +66 -0
  52. package/lib/main/roster/index.d.ts +39 -0
  53. package/lib/main/server/index.d.ts +79 -0
  54. package/lib/main/server/index.type.d.ts +21 -0
  55. package/lib/main/signal/index.d.ts +15 -0
  56. package/lib/main/socket/index.d.ts +95 -0
  57. package/lib/main/stream/index.d.ts +182 -0
  58. package/lib/main/track/baseTrack.d.ts +178 -0
  59. package/lib/main/track/contentTrack.d.ts +161 -0
  60. package/lib/main/track/customContentTrack.d.ts +18 -0
  61. package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
  62. package/lib/main/track/helper.d.ts +53 -0
  63. package/lib/main/track/videoAudioCapture.d.ts +90 -0
  64. package/lib/main/track/videoAudioTrack.d.ts +243 -0
  65. package/lib/main/vom/index.d.ts +44 -0
  66. package/lib/main/vom/index.type.d.ts +1 -0
  67. package/lib/tools/analyser.d.ts +30 -7
  68. package/lib/tools/analyserManager.d.ts +55 -0
  69. package/lib/tools/dbManager.d.ts +12 -1
  70. package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
  71. package/lib/tools/detectStream/index.d.ts +84 -0
  72. package/lib/tools/detectStream/index.type.d.ts +56 -0
  73. package/lib/tools/detectTool/index.d.ts +191 -0
  74. package/lib/tools/detectTool/index.type.d.ts +62 -0
  75. package/lib/tools/emitter.d.ts +27 -6
  76. package/lib/tools/enum.d.ts +1 -1
  77. package/lib/tools/httpClient.d.ts +5 -1
  78. package/lib/tools/i18n.d.ts +1 -1
  79. package/lib/tools/index.d.ts +1 -8
  80. package/lib/tools/log/logger.d.ts +41 -21
  81. package/lib/tools/log/logger.worker.d.ts +1 -1
  82. package/lib/tools/log/loggerManager.d.ts +2 -2
  83. package/lib/tools/pressure/index.d.ts +33 -0
  84. package/lib/tools/pressure/index.type.d.ts +22 -0
  85. package/lib/tools/promiseQueue.d.ts +6 -0
  86. package/lib/tools/regex.d.ts +4 -0
  87. package/lib/tools/snapshot.d.ts +1 -1
  88. package/lib/tools/socket.d.ts +12 -2
  89. package/lib/tools/template/index.d.ts +11 -88
  90. package/lib/tools/template/mobile.d.ts +1 -1
  91. package/lib/tools/template/polling.d.ts +8 -0
  92. package/lib/tools/utils.d.ts +25 -16
  93. package/lib/tools/verify.d.ts +7 -0
  94. package/lib/type/ability.d.ts +1 -1
  95. package/lib/type/analyser.d.ts +26 -1
  96. package/lib/type/auth.d.ts +19 -19
  97. package/lib/type/base.d.ts +27 -31
  98. package/lib/type/capture.d.ts +9 -0
  99. package/lib/type/client.d.ts +178 -333
  100. package/lib/type/index.d.ts +22 -2
  101. package/lib/type/layout.d.ts +81 -45
  102. package/lib/type/logger.d.ts +19 -12
  103. package/lib/type/meeting.d.ts +101 -56
  104. package/lib/type/peer.d.ts +65 -1
  105. package/lib/type/polling.d.ts +194 -0
  106. package/lib/type/quality.d.ts +12 -2
  107. package/lib/type/socket.d.ts +0 -18
  108. package/lib/type/stream.d.ts +42 -24
  109. package/lib/type/track.d.ts +131 -0
  110. package/lib/xyrtc.cjs.js +1 -1
  111. package/lib/xyrtc.umd.js +1 -1
  112. package/package.json +32 -52
  113. package/lib/main/clientImplements.d.ts +0 -99
  114. package/lib/main/helper.d.ts +0 -104
  115. package/lib/main/stream.d.ts +0 -418
  116. package/lib/tools/detect.d.ts +0 -44
package/README.MD CHANGED
@@ -2,37 +2,55 @@
2
2
 
3
3
  ## 介绍
4
4
 
5
- XY RTC Web SDK 是小鱼易连音视频通讯解决方案的Web端SDK,它是通过 HTML 网页加载的 JavaScript 库,采用 WebRTC 技术,开发者可以使用 XY RTC Web SDK 提供的 API 建立连接,控制实时多人音视频通话。
5
+ XY RTC Web SDK 是小鱼易连音视频通讯解决方案的 Web 端 SDK,它是通过 HTML 网页加载的 JavaScript 库,采用 WebRTC 技术,开发者可以使用 XY RTC Web SDK 提供的 API 建立连接,控制实时多人音视频通话。
6
6
 
7
- 目前 XY RTC Web SDK 主要支持 Chrome v72+ 和 Edge v80+ 浏览器。
8
7
  ## 安装
9
- ``` bash
8
+
9
+ ```bash
10
10
  # 通过 Yarn 安装
11
- $ yarn add @xylink/xy-rtc-sdk
11
+ $ yarn add @xylink/xy-rtc-sdk -S
12
12
 
13
13
  # 通过 Npm 安装
14
- $ npm install @xylink/xy-rtc-sdk --save
14
+ $ npm install @xylink/xy-rtc-sdk -S
15
15
  ```
16
+
16
17
  ## 示例
17
18
 
18
19
  > **注意**:请务必使用 HTTPS 协议或者 localhost 开发、测试,否则无法正常使用 XY RTC SDK 进行加入会议操作;
19
20
 
21
+ ```js
22
+ import XYRTC from '@xylink/xy-rtc-sdk';
20
23
 
21
- ```bash
22
- import xyRTC from "@xylink/xy-rtc-sdk";
24
+ // 创建Client和Stream模块
25
+ const { client, stream } = XYRTC.createClient({});
26
+
27
+ // 监听事件
28
+ client.on('call-status', () => {});
23
29
 
24
- const client = xyRTC.createClient();
30
+ // 登录
31
+ const result = client.loginExternalAccount({});
32
+
33
+ // 呼叫会议
34
+ client.makeCall({ confNumber: '', displayName: '' });
35
+
36
+ // 创建Video和Audio流
37
+ const videoAudioTrack = await stream.createVideoAudioTrack({});
38
+
39
+ // 推送流
40
+ client.publish(videoAudioTrack);
25
41
  ```
26
42
 
43
+ 详细集成流程参考[详细 API 文档](https://openapi.xylink.com/common/meeting/api/description?platform=web)完成音视频通话。
27
44
 
28
- 具体可参考[详细API文档](https://openapi.xylink.com/common/meeting/api/description?platform=web)完成音视频通话。
29
45
  ## 开源示例项目
30
- 我们在 GitHub 上提供了开源的示例项目供你参考。
46
+
47
+ 我们在 GitHub 上提供了开源的示例项目供你参考:
31
48
 
32
49
  - Vue 版本:https://github.com/xylink-com/xylink-rtc-vue-demo
33
50
  - React 版本:https://github.com/xylink-com/xylink-rtc-demo
34
51
 
52
+ 如果你是第一次集成 XY RTC SDK 产品,你可以使用我们基于 SDK 实现的产品进行体验:[小鱼 Web 会议](https://cdn.xylink.com/webrtc/web/index.html#/)。 我们会将 SDK 的最新功能在小鱼 Web 会议上进行集成展示出来,方便作为一种参考方式。
35
53
 
36
- 如果你是第一次集成 XY RTC SDK 产品,你可以使用我们基于 SDK 实现的产品进行体验:[小鱼 Web 会议](https://cdn.xylink.com/webrtc/web/index.html#/)。 我们会将 SDK 的最新功能在小鱼 Web 会议上进行集成展示出来,方便作为你的一种参考方式。
37
54
  ## 版本更新内容
38
- 具体可查看[发版说明文档](https://openapi.xylink.com/common/meeting/doc/version?platform=web)。
55
+
56
+ 具体可查看[发版说明文档](https://openapi.xylink.com/common/meeting/doc/version?platform=web)。
@@ -0,0 +1,10 @@
1
+ {
2
+ "buildScript": "build:sdk",
3
+ "packager": "pnpm",
4
+ "mirrorMap": {
5
+ "XYLink": "https://fe-private-npm.xylink.com/"
6
+ },
7
+ "projectName": "XYLink WebRTC SDK",
8
+ "commitMessage": "feat: Publish Release Version:",
9
+ "commitMessageAfter": "[#000000]"
10
+ }
@@ -1,7 +1,8 @@
1
- import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams, IMeetingInviteParams, IMediaConfigParam, LoginType, LoginParams, SignInTextParams } from '../type';
1
+ import { ILoginExtAccount, ISdkUserInfo, IMeetingInfo, IToken, IMeetingInviteParams, IMediaConfigParam, LoginType, LoginParams, SignInTextParams, FocusViewAction, IStateParams, ILoginWidthAuthCode, AutoMute } from '../type/index';
2
2
  import Logger from '../tools/log/logger';
3
3
  export interface ICommonParams {
4
4
  securityKey: string;
5
+ callUri?: string;
5
6
  }
6
7
  declare class Action {
7
8
  private logger;
@@ -50,13 +51,6 @@ declare class Action {
50
51
  * @param { IToken | null } tokenInfo - token信息
51
52
  */
52
53
  setTokenInfo(tokenInfo: IToken | null): void;
53
- /**
54
- * 设置默认参数
55
- *
56
- * @param { ICommonParams } data - 参数
57
- * @property { string } data.securityKey - securityKey
58
- */
59
- setCommonParams(data: ICommonParams): void;
60
54
  /**
61
55
  * 日志上传
62
56
  *
@@ -85,8 +79,8 @@ declare class Action {
85
79
  /**
86
80
  * 根据Token获取用户信息
87
81
  *
88
- * @param { string } token
89
- * @returns
82
+ * @param { string } token - token信息
83
+ * @returns { Object } - 用户信息
90
84
  */
91
85
  getUserInfo(token: string): Promise<any>;
92
86
  /**
@@ -152,16 +146,19 @@ declare class Action {
152
146
  * @param { IGetConferenceParams } params
153
147
  * @returns
154
148
  */
155
- getConference(userProfileId: number, securityKey: string, params: IGetConferenceParams): Promise<any>;
149
+ getConference(userProfileId: number, securityKey: string, params: {
150
+ autoMute: AutoMute;
151
+ }): Promise<any>;
156
152
  /**
157
153
  * 功能操作上报记录
158
154
  *
159
155
  * @private
160
- * @param { TCategory } category - 事件类别
161
- * @param { TEventName } eventName - 事件名称
162
- * @param { Objet } params - 事件详细数据
156
+ * @param { IStateParams | IStateParams[] } state
157
+ * @property { TCategory } category - 事件类别
158
+ * @property { TEventName } eventName - 事件名称
159
+ * @property { Objet } params - 事件详细数据
163
160
  */
164
- setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
161
+ setStates(state: IStateParams | IStateParams[]): Promise<void>;
165
162
  /**
166
163
  * 监课模式不需要入会密码
167
164
  *
@@ -174,10 +171,11 @@ declare class Action {
174
171
  *
175
172
  * @param { number } userId 用户ID
176
173
  * @param { string } server 服务端地址
177
- * @param { boolean } isSupportHybridCloud 是否支持混合云
174
+ * @param { string } enterpriseId 企业ID
175
+ * @param { boolean } sign 是否签名
178
176
  * @returns
179
177
  */
180
- getAllocation(userId: number, server: string, isSupportHybridCloud?: boolean): Promise<any>;
178
+ getAllocation(userId: number, server: string, enterpriseId: string, sign?: boolean): Promise<any>;
181
179
  /**
182
180
  * 获取会议室水印
183
181
  *
@@ -197,12 +195,7 @@ declare class Action {
197
195
  * @param { string } params.httpServer 服务器地址
198
196
  * @returns
199
197
  */
200
- getEnterpriseId({ extId, clientId, clientSecret, httpServer }: {
201
- extId: string;
202
- clientId: string;
203
- clientSecret: string;
204
- httpServer?: string;
205
- }): Promise<any>;
198
+ getEnterpriseId(extId: string): Promise<any>;
206
199
  /**
207
200
  * WebRTC 内外网探测
208
201
  *
@@ -213,12 +206,7 @@ declare class Action {
213
206
  * @param { string } params.httpServer 服务器地址
214
207
  * @returns
215
208
  */
216
- locator({ extId, clientId, clientSecret, httpServer }: {
217
- extId: string;
218
- clientId: string;
219
- clientSecret: string;
220
- httpServer?: string;
221
- }): Promise<any>;
209
+ locator(enterpriseId: string): Promise<any>;
222
210
  /**
223
211
  * 监会操作
224
212
  *
@@ -268,6 +256,9 @@ declare class Action {
268
256
  /**
269
257
  * 获取企业相关配置(buffet), 包含头像配置、禁用语音转写英文翻译
270
258
  *
259
+ * 内部企业ID的话,uaa-api会在转发请求时,放在请求头带给后端服务。
260
+ * 服务端需要兼容下取参数的位置,如果他们之前的位置取不到内部企业ID,就从header头上的特定字段去取。
261
+ *
271
262
  * @param { number } userId 用户ID
272
263
  * @returns
273
264
  */
@@ -278,7 +269,7 @@ declare class Action {
278
269
  * @param { string } refresh_token 待刷新的token
279
270
  * @returns
280
271
  */
281
- refreshToken(refresh_token: string): Promise<any>;
272
+ refreshToken(refresh_token?: string): Promise<any>;
282
273
  /**
283
274
  * 获取会议邀请链接信息
284
275
  *
@@ -346,25 +337,12 @@ declare class Action {
346
337
  */
347
338
  getSignInText({ type, environment, businessType }: SignInTextParams): Promise<any>;
348
339
  /**
349
- * 授权码登录
340
+ * 授权码登录(建行)
350
341
  *
351
342
  * @param { ILoginWidthAuthCode } params 参数
352
- * @param {string} params.extID 企业id
353
- * @param {string} params.extUserId 用户id
354
- * @param {string} params.displayName 用户名称
355
- * @param {string} params.oauthCode 授权码
356
- * @param {boolean} params.isTempUser 是否临时账户
357
- * @param {string} params.channelId 渠道id
358
343
  * @returns
359
344
  */
360
- loginWithAuthCode({ extId, extUserId, displayName, oauthCode, isTempUser, channelId }: {
361
- extId: string;
362
- extUserId: string;
363
- channelId: string;
364
- displayName: string;
365
- oauthCode: string;
366
- isTempUser: boolean;
367
- }): Promise<any>;
345
+ loginWithAuthCode({ extId, extUserId, displayName, oauthCode, isTempUser, channelId }: ILoginWidthAuthCode): Promise<any>;
368
346
  /**
369
347
  * 三方用户统一认证登录
370
348
  *
@@ -373,6 +351,21 @@ declare class Action {
373
351
  * @returns
374
352
  */
375
353
  loginWithUnified(loginType: LoginType, data: LoginParams): Promise<any>;
354
+ /**
355
+ * 会控设置焦点画面
356
+ *
357
+ * @param { string } deviceUri - 焦点画面终端callUri
358
+ * @param { FocusViewAction} action - 设置焦点画面/取消焦点画面
359
+ * @returns
360
+ */
361
+ setMeetingFocusView(deviceUri: string, action: FocusViewAction): Promise<any>;
362
+ /**
363
+ * 通过会控修改名称
364
+ *
365
+ * @param { string } newName - 新名称
366
+ * @returns
367
+ */
368
+ rename(newName: string): Promise<any>;
376
369
  /**
377
370
  * 获取能力集
378
371
  *
@@ -381,6 +374,13 @@ declare class Action {
381
374
  */
382
375
  getAbility(localAbilities?: number[]): Promise<any>;
383
376
  endAllMeeting(): Promise<any>;
377
+ /**
378
+ * 设置默认参数,如securityKey
379
+ *
380
+ * @param { number[] } localAbilities - 终端能力集
381
+ * @returns { number[] } abilityList - 服务端能力集
382
+ */
383
+ setCommonParams(data: Record<string, any>): void;
384
384
  /**
385
385
  * 获取公钥,加密登录需使用此公钥
386
386
  *
@@ -395,5 +395,17 @@ declare class Action {
395
395
  * @returns
396
396
  */
397
397
  private customLogin;
398
+ /**
399
+ * 加密密码
400
+ */
401
+ private encryptPassword;
402
+ /**
403
+ * 获取加密密码, 如何base64后不是128的倍数
404
+ *
405
+ * @param { string } pubKey - 秘钥
406
+ * @param { string } password - 待加密的密码
407
+ * @param { string } isSha512 - 是否经过sha512处理
408
+ */
409
+ private getEncryptPwd;
398
410
  }
399
411
  export default Action;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 执行快速傅里叶变换 (FFT) 以获得频域数据时使用的样本窗口大小, 可选值:32/64/125/256/512/1024/2048
3
+ */
4
+ export declare const FFT_SIZE: {
5
+ DEFAULT: number;
6
+ LOCAL: number;
7
+ };
@@ -2,9 +2,9 @@
2
2
  * XYLink 入口配置
3
3
  *
4
4
  * Created at : 2023-04-26 15:28:46
5
- * Last modified : 2023-11-10 16:18:44
5
+ * Last modified : 2024-04-23 19:16:27
6
6
  */
7
- import { IClientConfig } from '../type';
7
+ import { IClientConfig } from '../type/index';
8
8
  export declare const DEFAULT_LOG_STYLE = "color: #3876ff;";
9
9
  export declare const DEFAULT_LINE = "*********************************************************";
10
10
  /**
@@ -13,3 +13,9 @@ export declare const DEFAULT_LINE = "*******************************************
13
13
  export declare const DEFAULT_CLIENT_CONFIG: IClientConfig;
14
14
  export declare const XYLink_LOG: string;
15
15
  export declare const XYLINK_LOG_AGENT: string;
16
+ export declare const XY_DEFAULT_LOGGER_CONFIG: {
17
+ dbName: string;
18
+ tableName: string;
19
+ dbVersion: number;
20
+ tableCount: number;
21
+ };
@@ -2,27 +2,17 @@
2
2
  * WebRTC SDK视频流采集约束配置
3
3
  *
4
4
  * Created at : 2023-10-11 11:19:12
5
- * Last modified : 2023-11-10 17:46:57
5
+ * Last modified : 2024-05-14 11:14:07
6
6
  */
7
- import { I_CONTENT_CONSTRAINTS, I_PEOPLE_CONSTRAINTS, IConstraintsConfigMap, IStreamConfig } from '../type';
7
+ import { XYContentConfig, XYPeopleConfig, StreamResolution, ConstraintMode, StreamFrameRate } from '../type/index';
8
8
  /**
9
9
  * people基础约束配置
10
- *
11
- *
12
- */
13
- export declare const BASE_PEOPLE_CONSTRAINTS: I_PEOPLE_CONSTRAINTS;
14
- /**
15
- * people特殊约束配置
16
- *
17
- * @param { IStreamConfig } streamConfig - 自定义流数据
18
- * @param { boolean } streamConfig.enableAspectRatio - 采集时是否支持设置视频流的宽高比, 默认支持
19
- * @returns
20
10
  */
21
- export declare const SPECIAL_PEOPLE_CONSTRAINTS: (streamConfig: IStreamConfig) => I_PEOPLE_CONSTRAINTS;
11
+ export declare const BASE_PEOPLE_CONSTRAINTS: XYPeopleConfig;
22
12
  /**
23
13
  * content采集基础约束配置
24
14
  */
25
- export declare const BASE_CONTENT_CONSTRAINTS: I_CONTENT_CONSTRAINTS;
15
+ export declare const BASE_CONTENT_CONSTRAINTS: XYContentConfig;
26
16
  /**
27
17
  * people采集音频基础约束配置
28
18
  */
@@ -37,15 +27,20 @@ export declare const BASE_PEOPLE_AUDIO_CONSTRAINTS: {
37
27
  *
38
28
  * COMMON: 普通模式
39
29
  * ADVANCED: 高级模式, 帧率、宽、高 可进行最大、最小、期望设置
30
+ *
31
+ * @param { StreamResolution } resolution - 分辨率
32
+ * @param { StreamFrameRate } frameRate - 帧率
33
+ * @param { ConstraintMode } constraintMode - 模式
40
34
  */
41
- export declare const CONTENT_CONSTRAINTS: IConstraintsConfigMap;
35
+ export declare const GET_CONTENT_CONSTRAINTS: (resolution: StreamResolution, frameRate: StreamFrameRate, constraintMode: ConstraintMode) => any;
42
36
  /**
43
37
  * people 180P 360P 720P 采集配置信息
44
38
  *
45
39
  * common: 普通模式
46
40
  * advanced: 高级模式, 帧率、宽、高 可进行最大、最小、期望设置
41
+ * 特殊说明:180P采集默认配置15帧率,无法增加,其他支持基于Config配置形式采集
47
42
  */
48
- export declare const PEOPLE_CONSTRAINTS: IConstraintsConfigMap;
43
+ export declare const GET_PEOPLE_CONSTRAINTS: (resolution: StreamResolution, frameRate: StreamFrameRate, constraintMode: ConstraintMode) => any;
49
44
  /**
50
45
  * 分辨率枚举,将分辨率转换为0-6的索引值
51
46
  */
@@ -1,9 +1,3 @@
1
- /**
2
- * 参会设备类型枚举
3
- *
4
- * Created at : 2023-10-11 11:18:34
5
- * Last modified : 2023-11-09 10:01:03
6
- */
7
1
  export declare const DEVICE_TYPE_MAP: {
8
2
  [key: string]: string;
9
3
  };
@@ -2,12 +2,15 @@
2
2
  * WebRTC SDK 统一错误码集合
3
3
  *
4
4
  * Created at : 2023-10-11 11:18:07
5
- * Last modified : 2023-11-03 11:24:20
5
+ * Last modified : 2024-05-31 14:05:56
6
6
  */
7
- import { TLocale } from '../type';
7
+ import { TLocale } from '../type/index';
8
8
  export declare const SERVER_ERROR_CODE_MAP: {
9
9
  [key: number | string]: string;
10
10
  };
11
+ export declare const UPDATE_NAME_ERROR_CODE: {
12
+ [key: number]: string;
13
+ };
11
14
  /**
12
15
  * 代码错误提示
13
16
  */
@@ -4,8 +4,9 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-30 14:12:52
6
6
  */
7
- import { IDefault, IOPERATE_MAP, IRoster, IFeatureConfig, StreamStatus, StreamType, ILoggerConfig, FacingMode, StreamResolution, TemplateMode, ContentTemplateMode, IMediaConfig, IMackCall } from '../type';
7
+ import { IDefault, IOPERATE_MAP, IRoster, IFeatureConfig, StreamStatus, StreamType, ILoggerConfig, FacingMode, StreamResolution, TemplateMode, ContentTemplateMode, LayoutConfig, IMediaConfig, IMackCall, ContentTrackConfig, PeopleTrackConfig, SwitchDeviceConfig, DEVICE_KIND } from '../type/index';
8
8
  export * from './constraints';
9
+ export * from './analyser';
9
10
  export declare const LOG_CACHE_COUNT = 10;
10
11
  export declare const DB_TABLE_COUNT = 10;
11
12
  export declare const DETECT_LOCATOR_SERVER_NAME = "WebrtcSigGW";
@@ -164,7 +165,7 @@ export declare const DEF_TABLE_INDEX = 1;
164
165
  /**
165
166
  * 需要过滤的最小声量数据
166
167
  */
167
- export declare const MIN_AUDIO_LEVEL = 4;
168
+ export declare const MIN_AUDIO_LEVEL = 9;
168
169
  /**
169
170
  * 声量设备缓存时间
170
171
  */
@@ -212,14 +213,28 @@ export declare const MEETING_CONTROL_PLATFORM: {
212
213
  SIDE: string;
213
214
  PROFESSIONAL: string;
214
215
  };
216
+ export declare const LOCAL_SHARED_MAX_VIEW_COUNT = 4;
215
217
  /**
216
- * Content的分组ID
218
+ * 布局相关配置
217
219
  */
218
- export declare const CONTENT_MEDIAGROUP_ID = "1";
220
+ export declare const DEFAULT_LAYOUT_CONFIG: LayoutConfig;
221
+ /**
222
+ * Web支持的轮询画面
223
+ */
224
+ export declare const MULTI_IMAGE: string[];
219
225
  /**
220
226
  * 高分辨率配置
221
227
  */
222
228
  export declare const HIGH_RESOLUTION = StreamResolution.RS1080;
229
+ /**
230
+ * 低分辨率配置
231
+ */
232
+ export declare const LM_CONFIG: {
233
+ peopleRecResolution: StreamResolution;
234
+ peopleSendResolution: StreamResolution;
235
+ contentRecResolution: StreamResolution;
236
+ contentSendResolution: StreamResolution;
237
+ };
223
238
  /**
224
239
  * 流畅模式下视频发送和接收配置
225
240
  *
@@ -250,6 +265,29 @@ export declare const NM_CONFIG: {
250
265
  */
251
266
  export declare const DEFAULT_MEDIA_CONFIG: IMediaConfig;
252
267
  /**
253
- * makeCall呼叫默认参数
268
+ * 默认MakeCall参数
254
269
  */
255
270
  export declare const DEFAULT_MAKE_CALL_PARAMS: IMackCall;
271
+ /**
272
+ * 默认People Track配置
273
+ */
274
+ export declare const DEFAULT_INIT_TRACK_CONFIG: PeopleTrackConfig;
275
+ /**
276
+ * 默认Content Track配置
277
+ */
278
+ export declare const DEFAULT_CONTENT_TRACK_CONFIG: ContentTrackConfig;
279
+ /**
280
+ * 默认约束配置
281
+ */
282
+ export declare const BASE_SUPPORTS_CONSTRAINTS: any;
283
+ /**
284
+ * 切换设备,默认设备配置
285
+ */
286
+ export declare const DEFAULT_DEVICE_CONFIG: SwitchDeviceConfig;
287
+ /**
288
+ * 设备Kind转为中文描述
289
+ */
290
+ export declare const DEFAULT_KIND_MAP: {
291
+ [key in DEVICE_KIND]: string;
292
+ };
293
+ export declare const INIT_CONTENT_STREAMS: {};
@@ -0,0 +1,2 @@
1
+ import { ILayout } from '../type/index';
2
+ export declare const DEFAULT_POLLING_LAYOUT: ILayout;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * XY WebRTC SDK Custom Message Lib
3
+ *
4
+ * Created at : 2024-05-16 10:36:06
5
+ * Last modified : 2024-06-07 17:53:30
6
+ */
7
+ import XYRTCClient from '../../main/client';
8
+ import { ICustomMessageConfig, XYBaseModule } from '../../type/index';
9
+ export declare class XYCustomMessage implements XYBaseModule {
10
+ private client;
11
+ private logger;
12
+ constructor(client: XYRTCClient);
13
+ destroy(): void;
14
+ /**
15
+ * 处理媒体转发的用户自定义消息
16
+ *
17
+ * @param { object } data - 媒体下发的用户自定义消息数据
18
+ */
19
+ handleReceiveCustomMessage(data: any): void;
20
+ /**
21
+ * 发送自定义消息
22
+ *
23
+ * @param { object } config - 配置参数
24
+ * @param { number } config.toPid - 消息的接收方pid,0表示广播消息、非0表示单点消息;
25
+ * @param { string } config.data - 消息内容,JSON字符串;因业务数据可能会传输图片,需要对二进制数据进行base64编码,消息长度限制最大:1030KB
26
+ * @return { IReturnResult } - 返回结果
27
+ */
28
+ sendCustomMessage(config: ICustomMessageConfig): import("../../type/index").IReturnResult;
29
+ }
@@ -0,0 +1,34 @@
1
+ import XYRTCClient from '../../main/client';
2
+ import { IConference, IGetConferenceParams, IReqInfo, TCommand, XYBaseModule } from '../../type/index';
3
+ export declare class XYEDU implements XYBaseModule {
4
+ private client;
5
+ private logger;
6
+ constructor(client: XYRTCClient);
7
+ destroy(): void;
8
+ /**
9
+ * 更新设备的声音状态
10
+ * 使用场景:教育平台-巡课
11
+ *
12
+ * @param { 'mute' | 'unmute' } type - mute: 静音;unmute: 取消静音;
13
+ * @param { string | string[] } callUriList - 操作的设备的 callUri 或者 callUri 列表
14
+ * @returns { IReturnResult } - 操作结果
15
+ */
16
+ setPollingAudioStatus(type: 'mute' | 'unmute', callUriList: string | string[]): Promise<any>;
17
+ /**
18
+ * 获取随机云会议室
19
+ * 使用场景:目前用于教育
20
+ *
21
+ * @param { IGetConferenceParams } param - 会议室参数
22
+ * @returns { Promise<IConference> } 云会议室信息
23
+ */
24
+ getConference(params: IGetConferenceParams): Promise<IConference>;
25
+ /**
26
+ * 开始轮询请求 Layout 画面数据
27
+ *
28
+ * @param { TCommand } command - 轮询状态,0-开始 1-停止 2-暂停 3-恢复
29
+ * @param { number } interval - 轮询间隔时长,单位秒
30
+ * @param { IReqInfo[] } reqList - 请求 Layout 画面流内容
31
+ * @returns { Promise<boolean> } - 是否请求成功
32
+ */
33
+ requestAutoPollingLayout(command: TCommand, interval: number | undefined, reqList: IReqInfo[]): Promise<boolean>;
34
+ }
@@ -0,0 +1,29 @@
1
+ import { IToken } from '../../type/base';
2
+ /**
3
+ * 是否静音
4
+ *
5
+ * @param SMART 0 - 智能静音
6
+ * @param ALL 1 - 全部静音
7
+ * @param NOT 2 - 不静音
8
+ * @param FORCE 3 - 强制静音
9
+ */
10
+ export declare enum AutoMute {
11
+ SMART = 0,
12
+ ALL = 1,
13
+ NOT = 2,
14
+ FORCE = 3
15
+ }
16
+ /**
17
+ * 随机会议室参数
18
+ *
19
+ * @param { string } id - userProfileId,默认是0
20
+ * @param { string } sk - SK,默认是空字符串
21
+ * @param { IToken } token - Token,默认是空字符串
22
+ * @param { AutoMute } autoMute - 是否静音,0:智能静音 1:全部静音 2:不静音 3:强制静音
23
+ */
24
+ export interface IGetConferenceParams {
25
+ id: number;
26
+ sk: string;
27
+ token: IToken;
28
+ autoMute: AutoMute;
29
+ }
@@ -1 +1,3 @@
1
- export * from './speaker';
1
+ export * from './speaker/index';
2
+ export * from './customMessage/index';
3
+ export * from './edu/index';
@@ -2,12 +2,12 @@
2
2
  * Feature:实时讲话人功能
3
3
  *
4
4
  * Created at : 2023-09-26 15:12:40
5
- * Last modified : 2023-10-11 11:31:09
5
+ * Last modified : 2024-06-28 18:28:26
6
6
  */
7
- import { SpeakersInfoObj } from '../type';
8
- import Client from '../main/client';
9
- import Logger from '../tools/log/logger';
10
- export declare class Speaker {
7
+ import { SpeakersInfoItem, XYBaseModule } from '../../type/index';
8
+ import Client from '../../main/client';
9
+ import Logger from '../../tools/log/logger';
10
+ export declare class Speaker implements XYBaseModule {
11
11
  logger: Logger;
12
12
  private client;
13
13
  private cacheSpeakerList;
@@ -16,18 +16,26 @@ export declare class Speaker {
16
16
  private speakerListTimer;
17
17
  private speakerInterval;
18
18
  private speakerTimestamp;
19
- private speakerInternalMap;
19
+ private analyserMap;
20
20
  constructor(client: Client);
21
21
  /**
22
22
  * 获取实时讲话人列表数据
23
23
  */
24
- getRemoteSpeakerList(): SpeakersInfoObj[];
24
+ getRemoteSpeakerList(): SpeakersInfoItem[];
25
+ /**
26
+ * 获取SpeakerList的对象数据
27
+ *
28
+ * @returns { { [key: string]: SpeakersInfoItem } }
29
+ */
30
+ getRemoteSpeakerMap(): {
31
+ [key: string]: SpeakersInfoItem;
32
+ };
25
33
  /**
26
34
  * 处理实时讲话人信息
27
35
  *
28
- * @param { SpeakersInfoObj[] } param - 接收到的远端speakers消息内容
36
+ * @param { SpeakersInfoObj[] } data - 接收到的远端speakers消息内容
29
37
  */
30
- onSpeakerListMessage(data?: SpeakersInfoObj[]): void;
38
+ onSpeakerListMessage(data?: SpeakersInfoItem[]): void;
31
39
  /**
32
40
  * 删除无效的讲话人信息
33
41
  */
@@ -44,6 +52,14 @@ export declare class Speaker {
44
52
  * 3、排序、推送排序的数据
45
53
  */
46
54
  private updateSpeakerAudioLevel;
55
+ /**
56
+ * 创建或更新Analyser分析器
57
+ *
58
+ * @param { string } id - Roster Id
59
+ * @param { string } trackId - 媒体网关分配的Track Id
60
+ * @param { string } timestamp - 时间戳
61
+ */
62
+ private createAndUpdateAnalyser;
47
63
  /**
48
64
  * 基于合并后的SpeakerList做过滤和声量排序操作
49
65
  */
@@ -54,6 +70,10 @@ export declare class Speaker {
54
70
  * @param { SpeakersInfoObj[] } speakerList - 说话人信息
55
71
  */
56
72
  private emitSpeakerList;
73
+ /**
74
+ * 销毁所有Analyser分析器
75
+ */
76
+ private destroyAnalyserMap;
57
77
  /**
58
78
  * 清除Speaker Timer和其他缓存数据
59
79
  */
@@ -0,0 +1,17 @@
1
+ import { AnalyserNode } from '../../type/index';
2
+ /**
3
+ * 实时讲话人内部数据
4
+ */
5
+ export interface SpeakerMapItem {
6
+ stream: MediaStream | null;
7
+ analyserNode: AnalyserNode | null;
8
+ timestamp: number;
9
+ mediaTrackId: string;
10
+ }
11
+ /**
12
+ * 音频分析器Map
13
+ *
14
+ * @param { string } rosterId - RosterId
15
+ * @param { SpeakerMapItem } value - 基于LayoutId封装的数据结构
16
+ */
17
+ export type XYAnalyserMap = Map<string, SpeakerMapItem>;