@xylink/xy-rtc-sdk 3.10.0-beta.4 → 4.0.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 (118) hide show
  1. package/README.MD +36 -13
  2. package/lib/action/index.d.ts +61 -45
  3. package/lib/enum/analyser.d.ts +7 -0
  4. package/lib/enum/client.d.ts +8 -2
  5. package/lib/enum/constraints.d.ts +11 -16
  6. package/lib/enum/device.d.ts +0 -6
  7. package/lib/enum/errorCode.d.ts +5 -2
  8. package/lib/enum/index.d.ts +45 -7
  9. package/lib/enum/polling.d.ts +2 -0
  10. package/lib/feature/customMessage/index.d.ts +29 -0
  11. package/lib/feature/edu/index.d.ts +34 -0
  12. package/lib/feature/edu/index.type.d.ts +29 -0
  13. package/lib/feature/index.d.ts +3 -1
  14. package/lib/feature/{speaker.d.ts → speaker/index.d.ts} +29 -9
  15. package/lib/feature/speaker/index.type.d.ts +17 -0
  16. package/lib/index.d.ts +82 -28
  17. package/lib/interface/baseModule.type.d.ts +9 -0
  18. package/lib/interface/clientInterface.type.d.ts +128 -0
  19. package/lib/interface/contentTrackInterface.type.d.ts +15 -0
  20. package/lib/interface/event.type.d.ts +444 -0
  21. package/lib/interface/videoAudioTrackInterface.type.d.ts +17 -0
  22. package/lib/main/ability/const.d.ts +4 -1
  23. package/lib/main/ability/index.d.ts +7 -1
  24. package/lib/main/{auth.d.ts → auth/index.d.ts} +29 -19
  25. package/lib/main/client.d.ts +594 -633
  26. package/lib/main/clientBase.d.ts +40 -0
  27. package/lib/main/clientState.d.ts +56 -0
  28. package/lib/main/{deviceManager.d.ts → device/index.d.ts} +45 -13
  29. package/lib/{type/device.d.ts → main/device/index.type.d.ts} +65 -16
  30. package/lib/main/helper/index.d.ts +118 -0
  31. package/lib/main/helper/index.type.d.ts +12 -0
  32. package/lib/main/layout/index.d.ts +118 -105
  33. package/lib/main/layout/index.type.d.ts +282 -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 +29 -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} +51 -7
  42. package/lib/main/meeting/verify.d.ts +70 -0
  43. package/lib/main/meeting/verify.type.d.ts +12 -0
  44. package/lib/main/peer.d.ts +120 -41
  45. package/lib/main/plugin/index.d.ts +28 -0
  46. package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
  47. package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
  48. package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
  49. package/lib/main/render/index.d.ts +116 -0
  50. package/lib/main/render/index.type.d.ts +36 -0
  51. package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
  52. package/lib/main/render/videoManager.type.d.ts +66 -0
  53. package/lib/main/roster/index.d.ts +39 -0
  54. package/lib/main/server/index.d.ts +79 -0
  55. package/lib/main/server/index.type.d.ts +21 -0
  56. package/lib/main/signal/index.d.ts +15 -0
  57. package/lib/main/socket/index.d.ts +95 -0
  58. package/lib/main/stream/index.d.ts +182 -0
  59. package/lib/main/track/baseTrack.d.ts +178 -0
  60. package/lib/main/track/contentTrack.d.ts +168 -0
  61. package/lib/main/track/customContentTrack.d.ts +18 -0
  62. package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
  63. package/lib/main/track/helper.d.ts +53 -0
  64. package/lib/main/track/videoAudioCapture.d.ts +90 -0
  65. package/lib/main/track/videoAudioTrack.d.ts +273 -0
  66. package/lib/main/vom/index.d.ts +44 -0
  67. package/lib/main/vom/index.type.d.ts +1 -0
  68. package/lib/tools/analyser.d.ts +30 -7
  69. package/lib/tools/analyserManager.d.ts +55 -0
  70. package/lib/tools/dbManager.d.ts +12 -1
  71. package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
  72. package/lib/tools/detectStream/index.d.ts +84 -0
  73. package/lib/tools/detectStream/index.type.d.ts +56 -0
  74. package/lib/tools/detectTool/index.d.ts +191 -0
  75. package/lib/tools/detectTool/index.type.d.ts +51 -0
  76. package/lib/tools/emitter.d.ts +27 -6
  77. package/lib/tools/enum.d.ts +1 -1
  78. package/lib/tools/httpClient.d.ts +5 -1
  79. package/lib/tools/i18n.d.ts +1 -1
  80. package/lib/tools/index.d.ts +1 -8
  81. package/lib/tools/log/logger.d.ts +44 -24
  82. package/lib/tools/log/logger.worker.d.ts +1 -1
  83. package/lib/tools/log/loggerManager.d.ts +3 -2
  84. package/lib/tools/pressure/index.d.ts +33 -0
  85. package/lib/tools/pressure/index.type.d.ts +22 -0
  86. package/lib/tools/promiseQueue.d.ts +6 -0
  87. package/lib/tools/regex.d.ts +4 -0
  88. package/lib/tools/resize.d.ts +3 -0
  89. package/lib/tools/snapshot.d.ts +1 -1
  90. package/lib/tools/socket.d.ts +12 -2
  91. package/lib/tools/template/index.d.ts +11 -88
  92. package/lib/tools/template/mobile.d.ts +1 -1
  93. package/lib/tools/template/polling.d.ts +8 -0
  94. package/lib/tools/utils.d.ts +25 -16
  95. package/lib/tools/verify.d.ts +7 -0
  96. package/lib/type/ability.d.ts +1 -1
  97. package/lib/type/analyser.d.ts +26 -1
  98. package/lib/type/auth.d.ts +22 -22
  99. package/lib/type/base.d.ts +36 -32
  100. package/lib/type/capture.d.ts +9 -0
  101. package/lib/type/client.d.ts +379 -498
  102. package/lib/type/index.d.ts +25 -2
  103. package/lib/type/layout.d.ts +84 -47
  104. package/lib/type/logger.d.ts +19 -12
  105. package/lib/type/meeting.d.ts +89 -68
  106. package/lib/type/peer.d.ts +65 -1
  107. package/lib/type/polling.d.ts +194 -0
  108. package/lib/type/quality.d.ts +16 -6
  109. package/lib/type/socket.d.ts +0 -18
  110. package/lib/type/stream.d.ts +138 -108
  111. package/lib/type/track.d.ts +139 -0
  112. package/lib/xyrtc.cjs.js +1 -1
  113. package/lib/xyrtc.umd.js +1 -1
  114. package/package.json +13 -10
  115. package/lib/main/clientImplements.d.ts +0 -99
  116. package/lib/main/helper.d.ts +0 -104
  117. package/lib/main/stream.d.ts +0 -418
  118. package/lib/tools/detect.d.ts +0 -44
@@ -0,0 +1,40 @@
1
+ /**
2
+ * XYLink WebRTC Client Base Lib
3
+ *
4
+ * @summary SDK IMPLEMENTS LIB
5
+ * @author JingHui Luo <luojinghui424@gmail.com>
6
+ *
7
+ * Created at : 2024-04-22 15:20:15
8
+ * Last modified : 2024-07-08 19:53:07
9
+ */
10
+ import Emitter from '../tools/emitter';
11
+ import Logger from '../tools/log/logger';
12
+ import { IClientConfig, XYClientEventKey } from '../type/index';
13
+ export declare class XYRTCClientBase extends Emitter<XYClientEventKey | string> {
14
+ protected config: IClientConfig;
15
+ protected logger: Logger;
16
+ constructor(config: IClientConfig, logger: Logger);
17
+ /**
18
+ * 客户端推送Event消息
19
+ *
20
+ * @param { XYClientEventKey } key - 事件的Key
21
+ * @param { T[] } args - 需要推送的数据内容
22
+ */
23
+ emitMessage<T>(key: XYClientEventKey, ...args: T[]): void;
24
+ /**
25
+ * 注册客户端监听事件
26
+ * 调用时机:初始化SDK后,登录之前注册
27
+ * 关联内容:XYRTCClient事件
28
+ *
29
+ * @param { XYClientEventKey | string } key - 事件的Key
30
+ * @param { Function } listener - 事件回调函数
31
+ * @param { number? } total - 可选,回调函数触发次数,默认是-1,表示无限制
32
+ */
33
+ on(key: XYClientEventKey | string, listener: Function, total?: number): void;
34
+ /**
35
+ * 取消监听事件
36
+ *
37
+ * @param { XYDeviceEventKey | XYTrackEventKey } key - 监听器key
38
+ */
39
+ off(key: XYClientEventKey): void;
40
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * XYLink WebRTC Client State Lib
3
+ *
4
+ * Created at : 2024-04-22 15:45:36
5
+ * Last modified : 2024-05-17 19:06:08
6
+ */
7
+ import { ICodeList, XYBaseModule } from '../type/index';
8
+ import Action from '../action/index';
9
+ export default class XYClientState implements XYBaseModule {
10
+ private errorcode;
11
+ private i18nCode;
12
+ destroy(): void;
13
+ getErrorCode(): ICodeList;
14
+ getI18nCode(): ICodeList;
15
+ /**
16
+ * 设置国际化i8n列表
17
+ *
18
+ * @param { ICodeList } code - 国际化列表
19
+ */
20
+ setI18nCode(code: ICodeList): void;
21
+ /**
22
+ * 获取指定Key的国际化消息
23
+ *
24
+ * @param { string } key - 消息Key
25
+ * @returns { string } - 返回国际化消息
26
+ */
27
+ getI18nMessage(key: string): string;
28
+ /**
29
+ * 获取指定Key的错误消息
30
+ *
31
+ * @param { string } key - 消息Key
32
+ * @returns { string } - 返回错误码消息
33
+ */
34
+ getErrorCodeMessage(key: string): string;
35
+ /**
36
+ * 设置错误码列表
37
+ *
38
+ * @param { ICodeList } code - 错误码列表
39
+ */
40
+ setErrorCode(code: ICodeList): void;
41
+ /**
42
+ * 获取链接内容
43
+ *
44
+ * @param { string } configName - 'errorcode' | 'i18n'
45
+ * @param { object } data - 数据
46
+ * @param { object } oldData - 历史数据
47
+ * @param { Action } action - Action实例
48
+ */
49
+ getCodeByJson(configName: string, data: {
50
+ version: string;
51
+ link: string;
52
+ }, oldData: {
53
+ version: string;
54
+ link: string;
55
+ }, action: Action): Promise<void>;
56
+ }
@@ -1,22 +1,24 @@
1
1
  /**
2
2
  * XYLink WebRTC Device & Permission Manager Lib
3
3
  *
4
+ * DESIGN NOTES: https://nones.xylink.com/wiki/#/team/AQzvsooq/space/SLqJDsvD/page/TXNaSayk
5
+ *
4
6
  * @summary device and permission manager
5
- * @author jinghui-luo、chengfei
7
+ * @author Jinghui-Luo<luojinghui424@gamil.com>、ChengFei
6
8
  *
7
9
  * Created at : 2020-11-26 14:41:51
8
- * Last modified : 2023-11-09 10:05:07
10
+ * Last modified : 2024-06-20 14:54:13
9
11
  */
10
- import Logger from '../tools/log/logger';
11
- import Emitter from '../tools/emitter';
12
- import { IDeviceInfo, IDeviceList, ICurrentPermission, PermissionType, FacingMode, DEVICE_KIND, IDeviceId, ISetSpecDevice } from '../type';
12
+ import Logger from '../../tools/log/logger';
13
+ import Emitter from '../../tools/emitter';
14
+ import { IDeviceInfo, IDeviceList, ICurrentPermission, PermissionType, FacingMode, DEVICE_KIND, IDeviceId, ISetSpecDevice, IUsedDeviceParams, ISpecStateParams, XYDeviceEventKey } from '../../type/index';
13
15
  /**
14
16
  * DeviceManager模块,用于管理枚举设备列表、监听设备变动、处理设备权限等功能
15
17
  *
16
18
  * @class DeviceManager
17
19
  * @extends Emitter 事件发送器
18
20
  */
19
- declare class DeviceManager extends Emitter {
21
+ declare class DeviceManager extends Emitter<XYDeviceEventKey> {
20
22
  private navigator;
21
23
  logger: Logger;
22
24
  isNewLogger: boolean;
@@ -27,11 +29,12 @@ declare class DeviceManager extends Emitter {
27
29
  private currentDeviceList;
28
30
  private fullDeviceList;
29
31
  private systemDefaultDevice;
30
- private cacheDefaultDeviceId;
31
32
  private specifiedDevice;
32
33
  private usedDeviceId;
34
+ private cacheUsedDeviceId;
33
35
  private systemDefaultDeviceId;
34
36
  private specifiedDefaultDeviceId;
37
+ private deviceLabelMap;
35
38
  private onDeviceChangeEvent;
36
39
  private onUpdateFullDeviceList;
37
40
  constructor(logger?: Logger);
@@ -70,22 +73,35 @@ declare class DeviceManager extends Emitter {
70
73
  private diffDefaultDevice;
71
74
  /**
72
75
  * 获取默认设备ID数据
73
- * 区分两种类型:如用户选择系统默设备,则获取系统默认设备,如果是指定设备,则根据指定设备获取对应分配的设备
76
+ *
77
+ * 区分两种类型:
78
+ * 1、系统默设备模式,则获取系统默认设备
79
+ * 2、指定设备模式,则根据指定设备获取对应默认分配的设备
74
80
  */
75
81
  getDefaultDeviceId(): IDeviceId;
82
+ /**
83
+ * 获取采集音视频流时需要指定的设备信息
84
+ */
85
+ getCaptureDeviceId(): IDeviceId;
76
86
  /**
77
87
  * 缓存用户选择的设备数据,也可用作判断用户是否选择:默认系统设备
78
88
  * 注意:如果用户设置的DeviceID不存在,也会持久缓存,不会做设备真实性校验
79
89
  *
80
- * @param { ISetSpecDevice } params - 需要指定的设备信息
90
+ * @param { ISetSpecDevice } deviceList - 需要指定的设备信息
91
+ */
92
+ setSpecifiedDeviceId(deviceList: ISetSpecDevice[]): void;
93
+ /**
94
+ * 标记指定设备时采集此设备的状态
95
+ *
96
+ * @param { ISpecStateParams[] } stateList - 批量更新指定设备采集状态
81
97
  */
82
- setSpecifiedDeviceId(params: ISetSpecDevice): void;
98
+ setSpecifiedDeviceState(stateList: ISpecStateParams[]): void;
83
99
  /**
84
- * 通过采集到的Stream,获取到真实的DeviceId,并更新到设备列表
100
+ * 基于MediaStream获取真实的设备信息,更新到设备列表
85
101
  *
86
- * @param { IDeviceId } usedDeviceId - 增量的设备ID信息
102
+ * @param { IUsedDeviceParams } deviceList - 正在使用的设备信息,可以提供一组数据
87
103
  */
88
- updateUsedDeviceId(usedDeviceId: IDeviceId): Promise<void>;
104
+ updateUsedDeviceId(deviceList: IUsedDeviceParams[]): Promise<void>;
89
105
  /**
90
106
  * 获取指定ID对应的真实DeviceId值
91
107
  *
@@ -114,6 +130,10 @@ declare class DeviceManager extends Emitter {
114
130
  * @param { string } deviceId - 切换的设备ID,可能包含DEFAULT设备
115
131
  */
116
132
  setAudioOutputDevice(element: any, deviceId: string): Promise<void>;
133
+ /**
134
+ * 更新指定设备的状态
135
+ */
136
+ private resetSpecifiedDeviceState;
117
137
  /**
118
138
  * 获取基础设备列表
119
139
  * 注意:不包含DEFAULT系统默认设备,会在最后一步合并
@@ -139,6 +159,7 @@ declare class DeviceManager extends Emitter {
139
159
  * @param { IDeviceList } deviceList - 设备列表
140
160
  */
141
161
  private filterDefaultDevice;
162
+ private filterDevice;
142
163
  /**
143
164
  * 追加系统默认设备选项
144
165
  */
@@ -155,6 +176,17 @@ declare class DeviceManager extends Emitter {
155
176
  * 更新最新的设备列表中的选中状态(isSelected),元配置数据(originLabel, originDeviceId)
156
177
  */
157
178
  private updateFullDeviceListStatus;
179
+ /**
180
+ * 基于各状态更新最终的设备状态信息
181
+ *
182
+ * @param { IDeviceInfo[] } devices - 全量设备列表
183
+ * @param { ISpecifiedDeviceConfig } specifiedDevice - 指定的设备信息
184
+ * @param { string } usedId - 正在使用的设备信息
185
+ * @param { string } defaultId - 两种模式的默认设备信息
186
+ * @param { string } systemDefaultDeviceId - 系统默认设备
187
+ * @returns
188
+ */
189
+ private updateDevice;
158
190
  /**
159
191
  * 通过DeviceId获取设备详情信息
160
192
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * XY WebRTC SDK Device Type
3
+ *
4
+ * Created at : 2024-06-07 17:19:09
5
+ * Last modified : 2024-06-07 17:25:44
6
+ */
1
7
  /**
2
8
  * 采集权限状态
3
9
  *
@@ -44,7 +50,7 @@ export type IDevice = {
44
50
  * 设备信息
45
51
  *
46
52
  * @property { boolean } isSelected - 是否选中此设备
47
- * @property { boolean } isDefault - 是否默认设备
53
+ * @property { boolean } isDefault - 是否是默认设备
48
54
  * @property { string } key - 设备唯一ID
49
55
  */
50
56
  export interface IDeviceInfo extends IDevice {
@@ -59,20 +65,38 @@ export interface IDeviceInfo extends IDevice {
59
65
  * @property { IDeviceInfo[] } audioOutputList - 扬声器列表
60
66
  * @property { IDeviceInfo[] } videoInList - 摄像头列表
61
67
  */
62
- export type IDeviceList = {
68
+ export interface IDeviceList {
63
69
  audioInputList: IDeviceInfo[];
64
70
  audioOutputList: IDeviceInfo[];
65
71
  videoInputList: IDeviceInfo[];
66
- };
72
+ }
73
+ /**
74
+ * 指定设备的状态
75
+ *
76
+ * @property INIT - 未设置指定设备,是默认值,不针对采集标记状态
77
+ * @property UNKNOWN - 指定设备:未知采集状态
78
+ * @property NORMAL - 指定设备:采集正常
79
+ * @property FAILED - 指定设备:采集失败
80
+ * @property LOST - 指定设备:设备丢失
81
+ */
82
+ export declare enum SpecifiedState {
83
+ 'INIT' = "INIT",
84
+ 'UNKNOWN' = "UNKNOWN",
85
+ 'NORMAL' = "NORMAL",
86
+ 'FAILED' = "FAILED",
87
+ 'LOST' = "LOST"
88
+ }
67
89
  /**
68
90
  * 用户指定设备配置
69
91
  *
70
- * @property { boolean } isDefault - 是否默认设备
92
+ * @property { boolean } isDefault - 是否当前是系统默认选项
71
93
  * @property { string } deviceId - 设备ID
94
+ * @property { SpecifiedState } state - 指定设备ID采集状态
72
95
  */
73
96
  export type ISpecifiedDeviceConfig = {
74
97
  isDefault: boolean;
75
98
  deviceId: string;
99
+ state: SpecifiedState;
76
100
  };
77
101
  /**
78
102
  * 用户指定设备信息
@@ -89,15 +113,15 @@ export type ISpecifiedDevice = {
89
113
  /**
90
114
  * 当前已选择设备信息
91
115
  *
92
- * @property { IDeviceInfo | null } audioInput - 麦克风设备
93
- * @property { IDeviceInfo | null } audioOutput - 扬声器设备
94
- * @property { IDeviceInfo | null } videoInput - 摄像头设备
116
+ * @property { IDeviceInfo | null } audioInput - 麦克风列表设备
117
+ * @property { IDeviceInfo | null } audioOutput - 扬声器列表设备
118
+ * @property { IDeviceInfo | null } videoInput - 摄像头列表设备
95
119
  */
96
- export type ISelectedDevice = {
120
+ export interface ISelectedDevice {
97
121
  audioInput: IDeviceInfo | null;
98
122
  videoInput: IDeviceInfo | null;
99
123
  audioOutput: IDeviceInfo | null;
100
- };
124
+ }
101
125
  /**
102
126
  * 当前已选择设备信息
103
127
  *
@@ -111,15 +135,15 @@ export type IDeviceId = {
111
135
  audioOutput: string;
112
136
  };
113
137
  /**
114
- * 设备变化事件
138
+ * 设备变化后的最新列表数据和需要切换设备数据
115
139
  *
116
- * @property { ISelectedDevice } nextDevice - 最新的设备
117
- * @property { IDeviceList } detail - 最新设备详细信息
140
+ * @property { ISelectedDevice } nextDevice - 自动切换的设备数据
141
+ * @property { IDeviceList } detail - 最新设备列表数据,包含麦克风、扬声器、摄像头
118
142
  */
119
- export type IDeviceManagerChangeValue = {
143
+ export interface IDeviceManagerChangeValue {
120
144
  nextDevice: ISelectedDevice;
121
145
  detail: IDeviceList;
122
- };
146
+ }
123
147
  /**
124
148
  * 当前麦克风/摄像头权限
125
149
  *
@@ -146,10 +170,35 @@ export interface IDefaultDeviceIdParams {
146
170
  preList: IDeviceInfo[];
147
171
  }
148
172
  /**
149
- * 指定设备信息
173
+ * 正在使用的设备函数参数
174
+ *
175
+ * @property { DEVICE_KIND } kind - 设备类型
176
+ * @property { string } deviceId - 设备ID
150
177
  */
151
- export interface ISetSpecDevice {
178
+ export interface IUsedDeviceParams {
152
179
  kind: DEVICE_KIND;
153
180
  deviceId: string;
181
+ }
182
+ /**
183
+ * 指定设备信息
184
+ *
185
+ * @property { DEVICE_KIND } kind - 设备类型
186
+ * @property { string } deviceId - 设备ID
187
+ * @property { boolean } isDefault - 是否是默认设备
188
+ */
189
+ export interface ISetSpecDevice extends IUsedDeviceParams {
154
190
  isDefault: boolean;
155
191
  }
192
+ /**
193
+ * 更新指定设备采集状态
194
+ */
195
+ export interface ISpecStateParams {
196
+ kind: DEVICE_KIND;
197
+ state: SpecifiedState;
198
+ }
199
+ /**
200
+ * 缓存设备Label名称
201
+ */
202
+ export interface IDeviceLabelMap {
203
+ [key: string]: string;
204
+ }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Common Helper Function Lib
3
+ *
4
+ * Created at : 2021-01-09 14:45:46
5
+ * Last modified : 2024-06-20 11:39:20
6
+ */
7
+ import { IRotationInfoTotalItem, IRotateStyle, XYSupportedCodec, DEVICE_KIND } from '../../type/index';
8
+ import { XYRotationVideoInfo } from './index.type';
9
+ /**
10
+ * 获取真实视频分辨率的宽高、比值
11
+ *
12
+ * @param { number } width - 视频宽
13
+ * @param { number } height - 视频高
14
+ * @param { number } containerHeight - 视频容器高
15
+ * @param { number } containerWidth - 视频容器宽
16
+ * @param { number } rotate - 旋转信息
17
+ * @return { XYRotationVideoInfo } - 按照旋转信息计算后的宽/高/旋转角度数据
18
+ */
19
+ export declare const getVideoInfoByRotation: (width: number, height: number, containerHeight: number, containerWidth: number, rotate: number) => XYRotationVideoInfo;
20
+ /**
21
+ * 自定义布局,辅助计算参会者在旋转画面时的旋转信息
22
+ *
23
+ * @param { IRotationInfoTotalItem } rotationInfo - 屏幕旋转信息数据,通过rotate-info接口回调获取
24
+ * @param { number } containerWidth - 当前参会者布局容器的宽度
25
+ * @param { number } containerHeight - 当前参会者布局容器的高度
26
+ */
27
+ export declare const getLayoutRotateInfo: (rotationInfo: IRotationInfoTotalItem, containerWidth: number, containerHeight: number) => IRotateStyle | null;
28
+ /**
29
+ * 获取浏览器支持的编解码器列表
30
+ *
31
+ * @public
32
+ * @returns { Promise<XYSupportedCodec> } - 结果
33
+ */
34
+ export declare const getSendSupportedCodec: () => Promise<XYSupportedCodec>;
35
+ /**
36
+ * 生成用户唯一Layout ID值
37
+ *
38
+ * @param { string } callUri - callUri或者endpointId值
39
+ * @param { number | string } mediagroupid - 多分组通道ID,常见:0代表people,1代表content,会控喊话有>10值
40
+ * @param { string } customId - 自定义ID,默认是""
41
+ * @return { string } 唯一ID
42
+ */
43
+ export declare const getLayoutId: (callUri?: string, mediagroupid?: number | string, customId?: string) => string;
44
+ /**
45
+ * 生成用户Roster ID值
46
+ *
47
+ * @param { string } callUri - callUri或者endpointId值
48
+ * @param { number | string } mediagroupid - 多分组通道ID,常见:0代表people,1代表content,会控喊话有>10值
49
+ * @return { string } Roster ID
50
+ */
51
+ export declare const getRosterId: (callUri?: string, mediagroupid?: number | string) => string;
52
+ /**
53
+ * 获取Layout ID或Roster Id组合信息,依次是:endpointId、mediagroupId、customId、roster key信息
54
+ *
55
+ * @param { string } id - Layout ID/Roster ID
56
+ */
57
+ export declare const getLayoutIdInfo: (id: string) => {
58
+ endpointId: string;
59
+ mediagroupId: string | number;
60
+ customId: string;
61
+ rosterId: string;
62
+ isContent: boolean;
63
+ };
64
+ /**
65
+ * 通过participantId和mediagroupId获取用户的UniquePd值?
66
+ *
67
+ * @param { string } participantId - 小鱼设计的唯一用户ID,迁会后自动创建新的Pid子段;
68
+ * @param { string } mediagroupId - 多分组通道ID
69
+ * @returns { string } 创建的ID值
70
+ */
71
+ export declare const getUniquePid: (participantId: string | number, mediagroupId: string | number) => string;
72
+ /**
73
+ * 基于生成的UniquePid值获取participantId和mediagroupId
74
+ *
75
+ * @param { string } partId - UniquePid值
76
+ * @returns
77
+ */
78
+ export declare const getUniquePidInfo: (partId: string) => {
79
+ participantId: string;
80
+ mediagroupId: string;
81
+ };
82
+ /**
83
+ * 获取副屏渲染ID
84
+ *
85
+ * @param { string } viewId - 视图容器节点ID
86
+ * @returns { string }
87
+ */
88
+ export declare const getSlaveId: (viewId: string) => string;
89
+ /**
90
+ * 生成设备唯一Key
91
+ *
92
+ * @param { string } deviceId - 设备ID
93
+ * @param { boolean } isDefault - 是否是默认设备
94
+ * @param { DEVICE_KIND } kind - 设备类型
95
+ * @returns { string } 设备唯一Key
96
+ */
97
+ export declare const getDeviceUniKey: (deviceId: string, isDefault: boolean, kind: DEVICE_KIND) => string;
98
+ /**
99
+ * 根据名称及相应规则获得对应的名称头像
100
+ *
101
+ * @param { string } displayName - layout名称
102
+ * @returns { string } - 名称头像 文字内容
103
+ */
104
+ export declare const getTextAvatar: (displayName: string) => string;
105
+ /**
106
+ * 获取真实的TrackId信息
107
+ *
108
+ * @param { string } trackId - 媒体下发的TrackId信息,包含tk-ad,SDK层面需要将-tk-ad转换为st才可以和StreamList做匹配使用
109
+ * @returns { string }
110
+ */
111
+ export declare const getReallyTrackId: (trackId: string) => string;
112
+ /**
113
+ * 辅助函数,用于切换音频输出设备
114
+ *
115
+ * @param { HTMLAudioElement } element - Audio元素节点
116
+ * @param { string } deviceId - 指定切换的设备ID,如果指定错误,则使用系统默认设备
117
+ */
118
+ export declare const setOutputAudioDevice: (element: any, deviceId: string) => Promise<void>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 旋转信息计算后的宽/高/旋转角度数据
3
+ *
4
+ * @param { number } realWidth - 旋转后的宽度
5
+ * @param { number } realHeight - 旋转后的高度
6
+ * @param { number } realRotate - 旋转角度
7
+ */
8
+ export interface XYRotationVideoInfo {
9
+ realWidth: number;
10
+ realHeight: number;
11
+ realRotate: number;
12
+ }