@xylink/xy-rtc-sdk 3.9.1-beta.6 → 3.9.3

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.
@@ -3,6 +3,7 @@ import VideoManager from '../main/videoManager';
3
3
  import { IInternals, StreamResolution, StreamResolutionLevel, VideoQuality } from './stream';
4
4
  import { SupportLocalLanguages } from '../enum';
5
5
  import { ICloudRoomConfig } from './meeting';
6
+ import { ContentTemplateMode, ExternalTemplateConfig, TemplateMode } from './layout';
6
7
  /**
7
8
  * 向Client推送流类型
8
9
  *
@@ -63,27 +64,6 @@ export type IVideoLoadStatus = 'LOAD_START' | 'CANPLAY' | 'ERROR';
63
64
  * @param REQUEST 视频请求中
64
65
  */
65
66
  export type IVideoManagerState = '' | 'CANPLAY' | 'ENDED' | 'REQUEST';
66
- /**
67
- * Layout布局方式
68
- *
69
- * @param SPEAKER 默认值,演讲者模式,即 1大N小 画面模式
70
- * @param GALLERY 另一种是画廊模式,即 宫格布局
71
- */
72
- export type ITemplateMode = 'SPEAKER' | 'GALLERY';
73
- /**
74
- * 主画面/Content布局模式
75
- *
76
- * @param MULTI_PIC_CONTENT_HIGH_PRIORITY Content是大窗口
77
- * @param MULTI_PIC_ACTIVE_HIGH_PRIORITY ActiveSpeaker是大窗口
78
- * @param TWO_PIC_PIP 画中画模式(picture in picture)
79
- * @param CONTENT_ONLY 只显示Content
80
- * @param TWO_PIC_SYMMETRIC 对称显示content和speaker(side by side)
81
- */
82
- export type IContentTemplateMode = 'MULTI_PIC_CONTENT_HIGH_PRIORITY' | 'MULTI_PIC_ACTIVE_HIGH_PRIORITY' | 'TWO_PIC_PIP' | 'CONTENT_ONLY' | 'TWO_PIC_SYMMETRIC';
83
- /**
84
- * 布局模式
85
- */
86
- export type IMode = ITemplateMode | IContentTemplateMode;
87
67
  /**
88
68
  * 客户端状态
89
69
  *
@@ -276,12 +256,11 @@ export type IFacingMode = keyof typeof FacingMode;
276
256
  * @property { string } container.elementId 非必填 | "" | 配置Layout需要包裹在elementId元素里面显示,并使用此元素的信息计算 Layout 的 size和 position
277
257
  * @property { boolean } localHide 非必填 | false | 是否在页面上隐藏Local画面,默认不隐藏
278
258
  * @property { boolean } localMirror 非必填 | true | 是否需要镜像Local画面,默认镜像Local
279
- * @property { ITemplateMode } templateMode 非必填 | 布局模式,默认:SPEAKER,1大N小 画面布局模式,可选:SPEAKER | GALLERY
259
+ * @property { TemplateMode } templateMode 非必填 | 布局模式,默认:SPEAKER,1大N小 画面布局模式,可选:SPEAKER | GALLERY
280
260
  * @property { string } __hideId 是否是隐身入会模式,hide代表隐身入会,为空代表正常模式
281
261
  * @property { string } __monitorMode 是否是巡课模式,默认是'',MONITOR代表巡课模式
282
262
  * @property { boolean } isThird 埋点
283
263
  * @property { boolean } isSupportHybridCloud 是否是混合云,默认公有云。 如果有探测到内网地址,则此值为true,将不进行鉴权。
284
- * @property { boolean } isVerifyMeetingId 是否校验会议号,默认校验
285
264
  * @property { boolean? } checkSSL 是否启用必须使用Https协议访问页面,默认启用,设置为true,建议开启,Http页面下无法访问WebRTC API,音视频互通存在问题;
286
265
  *
287
266
  */
@@ -303,69 +282,22 @@ export interface IClientConfig {
303
282
  };
304
283
  localHide?: boolean;
305
284
  localMirror?: boolean;
306
- templateMode?: ITemplateMode;
285
+ templateMode?: TemplateMode;
307
286
  __hideId?: number | string;
308
287
  __monitorMode?: string;
309
288
  isThird?: boolean;
310
289
  isSupportHybridCloud?: boolean;
311
- isVerifyMeetingId?: boolean;
312
290
  checkSSL?: boolean;
313
291
  }
314
292
  export interface ILayoutParams {
315
293
  rosters: IRoster[];
316
294
  speakerInfo: ISpeakerInfo;
317
295
  layout: ILayout[];
318
- templateMode: ITemplateMode;
296
+ templateMode: TemplateMode | ContentTemplateMode;
319
297
  invite: IInvite;
320
298
  contentSenderPid: number;
321
299
  localHide: boolean;
322
300
  }
323
- /**
324
- * Layout 模版 分辨率
325
- *
326
- * @property { StreamResolutionLevel } normal 默认请流分辨率
327
- * @property { StreamResolutionLevel } low 低性能请流分辨率
328
- * @property { StreamResolutionLevel } high 高分辨率
329
- */
330
- export interface ITemplateResolution {
331
- normal: StreamResolutionLevel;
332
- low: StreamResolutionLevel;
333
- high?: StreamResolutionLevel;
334
- }
335
- /**
336
- * Layout模版定义
337
- *
338
- * @property { number[] } position - 位置/尺寸比例
339
- * @property { ITemplateResolution } resolution - 分辨率
340
- * @property { number } resolution.normal - 正常分辨率
341
- * @property { number } resolution.low - 低性能模式分辨率
342
- * @property { number ?} resolution.high - 高分辨率
343
- * @property { VideoQuality } quality - 请流质量
344
- * @property { number } zIndex - 层级
345
- * @property { string } type - 类型,LOCAL/CONTENT
346
- */
347
- export type ITemplateObj = {
348
- position: number[];
349
- resolution: ITemplateResolution;
350
- quality?: VideoQuality;
351
- zIndex?: number;
352
- type?: string;
353
- };
354
- export interface ITypeTemplate {
355
- [id: string]: ITemplateObj[];
356
- }
357
- export interface ITemplateInfo {
358
- length: number;
359
- temp: {
360
- [index: string]: ITemplateObj[];
361
- };
362
- rate: {
363
- [index: number]: number;
364
- };
365
- }
366
- export interface ITemplate {
367
- [type: string]: ITemplateInfo;
368
- }
369
301
  /**
370
302
  * @enum 默认常量列表
371
303
  */
@@ -391,10 +323,9 @@ export interface IDefault {
391
323
  LOGIN_INFO: {
392
324
  callUri: string;
393
325
  securityKey: string;
394
- access_token: string;
395
- refresh_token: string;
396
326
  id: number;
397
327
  displayName: string;
328
+ token: IToken;
398
329
  };
399
330
  LAYOUT: ILayout;
400
331
  MAP_RESOLUTION_STRING: {
@@ -424,8 +355,7 @@ export interface IDefault {
424
355
  export interface ILoginInfo {
425
356
  callUri?: string;
426
357
  securityKey: string;
427
- access_token: string;
428
- refresh_token?: string;
358
+ token: IToken;
429
359
  id: number;
430
360
  displayName?: string;
431
361
  cellPhone?: string;
@@ -548,9 +478,9 @@ export interface IHttpConfig {
548
478
  *
549
479
  * 此信息是由业务层提供网关配置
550
480
  */
551
- export interface IConfig extends IToken {
552
- client_id: string;
553
- client_secret: string;
481
+ export interface LoginTokenInfo extends IToken {
482
+ clientId: string;
483
+ clientSecret: string;
554
484
  }
555
485
  /**
556
486
  * 会议室配置信息
@@ -574,7 +504,6 @@ export interface IConfAuxProperties {
574
504
  * @property { string } avatar 头像
575
505
  * @property { InviteInfo } inviteInfo 会议分享信息,包含会议邀请链接、电话,WebRTC、终端等端的入会方式;
576
506
  * @property { string } meetingId 当前会议ID
577
- * @property { string } displayNum 显示的会议号
578
507
  */
579
508
  export interface IConferenceInfo {
580
509
  callNumber?: string;
@@ -638,12 +567,16 @@ export interface InviteInfo {
638
567
  * @property { string } confNumber 云会议号/终端号/手机号
639
568
  * @property { string? } password 入会密码,没有则为空
640
569
  * @property { string? } displayName 入会显示昵称
570
+ * @property { boolean } muteAudio 非必填 | false | 是否开启/关闭麦克风入会,默认是false,开启麦克风
571
+ * @property { boolean } muteVideo 非必填 | false | 是否开启/关闭摄像头入会,默认是false,开启摄像头
641
572
  */
642
573
  export interface IMackCall {
643
574
  token: string;
644
575
  confNumber: string;
645
576
  password?: string;
646
577
  displayName?: string;
578
+ muteAudio?: boolean;
579
+ muteVideo?: boolean;
647
580
  }
648
581
  /**
649
582
  * 呼叫的会议信息
@@ -688,6 +621,16 @@ export interface IGroupInfo {
688
621
  groupName: string;
689
622
  groupType: number;
690
623
  }
624
+ /**
625
+ * 会议模式
626
+ *
627
+ * @param DIALOG - 对话模式
628
+ * @param NORMAL - 非对话模式
629
+ */
630
+ export declare enum ConferenceMode {
631
+ DIALOG = "dialog",
632
+ NORMAL = "normal"
633
+ }
691
634
  /**
692
635
  * 会控回调信息
693
636
  *
@@ -702,6 +645,7 @@ export interface IGroupInfo {
702
645
  * @property { string } commonJson 会控修改名称等
703
646
  * @property { IMuteSpeaker } isMuteSpeaker 禁止收听
704
647
  * @property { boolean } recordIsDisabled 录制权限
648
+ * @property { ConferenceMode } conferenceMode 会议模式
705
649
  */
706
650
  export interface IMeetingControl {
707
651
  callIndex: number;
@@ -716,6 +660,7 @@ export interface IMeetingControl {
716
660
  isMuteSpeaker: IMuteSpeaker;
717
661
  recordIsDisabled: boolean;
718
662
  groupInfoList: IGroupInfo[];
663
+ conferenceMode: ConferenceMode;
719
664
  }
720
665
  /**
721
666
  * Roster:参会者的基本信息,包含基本信息,设备信息,画面信息等
@@ -860,39 +805,42 @@ export interface ISpeakerInfo {
860
805
  /**
861
806
  * 布局对象
862
807
  *
863
- * @property { number[] } position 模版位置,业务层可以忽略
864
- * @property { StreamResolutionLevel } resolution 当前布局对象的分辨数据
865
808
  * @property { IRoster } roster 参会者基本信息、状态信息,例如:用户名、麦克风/摄像头状态、是否是主会场等信息
866
- * @property { any } rotate 当前参会者的旋转信息
867
809
  * @property { ILayoutState } state 当前参会者的画面状态信息,暂时未使用
810
+ * @property { any } rotate 当前参会者的旋转信息,用于设置video标签样式
868
811
  * @property { { left: string; top: string; width: string; height: string } } positionStyle 当前参会者的位置样式
812
+ * @property { string } avatar 人物头像
813
+ * @property { string } textAvatar 名称头像
814
+ * @property { ExternalTemplateConfig } templateConfig 忽略
869
815
  * @property { { width: number; height: number } } positionInfo 忽略
870
- * @property { 0 | 100 | 200 } quality 质量
816
+ * @property { number[] } position 忽略
871
817
  * @property { boolean } deal 忽略
872
- * @property { number } zIndex 忽略
818
+ * @property { number } index 忽略
819
+ * @property { number } resolution 忽略, 2.0.2以前的版本 自定义布局roster请流使用
820
+ * @property { number } quality 忽略, 2.0.2以前的版本 自定义布局roster请流使用
873
821
  */
874
822
  export interface ILayout {
875
- position?: number[];
876
- resolution?: StreamResolutionLevel;
877
823
  roster: IRoster;
878
- rotate?: any;
879
824
  state?: ILayoutState;
825
+ rotate?: any;
880
826
  positionStyle?: {
881
827
  left: string;
882
828
  top: string;
883
829
  width: string;
884
830
  height: string;
885
831
  };
832
+ avatar?: string;
833
+ textAvatar?: string;
834
+ templateConfig?: ExternalTemplateConfig;
835
+ position?: number[];
886
836
  positionInfo?: {
887
837
  width: number;
888
838
  height: number;
889
839
  };
890
- quality?: 0 | 100 | 200;
891
840
  deal?: boolean;
892
- zIndex?: number;
893
- avatar?: string;
894
- textAvatar?: string;
895
841
  index?: number;
842
+ resolution?: number;
843
+ quality?: number;
896
844
  }
897
845
  /**
898
846
  * Local布局对象
@@ -1,17 +1,5 @@
1
1
  import { ILayout } from './client';
2
- /**
3
- * 模板对应位置类型
4
- *
5
- * @enum
6
- * @param {LOCAL} LOCAL - 本地
7
- * @param {CONTENT} CONTENT - 共享画面
8
- * @param {PEOPLE} PEOPLE - 非共享画面
9
- */
10
- export declare enum TemplateType {
11
- LOCAL = "LOCAL",
12
- CONTENT = "CONTENT",
13
- PEOPLE = "PEOPLE"
14
- }
2
+ import { StreamResolutionLevel, VideoQuality } from './stream';
15
3
  /**
16
4
  * Layout头像类型
17
5
  *
@@ -28,3 +16,180 @@ export declare enum LayoutAvatarType {
28
16
  * Layout map
29
17
  */
30
18
  export type TLayoutMap = Map<string, ILayout>;
19
+ /**
20
+ * 模版类型
21
+ */
22
+ export type IMode = `${TemplateMode | ContentTemplateMode}`;
23
+ /**
24
+ * 【AUTO】模版类型
25
+ *
26
+ * @param SPEAKER - 演讲者模式,即 1大N小 画面模式
27
+ * @param GALLERY - 画廊模式,即 宫格布局
28
+ */
29
+ export declare enum TemplateMode {
30
+ SPEAKER = "SPEAKER",
31
+ GALLERY = "GALLERY"
32
+ }
33
+ /**
34
+ * 【AUTO】Content布局模式
35
+ *
36
+ * @param MULTI_PIC_CONTENT_HIGH_PRIORITY - 缩略视图, Content是大窗口
37
+ * @param MULTI_PIC_ACTIVE_HIGH_PRIORITY - 缩略共享, ActiveSpeaker是大窗口
38
+ * @param TWO_PIC_PIP - 共享视图, 画中画模式(picture in picture)
39
+ * @param CONTENT_ONLY - 共享全视图, 只显示Content
40
+ * @param TWO_PIC_SYMMETRIC - 共享+演讲, 对称显示content和speaker(side by side)
41
+ */
42
+ export declare enum ContentTemplateMode {
43
+ MULTI_PIC_CONTENT_HIGH_PRIORITY = "MULTI_PIC_CONTENT_HIGH_PRIORITY",
44
+ MULTI_PIC_ACTIVE_HIGH_PRIORITY = "MULTI_PIC_ACTIVE_HIGH_PRIORITY",
45
+ TWO_PIC_PIP = "TWO_PIC_PIP",
46
+ CONTENT_ONLY = "CONTENT_ONLY",
47
+ TWO_PIC_SYMMETRIC = "TWO_PIC_SYMMETRIC"
48
+ }
49
+ /**
50
+ * 模板对应位置类型
51
+ *
52
+ * @enum
53
+ * @param LOCAL - 本地
54
+ * @param CONTENT - 共享画面
55
+ * @param PEOPLE - 非共享画面
56
+ * @param CHAIRMAN - 主会场
57
+ */
58
+ export declare enum TemplateType {
59
+ LOCAL = "LOCAL",
60
+ CONTENT = "CONTENT",
61
+ PEOPLE = "PEOPLE",
62
+ CHAIRMAN = "CHAIRMAN",
63
+ NONE = "NONE"
64
+ }
65
+ /**
66
+ * Layout 模版 分辨率
67
+ *
68
+ * @property { StreamResolutionLevel } normal 默认请流分辨率
69
+ * @property { StreamResolutionLevel } low 低性能请流分辨率
70
+ * @property { StreamResolutionLevel } high 高分辨率
71
+ */
72
+ export interface ITemplateResolution {
73
+ normal: StreamResolutionLevel;
74
+ low: StreamResolutionLevel;
75
+ high?: StreamResolutionLevel;
76
+ }
77
+ /**
78
+ * 模版额外配置
79
+ *
80
+ * @property { string } id - templateId (模版名称_画面数量_第几个画面)
81
+ * @property { boolean } isPIP - 是否在画中画
82
+ * @property { boolean } isRotate - 是否要适配旋转
83
+ * @property { number } zIndex - 层级
84
+ * @property { Record<string, string | number> } customStyle - 自定义样式
85
+ */
86
+ export interface ExternalTemplateConfig {
87
+ id?: string;
88
+ isPIP?: boolean;
89
+ isRotate?: boolean;
90
+ zIndex?: number;
91
+ customStyle?: Record<string, string | number>;
92
+ }
93
+ /**
94
+ * Layout模版定义
95
+ *
96
+ * @property { number[] } position - 位置/尺寸比例
97
+ * @property { ITemplateResolution } resolution - 分辨率
98
+ * @property { number } resolution.normal - 正常分辨率
99
+ * @property { number } resolution.low - 低性能模式分辨率
100
+ * @property { number } resolution.high - 高分辨率
101
+ * @property { VideoQuality } quality - 请流质量
102
+ * @property { TemplateType } type - 类型,LOCAL/CONTENT/PEOPLE/CHAIRMAN
103
+ * @property { any } config - 额外配置项 eg: zIndex - 层级
104
+ * @property { string } calluri - 指定请流的callUri
105
+ */
106
+ export type ITemplateObj = {
107
+ position: number[];
108
+ resolution: ITemplateResolution;
109
+ quality?: VideoQuality;
110
+ type?: TemplateType;
111
+ config?: ExternalTemplateConfig;
112
+ calluri?: string;
113
+ };
114
+ /**
115
+ * 模版信息
116
+ */
117
+ export type ITemplate = Partial<{
118
+ [type in TemplateMode | ContentTemplateMode]: TemplateInfos;
119
+ }>;
120
+ export interface TemplateInfos {
121
+ temp: {
122
+ [id: string]: ITemplateObj[];
123
+ };
124
+ rate: {
125
+ [index: number]: number;
126
+ };
127
+ }
128
+ /**
129
+ * 最终匹配的模版数据
130
+ *
131
+ * @param { ITemplateObj[] } template 模版信息
132
+ * @param { number } rate 容器比例
133
+ */
134
+ export interface TemplateInfo {
135
+ template: ITemplateObj[];
136
+ rate: number;
137
+ }
138
+ /**
139
+ * 获取模版配置参数
140
+ *
141
+ * @param { TemplateMode | ContentTemplateMode } modeType - 模版类型
142
+ * @param { number } currentCount - 画面数量
143
+ * @param { number } participantCount - 会中总人数
144
+ * @param { boolean } isEnableHideLocalView - 是否隐藏本地画面模式
145
+ * @param { boolean } isChairmanMode - 是否是主会场模式
146
+ * @param { boolean } isInDialogMode - 是否是对话模式布局
147
+ * @param { TemplateType } templateType - 全屏画面类型
148
+ * @param { LayoutOrientationType } orientation - 是否是移动端,及方向
149
+ * @param { FocusViewConfig } focusViewConfig - 切换的主画面信息
150
+ */
151
+ export interface TemplateParams {
152
+ modeType?: TemplateMode | ContentTemplateMode;
153
+ currentCount?: number;
154
+ participantCount?: number;
155
+ isEnableHideLocalView?: boolean;
156
+ isChairmanMode?: boolean;
157
+ isInDialogMode?: boolean;
158
+ templateType?: TemplateType;
159
+ orientation?: LayoutOrientationType;
160
+ focusViewConfig?: FocusViewConfig;
161
+ }
162
+ /**
163
+ * Layout 移动端布局方向
164
+ *
165
+ * @param NONE -1 - 默认布局(PC)
166
+ * @param MOBILE_HORIZONTAL 0 - 移动端横屏布局
167
+ * @param MOBILE_VERTICAL 1 - 移动端竖屏布局
168
+ */
169
+ export declare enum LayoutOrientationType {
170
+ NONE = -1,
171
+ MOBILE_HORIZONTAL = 0,
172
+ MOBILE_VERTICAL = 1
173
+ }
174
+ /**
175
+ * 指定的主画面的信息
176
+ *
177
+ * @property { string } id - 指定的主画面的LayoutId
178
+ * @property { TemplateType } type - 画面类型
179
+ */
180
+ export interface FocusViewConfig {
181
+ id: string;
182
+ type: TemplateType;
183
+ }
184
+ /**
185
+ * 需要管理员广播才能收看内容共享
186
+ *
187
+ * @property { boolean } is - 是否开启了指定内容广播
188
+ * @property { string } audioTrackId - 广播的audioTrackId
189
+ * @property { string } contentUrl - 广播的contentUrl
190
+ */
191
+ export interface ContentOnholdInfo {
192
+ is: boolean;
193
+ audioTrackId: string;
194
+ contentUrl: string;
195
+ }
@@ -1,4 +1,4 @@
1
- import { FACING_MODE_LIST } from 'src/enum';
1
+ import { FACING_MODE_LIST } from '../enum';
2
2
  import { IStatus } from './base';
3
3
  /**
4
4
  * MediaTrack状态