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

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 (115) hide show
  1. package/README.MD +30 -12
  2. package/lib/action/index.d.ts +57 -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 +43 -5
  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 +65 -28
  17. package/lib/interface/baseModule.type.d.ts +9 -0
  18. package/lib/interface/clientInterface.type.d.ts +83 -0
  19. package/lib/interface/contentTrackInterface.type.d.ts +15 -0
  20. package/lib/interface/event.type.d.ts +316 -0
  21. package/lib/interface/peopleTrackInterface.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 +365 -595
  26. package/lib/main/clientBase.d.ts +38 -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 +120 -0
  31. package/lib/main/layout/index.d.ts +118 -105
  32. package/lib/main/layout/index.type.d.ts +270 -0
  33. package/lib/main/layout/polling.d.ts +212 -0
  34. package/lib/main/layout/state.d.ts +163 -0
  35. package/lib/main/layout/template.d.ts +15 -7
  36. package/lib/main/media/index.d.ts +177 -0
  37. package/lib/main/media/index.type.d.ts +9 -0
  38. package/lib/main/meeting/control.d.ts +107 -0
  39. package/lib/main/meeting/control.type.d.ts +24 -0
  40. package/lib/main/{meeting.d.ts → meeting/index.d.ts} +46 -7
  41. package/lib/main/meeting/verify.d.ts +69 -0
  42. package/lib/main/peer.d.ts +120 -41
  43. package/lib/main/plugin/index.d.ts +28 -0
  44. package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
  45. package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
  46. package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
  47. package/lib/main/render/index.d.ts +116 -0
  48. package/lib/main/render/index.type.d.ts +24 -0
  49. package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
  50. package/lib/main/render/videoManager.type.d.ts +66 -0
  51. package/lib/main/roster/index.d.ts +39 -0
  52. package/lib/main/server/index.d.ts +79 -0
  53. package/lib/main/server/index.type.d.ts +21 -0
  54. package/lib/main/signal/index.d.ts +15 -0
  55. package/lib/main/socket/index.d.ts +95 -0
  56. package/lib/main/stream/index.d.ts +182 -0
  57. package/lib/main/track/baseTrack.d.ts +178 -0
  58. package/lib/main/track/contentTrack.d.ts +161 -0
  59. package/lib/main/track/customContentTrack.d.ts +18 -0
  60. package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
  61. package/lib/main/track/helper.d.ts +53 -0
  62. package/lib/main/track/videoAudioCapture.d.ts +90 -0
  63. package/lib/main/track/videoAudioTrack.d.ts +243 -0
  64. package/lib/main/vom/index.d.ts +44 -0
  65. package/lib/main/vom/index.type.d.ts +1 -0
  66. package/lib/tools/analyser.d.ts +30 -7
  67. package/lib/tools/analyserManager.d.ts +55 -0
  68. package/lib/tools/dbManager.d.ts +12 -1
  69. package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
  70. package/lib/tools/detectStream/index.d.ts +84 -0
  71. package/lib/tools/detectStream/index.type.d.ts +56 -0
  72. package/lib/tools/detectTool/index.d.ts +191 -0
  73. package/lib/tools/detectTool/index.type.d.ts +62 -0
  74. package/lib/tools/emitter.d.ts +27 -6
  75. package/lib/tools/enum.d.ts +1 -1
  76. package/lib/tools/httpClient.d.ts +5 -1
  77. package/lib/tools/i18n.d.ts +1 -1
  78. package/lib/tools/index.d.ts +1 -8
  79. package/lib/tools/log/logger.d.ts +41 -21
  80. package/lib/tools/log/logger.worker.d.ts +1 -1
  81. package/lib/tools/log/loggerManager.d.ts +2 -2
  82. package/lib/tools/pressure/index.d.ts +33 -0
  83. package/lib/tools/pressure/index.type.d.ts +22 -0
  84. package/lib/tools/promiseQueue.d.ts +6 -0
  85. package/lib/tools/regex.d.ts +4 -0
  86. package/lib/tools/snapshot.d.ts +1 -1
  87. package/lib/tools/socket.d.ts +12 -2
  88. package/lib/tools/template/index.d.ts +11 -88
  89. package/lib/tools/template/mobile.d.ts +1 -1
  90. package/lib/tools/template/polling.d.ts +8 -0
  91. package/lib/tools/utils.d.ts +25 -16
  92. package/lib/tools/verify.d.ts +7 -0
  93. package/lib/type/ability.d.ts +1 -1
  94. package/lib/type/analyser.d.ts +26 -1
  95. package/lib/type/auth.d.ts +19 -19
  96. package/lib/type/base.d.ts +27 -31
  97. package/lib/type/capture.d.ts +9 -0
  98. package/lib/type/client.d.ts +178 -333
  99. package/lib/type/index.d.ts +22 -2
  100. package/lib/type/layout.d.ts +81 -45
  101. package/lib/type/logger.d.ts +19 -12
  102. package/lib/type/meeting.d.ts +101 -56
  103. package/lib/type/peer.d.ts +65 -1
  104. package/lib/type/polling.d.ts +194 -0
  105. package/lib/type/quality.d.ts +12 -2
  106. package/lib/type/socket.d.ts +0 -18
  107. package/lib/type/stream.d.ts +42 -24
  108. package/lib/type/track.d.ts +131 -0
  109. package/lib/xyrtc.cjs.js +1 -1
  110. package/lib/xyrtc.umd.js +1 -1
  111. package/package.json +32 -52
  112. package/lib/main/clientImplements.d.ts +0 -99
  113. package/lib/main/helper.d.ts +0 -104
  114. package/lib/main/stream.d.ts +0 -418
  115. package/lib/tools/detect.d.ts +0 -44
@@ -6,49 +6,49 @@
6
6
  * @email luojinghui424@gmail.com
7
7
  *
8
8
  * Created at : 2021-01-05 17:24:07
9
- * Last modified : 2023-11-10 16:53:05
9
+ * Last modified : 2024-06-18 11:10:00
10
10
  */
11
- import Logger from '../../tools/log/logger';
12
- import { ILayout, IVideoRenders, IRoster, IScreenInfo, IOutputCustomLayout, ILayoutRoster, IConfInfo, IPageInfo, VideoQuality, StreamResolutionLevel, TLayoutMap, TemplateMode, ContentTemplateMode, IMode, LayoutOrientationType, LocalViewParams } from '../../type/index';
11
+ import { ILayout, IRoster, IScreenInfo, IOutputCustomLayout, ILayoutRoster, IConfInfo, IPageInfo, VideoQuality, StreamResolutionLevel, TLayoutMap, TemplateMode, IMode, LayoutOrientationType, LayoutConfig, PollingState, FocusViewConfig, LocalViewParams } from '../../type/index';
13
12
  import Client from '../client';
13
+ import Polling from './polling';
14
+ import Logger from '../../tools/log/logger';
15
+ import { XYLayoutManagerState } from './state';
14
16
  export default class LayoutManager {
15
17
  logger: Logger;
16
18
  client: Client;
17
- customLayoutMap: TLayoutMap;
18
19
  layoutMap: TLayoutMap;
19
- private videoManagers;
20
- private slaveVideoManagers;
21
- private originOrderRosters;
22
- private orderRosterList;
20
+ private sortedRosterList;
21
+ private layoutSortedRosterList;
23
22
  private selfRoster;
24
23
  private newLayoutList;
25
24
  private initLayout;
26
- private templateMode;
27
- private templateModeTemp;
28
25
  private templateRate;
29
26
  private content;
30
27
  private screenInfo;
31
28
  private internalsLayout;
32
- private forceFullScreenId;
33
29
  private localContent;
34
30
  private preConfInfo;
35
31
  private confInfo;
36
32
  private pageInfo;
37
- private isLocalShareContent;
38
33
  private templateManager;
39
34
  private focusViewConfig;
40
35
  private layoutOrientation;
36
+ polling: Polling;
41
37
  private localMirror;
38
+ private customLayoutCacheList;
39
+ private mediaManager;
40
+ private layoutState;
42
41
  constructor(client: Client);
43
42
  static getCustomLayoutItem(item: ILayout, resolution: StreamResolutionLevel, quality: VideoQuality): {
44
- pid: number;
43
+ pid: number | undefined;
45
44
  resolution: StreamResolutionLevel;
46
45
  quality: VideoQuality;
47
46
  mediagroupid: number;
48
47
  };
49
48
  getNewLayout(): ILayout[];
50
- getOrderRosterList(): IRoster[];
51
- getOriginOrderRosters(): IRoster[];
49
+ getLayoutSortedRosterList(): IRoster[];
50
+ getSortedRosterList(): IRoster[];
51
+ getLayoutMap(): TLayoutMap;
52
52
  getTemplateRate(): {
53
53
  previous: number;
54
54
  next: number;
@@ -56,25 +56,37 @@ export default class LayoutManager {
56
56
  getContentRosterItem(): IRoster | null;
57
57
  getSelfRoster(): IRoster;
58
58
  getScreenInfo(): IScreenInfo;
59
- getVideoManagers(): IVideoRenders;
60
59
  getForceFullScreenId(): string;
61
- getTemplateMode(): TemplateMode | ContentTemplateMode;
60
+ getTemplateMode(): TemplateMode | import("../../type/index").ContentTemplateMode;
62
61
  getConfInfo(): IConfInfo;
63
62
  getInternalsLayout(): IOutputCustomLayout;
64
63
  getLocalShareState(): boolean;
65
- getLayoutMap(): TLayoutMap;
66
- setOrderRosterList(orderRosterList: IRoster[]): void;
67
- setOriginOrderRosters(originOrderRosters: IRoster[]): void;
64
+ getFocusRoster(): IRoster | null;
65
+ getLayoutState(): XYLayoutManagerState;
66
+ getFocusViewConfig(): FocusViewConfig;
67
+ getFocusViewId(): string;
68
+ getLayoutOrientation(): LayoutOrientationType;
69
+ getPolling(): Polling;
70
+ getPollingState(): PollingState;
71
+ setSortedRosterList(rosterList: IRoster[]): void;
72
+ /**
73
+ * 全屏请流
74
+ *
75
+ * @param { string } id - 需要强制全屏的Layout Id
76
+ * @returns { Promise<string> } - Roster Id
77
+ */
78
+ startForceFullScreen(id: string): Promise<string>;
68
79
  /**
69
- * 维护 Local roster 状态
80
+ * 更新本地Roster数据
70
81
  *
71
82
  * @param { Partial<IRoster> } data - 需要更新的roster数据
72
83
  */
73
84
  setLocalStatus(data: Partial<IRoster>): void;
74
85
  /**
75
- * 设置发布全屏layout id
86
+ * 设置强制全屏的参会者Roster Id
87
+ * 经过Client模块Layout Id转换为Roster Id
76
88
  *
77
- * @param { string } id - forceLayout roster id
89
+ * @param { string } id - Roster Id
78
90
  */
79
91
  setForceFullScreenId(id?: string): void;
80
92
  /**
@@ -84,7 +96,7 @@ export default class LayoutManager {
84
96
  */
85
97
  setContentRosterItem(content: IRoster | null): void;
86
98
  /**
87
- * 设置confInfo
99
+ * 设置confChangeInfo信息
88
100
  *
89
101
  * @param { IConfInfo } confInfo - Conf Change消息
90
102
  */
@@ -102,54 +114,11 @@ export default class LayoutManager {
102
114
  */
103
115
  setLocalShareContent(is: boolean): void;
104
116
  /**
105
- * 回调 video 状态
106
- * state === (roster当前状态 + 上一次的status)
117
+ * Video组件状态变更回调事件
107
118
  *
108
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
109
- * @param { status: string; error?: any } data - 最新的会议状态 status === video track / video标签 监听到的状态
119
+ * @param { string } id - 参会者Layout Id
110
120
  */
111
- private onVideoStatusChange;
112
- /**
113
- * 绑定视频容器信息,SDK接管并播放视频流
114
- *
115
- * @param { string } rosterId - 参会者唯一ID,由endpointId + mediagroupId组成
116
- * @param { string } viewId - 包裹Video组件的元素ID,此元素指定宽高信息,SDK内部会基于此信息计算Video的旋转角度
117
- */
118
- setVideoRenderer(rosterId: string, viewId: string): void;
119
- /**
120
- * 绑定多路视频容器信息,SDK接管并播放视频流
121
- * 使用场景:将某一路参会者画面渲染到自定义的容器中,即可调用此方法将画面重复渲染到指定的ViewId容器中;
122
- * 支持将画面流绑定到多个画面容器中渲染
123
- *
124
- * @param { string } rosterId - 参会者唯一ID,由endpointId + mediagroupId组成;
125
- * @param { string } viewId 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
126
- */
127
- setSlaveVideoRenderer(rosterId: string, viewId: string): import("../../type/base").IReturnResult | undefined;
128
- /**
129
- * videoManagers 移除key对应的元素
130
- *
131
- * @param { string } rosterId - 参会者唯一ID,由endpointId + mediagroupId组成;
132
- * @param { string } viewId - 包裹Video元素的容器节点ID
133
- */
134
- removeVideoRenderer(rosterId: string): void;
135
- /**
136
- * 【副屏渲染】移除副屏渲染信息
137
- * 如果rosterId和viewId没有填写,则清空所有的副屏渲染配置数据
138
- *
139
- * @param { string } rosterId - 参会者唯一ID,由endpointId + mediagroupId组成;如果没有传递,则清空所有数据
140
- * @param { string } viewId 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
141
- */
142
- removeSlaveVideoRenderer(rosterId?: string, viewId?: string): void;
143
- /**
144
- * 播放本地画面
145
- */
146
- playLocalVideo(): Promise<void>;
147
- /**
148
- * 播放对应画面
149
- *
150
- * @param { string[] ? } rosterIdList - 指定重新播放的参会者ID,由roster中的id得到
151
- */
152
- playVideo(rosterIdList?: string[]): Promise<void>;
121
+ onVideoStatusChange(id: string): void;
153
122
  /**
154
123
  * 切换布局方向
155
124
  *
@@ -164,12 +133,12 @@ export default class LayoutManager {
164
133
  */
165
134
  switchLayout(templateMode?: IMode): "SPEAKER" | "GALLERY" | "MULTI_PIC_CONTENT_HIGH_PRIORITY" | "MULTI_PIC_ACTIVE_HIGH_PRIORITY" | "TWO_PIC_PIP" | "CONTENT_ONLY" | "TWO_PIC_SYMMETRIC";
166
135
  /**
167
- * 切换主画面, GALLERY布局不支持
136
+ * 本地切换主画面, GALLERY布局/会控设置焦点画面 不支持
168
137
  *
169
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
138
+ * @param { string } id - 指定切换到主画面的参会者Layout Id
170
139
  * @returns { string } rosterId
171
140
  */
172
- setFocusView(rosterId: string): string;
141
+ setFocusView(id: string): string;
173
142
  /**
174
143
  * 设置本地视频渲染参数
175
144
  *
@@ -181,6 +150,14 @@ export default class LayoutManager {
181
150
  * 更新Local video track
182
151
  */
183
152
  updateLocalTrack(): void;
153
+ /**
154
+ * 更新轮询状态,当有高于轮询的状态过来时,需要重置状态
155
+ */
156
+ updatePollingState(): void;
157
+ /**
158
+ * [AUTO] 计算分页及请流信息
159
+ */
160
+ calcPageAndRequestLayout(confInfo?: IConfInfo): void;
184
161
  /**
185
162
  * [AUTO] 重新计算页码信息、模板类型
186
163
  *
@@ -210,37 +187,63 @@ export default class LayoutManager {
210
187
  *
211
188
  * @param { ILayoutRoster[] } totalLayoutResultList - layout数据
212
189
  */
213
- private createOrderRoster;
190
+ private createLayoutSortedRosterList;
214
191
  /**
215
192
  * [CUSTOM] 基于 new layout result 消息生成 customLayoutMap 数据,并diff对比更新数据
216
193
  *
217
194
  * @param { ILayoutRoster[] } totalLayoutResultList - layout数据
218
195
  */
219
196
  createCustomLayout(totalLayoutResultList: ILayoutRoster[]): void;
197
+ /**
198
+ * 创建自定义布局的LayoutMap数据
199
+ */
200
+ private initCustomLayoutMap;
220
201
  /**
221
202
  * [AUTO] : 基于 new layout result 消息生成 customLayoutMap 数据,并diff对比更新数据
222
203
  *
223
204
  * @param { ILayoutRoster[] } totalLayoutResultList - layout数据
224
205
  */
225
206
  createAutoLayout(totalLayoutResultList: ILayoutRoster[]): void;
207
+ /**
208
+ * 计算自动轮询layout数据
209
+ */
210
+ createAutoPollingLayout(): void;
226
211
  /**
227
212
  * 创建Layout
228
213
  */
229
214
  createLayout(): void;
215
+ sendContentRosterMessage(): void;
216
+ /**
217
+ * Roster 排序
218
+ */
219
+ calculateSortedRosterList(): IRoster[];
230
220
  /**
231
- * roster 排序
221
+ * 设置焦点画面Roster
232
222
  */
233
- calculateOrderRosterList(): IRoster[];
223
+ private setFocusRoster;
234
224
  /**
235
- * 缓存主画面信息
225
+ * 缓存主画面信息, 并请流
236
226
  *
237
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
227
+ * @param { string } rosterId - 指定切换到主画面的RosterId
228
+ * @param { FocusViewKind } kind - 来源
229
+ * @param { IRoster | null } roster - 焦点画面roster
238
230
  */
239
- private handleFocusViewConfig;
231
+ private handleFocusView;
240
232
  /**
241
- * 计算 custom layout 数据
233
+ * 更新焦点画面参数
234
+ *
235
+ * @param { FocusViewConfig } config - 焦点画面参数
236
+ */
237
+ private updateFocusViewConfig;
238
+ /**
239
+ * 更新Template Rate模版容器比例配置
240
+ *
241
+ * @param { { next: number; previous: number } } rate - 容器比例
242
242
  */
243
- private customLayoutCalculator;
243
+ updateTemplateRate(rate: {
244
+ next: number;
245
+ previous: number;
246
+ }): void;
244
247
  /**
245
248
  * [AUTO] 1. 初始化Layout数据
246
249
  */
@@ -259,7 +262,7 @@ export default class LayoutManager {
259
262
  /**
260
263
  * 计算Layout Container的容器信息
261
264
  */
262
- calculateScreenInfo(): void;
265
+ calculateScreenInfo(): this;
263
266
  /**
264
267
  * 计算Layout Container的容器信息
265
268
  *
@@ -268,7 +271,10 @@ export default class LayoutManager {
268
271
  */
269
272
  private getTemplateScreenInfo;
270
273
  /**
271
- * [AUTO] 2.创建LayoutMap, 移除无效Layout
274
+ * 2.创建LayoutMap, 移除无效Layout
275
+ *
276
+ * 普通模式下:list id类似roster id字段
277
+ * 轮询模式下:存在画面重复渲染、无符合条件终端(roster为空)等设备,需要合并数据
272
278
  */
273
279
  private createBaseLayout;
274
280
  /**
@@ -283,20 +289,22 @@ export default class LayoutManager {
283
289
  */
284
290
  private clearInvalidLayout;
285
291
  /**
286
- * [AUTO | CUSTOM] 使用最新的 videoTrackList 和 layoutResults 数据更新 layout 内容
292
+ * 基于最新的 videoTrackList 和 layoutResults 数据更新MediaStream内容
287
293
  *
288
- * @param { boolean } isAutoSendLayout - 是否上报Layout信息
294
+ * @param { boolean } isAutoSendLayout - 是否上报LayoutList信息,默认是true,上报信息
289
295
  */
290
296
  updateStreams(isAutoSendLayout?: boolean): void;
291
297
  /**
292
- * 清理失效的 video manager 数据
298
+ * 通过TrackId找到VideoStream和AudioStream
299
+ *
300
+ * @param { string } videoTrackId - VideoTrackId
301
+ * @return { ResultVideoStream } 返回查找到的VideoStream数据
293
302
  */
294
- clearInvalidVideoManagers(): void;
295
303
  private getVideoStreamByTrackId;
296
304
  /**
297
305
  * [AUTO] 计算位置信息
298
306
  */
299
- calculatePosition(): void;
307
+ calculatePosition(): this;
300
308
  /**
301
309
  * 计算位置信息
302
310
  *
@@ -308,11 +316,9 @@ export default class LayoutManager {
308
316
  /**
309
317
  * [AUTO] 计算旋转信息
310
318
  */
311
- calculateRotate(): void;
319
+ calculateRotate(): this;
312
320
  /**
313
321
  * [CUSTOM_LAYOUT] 合并自定义布局旋转信息
314
- *
315
- * @public
316
322
  */
317
323
  calculateCustomLayoutRotate(): void;
318
324
  /**
@@ -323,16 +329,17 @@ export default class LayoutManager {
323
329
  */
324
330
  private getLayoutByRotationId;
325
331
  /**
326
- * 【内部方法】停止轮询时,清理无效的 videoManager 数据
332
+ * 根据roster信息计算请流信息, 对话模式仅支持对称布局
327
333
  *
328
- * @param monitoryList callUri list 数据
334
+ * 对话模式不支持翻页,最多显示9画面,所以从20路roster获取符合条件的roster即可
329
335
  */
330
- clearVideoManagersUseMonitorList(monitoryList: string[]): void;
336
+ private calcRequestNewLayoutByRoster;
331
337
  /**
332
338
  * 通过旋转信息获取在layout中的位置
333
339
  *
334
- * @param pid peopleId
335
- * @param mediagroupid type
340
+ * @param { number } pid - 参会者Pid
341
+ * @param { number } mid - 参会者当前通道类型,0/1等
342
+ * @return { string } LayoutId或者RosterId
336
343
  */
337
344
  private getLayoutKeyByRotateInfo;
338
345
  /**
@@ -344,12 +351,6 @@ export default class LayoutManager {
344
351
  * @returns { resolutionLevel }
345
352
  */
346
353
  private convertResolutionLevel;
347
- /**
348
- * 是否是主会场模式(远端设置为主会场)
349
- *
350
- * @returns
351
- */
352
- private isChairmanMode;
353
354
  /**
354
355
  * 镜像显示Local画面
355
356
  */
@@ -361,17 +362,29 @@ export default class LayoutManager {
361
362
  /**
362
363
  * 退出全屏
363
364
  */
364
- private exitFullScreen;
365
+ exitFullScreen(): void;
366
+ /**
367
+ * 设置布局相关配置
368
+ *
369
+ * @param { LayoutConfig } config
370
+ */
371
+ setLayoutConfig(config: LayoutConfig): void;
372
+ /**
373
+ * 发布 自动布局/自定义布局 layout布局信息(参会人最新的布局列表数据)
374
+ *
375
+ * @param { boolean } isDealAvatar - 是否处理layout头像, 启用相关配置后,默认处理
376
+ */
377
+ sendLayoutMessage(isDealAvatar?: boolean): void;
365
378
  /**
366
379
  * 查找对应的roster
367
380
  *
368
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
381
+ * @param { string } id - Roster Id
369
382
  * @param { ILayoutRoster[]} list - layout list
370
383
  * @returns
371
384
  */
372
385
  private findRosterById;
373
386
  /**
374
- * 销毁LayoutManager资源
387
+ * 销毁资源
375
388
  */
376
389
  destroy(): void;
377
390
  }
@@ -0,0 +1,270 @@
1
+ /**
2
+ * XYWebRTC Layout Type Defined
3
+ *
4
+ * Created at : 2024-06-04 16:04:55
5
+ * Last modified : 2024-06-04 16:47:00
6
+ */
7
+ import { XYLayoutState } from '../render/videoManager.type';
8
+ import { AutoState } from '../../type/polling';
9
+ /**
10
+ * 设备类型
11
+ */
12
+ export type XYDeviceType = 'webrtc' | 'soft' | 'hard' | 'nemono' | 'virtualnemo' | 'nemo' | 'tvbox' | 'h323' | 'record' | 'bruce' | 'tel' | 'pstngw' | 'desk';
13
+ /**
14
+ * Layout头像类型
15
+ *
16
+ * @param NONE -1 - 无头像
17
+ * @param TEXT 0 - 名称头像
18
+ * @param IMAGE 1 - 人物头像
19
+ */
20
+ export declare enum LayoutAvatarType {
21
+ NONE = -1,
22
+ TEXT = 0,
23
+ IMAGE = 1
24
+ }
25
+ /**
26
+ * 视频关闭原因
27
+ *
28
+ * @param MuteByUser - 用户自己关闭
29
+ * @param MuteByBWLimit - 带宽限制
30
+ * @param MuteByNoInput - 没有视频输入
31
+ * @param MuteByConfMgmt - 会控关闭
32
+ * @param MuteByDeviceDetection - 设备探测
33
+ * @param MuteByPhoneCall - 电话占用
34
+ */
35
+ export declare enum MuteReason {
36
+ MuteByUser = 0,
37
+ MuteByBWLimit = 1,
38
+ MuteByNoInput = 2,
39
+ MuteByConfMgmt = 3,
40
+ MuteByDeviceDetection = 4,
41
+ MuteByPhoneCall = 5
42
+ }
43
+ /**
44
+ * Layout Result布局结果中返回的基础数据
45
+ *
46
+ * @property { number } participantId 参会者id
47
+ * @property { 0 | 1 } mediagroupid 参会者画面类型,0:people画面,1:共享内容画面
48
+ * @property { string } remoteType 设备类型
49
+ * @property { string } remoteName 参会者名称
50
+ * @property { string } videoTrackId 当前参会者画面Track轨道id,用于在 VideoTrackList 中匹配stream数据
51
+ * @property { boolean } isAudioMute 参会者麦克风状态,true:开启,false:关闭
52
+ * @property { boolean } isVideoMute 参会者摄像头状态,true:开启,false:关闭
53
+ * @property { boolean } isActiveSpeaker 参会者是否是语音激励,即当前会中说话声音最大的一个人
54
+ * @property { number } LayoutVideoState 参会者画面的状态:请求中,正常,电话入会,视频暂停等
55
+ * @property { number } MuteReason 视频关闭原因
56
+ * @property { number } extUserId 参会者ID
57
+ * @property { string } calluri 参会者Url
58
+ * @property { number } ExpectHeight 期望分辨率
59
+ * @property { number } ExpectWidth 期望分辨率
60
+ * @property { number } feccOri ignore
61
+ */
62
+ export interface ILayoutRoster {
63
+ participantId: number;
64
+ mediagroupid: number;
65
+ remoteType: string;
66
+ remoteName: string;
67
+ videoTrackId: string;
68
+ isAudioMute: boolean;
69
+ isVideoMute: boolean;
70
+ isActiveSpeaker: boolean;
71
+ LayoutVideoState: number;
72
+ MuteReason: MuteReason;
73
+ extUserId: string;
74
+ calluri: string;
75
+ ExpectHeight: number;
76
+ ExpectWidth: number;
77
+ feccOri: number;
78
+ }
79
+ /**
80
+ * Roster:参会者的基本信息,包含基本信息,设备信息,画面信息等
81
+ *
82
+ * @property { string } key 内部Key,包含参会者endpointId、多分组通道信息,由一定规则生成;
83
+ * @property { IDeviceType } deviceType 设备类型
84
+ * @property { string } endpointId 设备ID
85
+ * @property { string } displayName 参会者名称
86
+ * @property { number } mediagroupid 参会者画面类型,0:people画面,1:共享内容画面
87
+ * @property { number } participantId 参会者人员临时ID,迁会之后此ID会发生变化
88
+ * @property { boolean } audioTxMute 参会者麦克风状态,true:开启,false:关闭
89
+ * @property { boolean } videoTxMute 参会者摄像头状态,true:开启,false:关闭
90
+ * @property { boolean } isForceFullScreen 参会者是否是主画面
91
+ * @property { boolean } isFocusScreen 参会者是否是焦点画面
92
+ * @property { number } videoMuteReason 视频关闭原因
93
+ * @property { boolean } isContent 参会者画面类型,同mediagroupid,true:是共享内容画面,false:people画面
94
+ * @property { boolean } isActiveSpeaker 参会者是否是语音激励,即当前会中说话声音最大的一个人
95
+ * @property { boolean } isLocal 是否是Local设备
96
+ * @property { boolean } audioRxMute ignore
97
+ * @property { boolean } videoRxMute ignore
98
+ * @property { boolean } onHold ignore
99
+ * @property { boolean } isLastAdd ignore
100
+ * @property { boolean } isPolling ignore
101
+ */
102
+ export interface IRoster extends Partial<ILayoutRoster> {
103
+ key: string;
104
+ deviceType: XYDeviceType;
105
+ endpointId: string;
106
+ displayName: string;
107
+ mediagroupid: number;
108
+ participantId: number;
109
+ audioTxMute: boolean;
110
+ videoTxMute: boolean;
111
+ audioRxMute: boolean;
112
+ videoRxMute: boolean;
113
+ videoMuteReason: number;
114
+ isForceFullScreen: boolean;
115
+ isFocusScreen: boolean;
116
+ isLastAdd: boolean;
117
+ onHold: boolean;
118
+ isPolling: boolean;
119
+ isContent: boolean;
120
+ isActiveSpeaker: boolean;
121
+ isLocal?: boolean;
122
+ }
123
+ /**
124
+ * 布局对象
125
+ *
126
+ * @property { string } id - Layout ID
127
+ * @property { IRoster } roster - 参会者基本信息、状态信息,例如:用户名、麦克风/摄像头状态、是否是主会场等信息
128
+ * @property { XYLayoutState } state - 当前参会者的画面状态信息
129
+ * @property { IRotateStyle | null } rotate - 当前参会者的旋转信息,用于设置video标签样式
130
+ * @property { IRotationInfoTotalItem | null } rotationInfo - 当前参会者的旋转信息
131
+ * @property { LayoutAvatar | null } avatar - 头像, 如未在setFeatureConfig配置相关参数,则返回null
132
+ * @property { string } textAvatar - 文字头像
133
+ * @property { XYPositionStyle } positionStyle - Layout成员布局位置样式
134
+ * @property { boolean } isMirror - 是否是镜像画面
135
+ * @property { ExternalTemplateConfig } templateConfig - 模版额外配置
136
+ * @property { number[] } position - 位置坐标,分别是左,上,宽,高
137
+ * @property { XYPositionInfo } positionInfo - Layout成员布局位置 分别是:宽、高
138
+ * @property { number } index - 索引值
139
+ * @property { AutoState } pollingState - 轮询多画面状态
140
+ * @property { string } pollingName - 多画面名称
141
+ * @property { number } resolution - 忽略, 2.0.2以前的版本 自定义布局roster请流使用
142
+ * @property { number } quality - 忽略, 2.0.2以前的版本 自定义布局roster请流使用
143
+ * @property { boolean } deal - 是否处理此数据
144
+ */
145
+ export interface ILayout {
146
+ id: string;
147
+ roster: IRoster | null;
148
+ state: XYLayoutState;
149
+ rotate: IRotateStyle | null;
150
+ rotationInfo: IRotationInfoTotalItem | null;
151
+ avatar: LayoutAvatar | null;
152
+ textAvatar?: string;
153
+ positionStyle?: XYPositionStyle;
154
+ isMirror?: boolean;
155
+ templateConfig?: ExternalTemplateConfig;
156
+ position?: number[];
157
+ positionInfo?: XYPositionInfo;
158
+ index?: number;
159
+ pollingState?: AutoState;
160
+ pollingName?: string;
161
+ resolution?: number;
162
+ quality?: number;
163
+ deal?: boolean;
164
+ }
165
+ /**
166
+ * Layout成员布局位置
167
+ * 分别是:宽、高
168
+ *
169
+ * @property { number } width - 当前画面的宽度
170
+ * @property { number } height - 当前画面的高度
171
+ */
172
+ export interface XYPositionInfo {
173
+ width: number;
174
+ height: number;
175
+ }
176
+ /**
177
+ * Layout成员布局位置样式
178
+ * 分别是:左、上、宽、高
179
+ *
180
+ * @property { string } left - 当前画面距离左的像素位置
181
+ * @property { string } top - 当前画面距离上的像素位置
182
+ * @property { string } width - 当前画面宽度,单位px
183
+ * @property { string } height - 当前画面高度,单位px
184
+ *
185
+ */
186
+ export interface XYPositionStyle {
187
+ left: string;
188
+ top: string;
189
+ width: string;
190
+ height: string;
191
+ }
192
+ /**
193
+ * Video元素旋转样式
194
+ *
195
+ * @property { string } transform - Video元素选转角度:rotateZ(${n}deg)
196
+ * @property { string } width - Video元素的宽:${n}px
197
+ * @property { string } height - Video元素的高:${n}px
198
+ */
199
+ export interface IRotateStyle {
200
+ transform?: string;
201
+ width?: string;
202
+ height?: string;
203
+ }
204
+ /**
205
+ * 画面屏幕旋转信息
206
+ *
207
+ * @property { number } height - 高度
208
+ * @property { number } width - 宽度
209
+ * @property { number } participantId - 用户id
210
+ * @property { number } rotation - 旋转角度
211
+ * @param 0 | 1 不需要旋转
212
+ * @param 2 顺时针旋转180度
213
+ * @param 3 顺时针旋转270度
214
+ */
215
+ export interface IRotationInfoItem {
216
+ height: number;
217
+ width: number;
218
+ participantId: number;
219
+ rotation: number;
220
+ }
221
+ /**
222
+ * 缓存content+people的屏幕旋转信息数据
223
+ *
224
+ * @property { number } mediagroupid 画面类型:people/content
225
+ * @property { string } id 用户id
226
+ */
227
+ export interface IRotationInfoTotalItem extends IRotationInfoItem {
228
+ mediagroupid: number;
229
+ id: string;
230
+ }
231
+ /**
232
+ * 缓存媒体下发的屏幕旋转信息
233
+ *
234
+ * @property { IRotationInfoItem[] } content content共享内容的旋转信息
235
+ * @property { IRotationInfoItem[] } people people的旋转信息
236
+ * @property { IRotationInfoTotalItem[] } total content+people的旋转信息
237
+ */
238
+ export interface IRotationInfo {
239
+ content: IRotationInfoItem[];
240
+ people: IRotationInfoItem[];
241
+ total: IRotationInfoTotalItem[];
242
+ }
243
+ /**
244
+ * 头像
245
+ *
246
+ * @property { LayoutAvatarType } type - 头像类型,名称头像、人物头像
247
+ * @property { string } value - 内容
248
+ */
249
+ export interface LayoutAvatar {
250
+ type: LayoutAvatarType;
251
+ value: string;
252
+ }
253
+ /**
254
+ * 模版额外配置
255
+ *
256
+ * @property { string } id - templateId (模版名称_画面数量_第几个画面)
257
+ * @property { boolean } isPIP - 是否在画中画
258
+ * @property { boolean } isRotate - 是否要适配旋转
259
+ * @property { number } zIndex - 层级
260
+ * @property { Record<string, string | number> } customStyle - 自定义样式
261
+ * @property { boolean } isMain - 是否是大画面
262
+ */
263
+ export interface ExternalTemplateConfig {
264
+ id?: string;
265
+ isPIP?: boolean;
266
+ isRotate?: boolean;
267
+ zIndex?: number;
268
+ customStyle?: Record<string, string | number>;
269
+ isMain?: boolean;
270
+ }