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

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.
@@ -1,55 +1,64 @@
1
1
  /**
2
2
  * Browser version tools
3
+ * platform/browser/version
3
4
  *
4
5
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
6
  * @date 2020-02-21 16:29:12
6
7
  */
7
- export declare const platform: () => {
8
- isTablet: boolean;
9
- isPhone: boolean;
10
- isAndroid: boolean;
11
- isPc: boolean;
12
- isMac: boolean;
13
- isWindows: boolean;
14
- isIPad: boolean;
15
- isChrome: boolean;
16
- isLinux: boolean;
17
- isFirefox: boolean;
18
- isBaidu: boolean;
19
- isQQ: boolean;
20
- isOpera: boolean;
21
- isZhazha: boolean;
22
- isEdge: boolean;
23
- isSafari: boolean;
24
- isHuaweiBrowser: boolean;
25
- };
26
- export declare const getChromeVersion: () => {
27
- major: any;
28
- minor: any;
29
- build: any;
30
- patch: any;
31
- } | undefined;
32
- export declare const getEdgeVersion: () => {
33
- major: any;
34
- minor: any;
35
- build: any;
36
- } | undefined;
37
- export declare const getSafariVersion: () => {
38
- major: any;
39
- minor: any;
40
- } | undefined;
41
- export declare const getFirefoxVersion: () => {
42
- major: any;
43
- minor: any;
44
- } | undefined;
45
- export declare const getAndroidVersion: () => {
46
- major: any;
47
- minor: any;
48
- } | undefined;
49
- export declare const getIOSVersion: () => {
50
- major: any;
51
- minor: any;
52
- } | undefined;
53
- export declare const getVersion: () => number;
54
- export declare const isPC: boolean;
55
- export declare const isMobile: boolean;
8
+ declare class BrowserDetector {
9
+ static getPlatform(): {
10
+ isTablet: boolean;
11
+ isPhone: boolean;
12
+ isAndroid: boolean;
13
+ isPc: boolean;
14
+ isMac: boolean;
15
+ isWindows: boolean;
16
+ isIPad: boolean;
17
+ isChrome: boolean;
18
+ isLinux: boolean;
19
+ isFirefox: boolean;
20
+ isBaidu: boolean;
21
+ isQQ: boolean;
22
+ isOpera: boolean;
23
+ isZhazha: boolean;
24
+ isEdge: boolean;
25
+ isSafari: boolean;
26
+ isHuaweiBrowser: boolean;
27
+ isWeixin: boolean;
28
+ iswxwork: boolean;
29
+ isMiniProgram: boolean;
30
+ isWindowsWxWechat: boolean;
31
+ isWindowsWechat: boolean;
32
+ };
33
+ static getOperationSystem(): "" | "Windows WXWechat" | "Windows Wechat" | "Windows" | "iPhone" | "Android" | "iPad" | "Mac" | "Linux" | "MiniProgram";
34
+ static getChromeVersion(): {
35
+ major: any;
36
+ minor: any;
37
+ build: any;
38
+ patch: any;
39
+ } | undefined;
40
+ static getEdgeVersion(): {
41
+ major: any;
42
+ minor: any;
43
+ build: any;
44
+ } | undefined;
45
+ static getSafariVersion(): {
46
+ major: any;
47
+ minor: any;
48
+ } | undefined;
49
+ static getFirefoxVersion(): {
50
+ major: any;
51
+ minor: any;
52
+ } | undefined;
53
+ static getAndroidVersion(): {
54
+ major: any;
55
+ minor: any;
56
+ } | undefined;
57
+ static getIOSVersion(): {
58
+ major: any;
59
+ minor: any;
60
+ } | undefined;
61
+ static getWeixinVersion(): string | undefined;
62
+ static getWXWeixinVersion(): string | undefined;
63
+ }
64
+ export default BrowserDetector;
@@ -0,0 +1,324 @@
1
+ /**
2
+ * Meeting layout init template data
3
+ *
4
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
5
+ * @date 2019-10-24 20:41:38
6
+ */
7
+ import { ITemplate, TemplateType, VideoQuality, StreamResolutionLevel, TemplateInfos } from '../../type';
8
+ export * from './mobile';
9
+ export declare const RATE = 0.5625;
10
+ export declare const HIDE_POSITION: number[];
11
+ export declare const FULL_POSITION: number[];
12
+ export declare const SPEAKER_TEMPLATE: {
13
+ '1-1': {
14
+ position: number[];
15
+ resolution: {
16
+ normal: StreamResolutionLevel;
17
+ low: StreamResolutionLevel;
18
+ high: StreamResolutionLevel;
19
+ };
20
+ type: TemplateType;
21
+ quality: VideoQuality;
22
+ }[];
23
+ '2-1': ({
24
+ position: number[];
25
+ resolution: {
26
+ normal: StreamResolutionLevel;
27
+ low: StreamResolutionLevel;
28
+ high: StreamResolutionLevel;
29
+ };
30
+ type: TemplateType;
31
+ quality: VideoQuality;
32
+ } | {
33
+ position: number[];
34
+ resolution: {
35
+ normal: StreamResolutionLevel;
36
+ low: StreamResolutionLevel;
37
+ high?: undefined;
38
+ };
39
+ type: TemplateType;
40
+ quality: VideoQuality;
41
+ })[];
42
+ '3-1': ({
43
+ position: number[];
44
+ resolution: {
45
+ normal: StreamResolutionLevel;
46
+ low: StreamResolutionLevel;
47
+ high: StreamResolutionLevel;
48
+ };
49
+ type: TemplateType;
50
+ quality: VideoQuality;
51
+ } | {
52
+ position: number[];
53
+ resolution: {
54
+ normal: StreamResolutionLevel;
55
+ low: StreamResolutionLevel;
56
+ high?: undefined;
57
+ };
58
+ type: TemplateType;
59
+ quality: VideoQuality;
60
+ })[];
61
+ '4-1': ({
62
+ position: number[];
63
+ resolution: {
64
+ normal: StreamResolutionLevel;
65
+ low: StreamResolutionLevel;
66
+ high: StreamResolutionLevel;
67
+ };
68
+ type: TemplateType;
69
+ quality: VideoQuality;
70
+ } | {
71
+ position: number[];
72
+ resolution: {
73
+ normal: StreamResolutionLevel;
74
+ low: StreamResolutionLevel;
75
+ high?: undefined;
76
+ };
77
+ type: TemplateType;
78
+ quality?: undefined;
79
+ } | {
80
+ position: number[];
81
+ resolution: {
82
+ normal: StreamResolutionLevel;
83
+ low: StreamResolutionLevel;
84
+ high?: undefined;
85
+ };
86
+ type: TemplateType;
87
+ quality: VideoQuality;
88
+ })[];
89
+ '5-1': ({
90
+ position: number[];
91
+ resolution: {
92
+ normal: StreamResolutionLevel;
93
+ low: StreamResolutionLevel;
94
+ high: StreamResolutionLevel;
95
+ };
96
+ type: TemplateType;
97
+ quality: VideoQuality;
98
+ } | {
99
+ position: number[];
100
+ resolution: {
101
+ normal: StreamResolutionLevel;
102
+ low: StreamResolutionLevel;
103
+ high?: undefined;
104
+ };
105
+ type: TemplateType;
106
+ quality?: undefined;
107
+ } | {
108
+ position: number[];
109
+ resolution: {
110
+ normal: StreamResolutionLevel;
111
+ low: StreamResolutionLevel;
112
+ high?: undefined;
113
+ };
114
+ type: TemplateType;
115
+ quality: VideoQuality;
116
+ })[];
117
+ '6-1': ({
118
+ position: number[];
119
+ resolution: {
120
+ normal: StreamResolutionLevel;
121
+ low: StreamResolutionLevel;
122
+ high: StreamResolutionLevel;
123
+ };
124
+ type: TemplateType;
125
+ quality: VideoQuality;
126
+ } | {
127
+ position: number[];
128
+ resolution: {
129
+ normal: StreamResolutionLevel;
130
+ low: StreamResolutionLevel;
131
+ high?: undefined;
132
+ };
133
+ type: TemplateType;
134
+ quality?: undefined;
135
+ } | {
136
+ position: number[];
137
+ resolution: {
138
+ normal: StreamResolutionLevel;
139
+ low: StreamResolutionLevel;
140
+ high?: undefined;
141
+ };
142
+ type: TemplateType;
143
+ quality: VideoQuality;
144
+ })[];
145
+ '7-1': ({
146
+ position: number[];
147
+ resolution: {
148
+ normal: StreamResolutionLevel;
149
+ low: StreamResolutionLevel;
150
+ high: StreamResolutionLevel;
151
+ };
152
+ type: TemplateType;
153
+ quality: VideoQuality;
154
+ } | {
155
+ position: number[];
156
+ resolution: {
157
+ normal: StreamResolutionLevel;
158
+ low: StreamResolutionLevel;
159
+ high?: undefined;
160
+ };
161
+ type: TemplateType;
162
+ quality?: undefined;
163
+ } | {
164
+ position: number[];
165
+ resolution: {
166
+ normal: StreamResolutionLevel;
167
+ low: StreamResolutionLevel;
168
+ high?: undefined;
169
+ };
170
+ type: TemplateType;
171
+ quality: VideoQuality;
172
+ })[];
173
+ '8-1': ({
174
+ position: number[];
175
+ resolution: {
176
+ normal: StreamResolutionLevel;
177
+ low: StreamResolutionLevel;
178
+ high: StreamResolutionLevel;
179
+ };
180
+ type: TemplateType;
181
+ quality: VideoQuality;
182
+ } | {
183
+ position: number[];
184
+ resolution: {
185
+ normal: StreamResolutionLevel;
186
+ low: StreamResolutionLevel;
187
+ high?: undefined;
188
+ };
189
+ type: TemplateType;
190
+ quality?: undefined;
191
+ } | {
192
+ position: number[];
193
+ resolution: {
194
+ normal: StreamResolutionLevel;
195
+ low: StreamResolutionLevel;
196
+ high?: undefined;
197
+ };
198
+ type: TemplateType;
199
+ quality: VideoQuality;
200
+ })[];
201
+ };
202
+ export declare const GALLERY_TEMPLATE: {
203
+ '1-1': {
204
+ position: number[];
205
+ resolution: {
206
+ normal: StreamResolutionLevel;
207
+ low: StreamResolutionLevel;
208
+ high: StreamResolutionLevel;
209
+ };
210
+ type: TemplateType;
211
+ }[];
212
+ '2-1': ({
213
+ position: number[];
214
+ resolution: {
215
+ normal: StreamResolutionLevel;
216
+ low: StreamResolutionLevel;
217
+ high: StreamResolutionLevel;
218
+ };
219
+ type: TemplateType;
220
+ quality: VideoQuality;
221
+ } | {
222
+ position: number[];
223
+ resolution: {
224
+ normal: StreamResolutionLevel;
225
+ low: StreamResolutionLevel;
226
+ high: StreamResolutionLevel;
227
+ };
228
+ type: TemplateType;
229
+ quality?: undefined;
230
+ })[];
231
+ '3-1': ({
232
+ position: number[];
233
+ resolution: {
234
+ normal: number;
235
+ low: StreamResolutionLevel;
236
+ };
237
+ type: TemplateType;
238
+ quality: VideoQuality;
239
+ } | {
240
+ position: number[];
241
+ resolution: {
242
+ normal: number;
243
+ low: StreamResolutionLevel;
244
+ };
245
+ type: TemplateType;
246
+ quality?: undefined;
247
+ })[];
248
+ '4-1': ({
249
+ position: number[];
250
+ resolution: {
251
+ normal: number;
252
+ low: StreamResolutionLevel;
253
+ };
254
+ type: TemplateType;
255
+ quality: VideoQuality;
256
+ } | {
257
+ position: number[];
258
+ resolution: {
259
+ normal: number;
260
+ low: StreamResolutionLevel;
261
+ };
262
+ type: TemplateType;
263
+ quality?: undefined;
264
+ })[];
265
+ '5-1': ({
266
+ position: number[];
267
+ resolution: {
268
+ normal: StreamResolutionLevel;
269
+ low: StreamResolutionLevel;
270
+ };
271
+ type: TemplateType;
272
+ quality: VideoQuality;
273
+ } | {
274
+ position: number[];
275
+ resolution: {
276
+ normal: StreamResolutionLevel;
277
+ low: StreamResolutionLevel;
278
+ };
279
+ type: TemplateType;
280
+ quality?: undefined;
281
+ })[];
282
+ '6-1': {
283
+ position: number[];
284
+ resolution: {
285
+ normal: StreamResolutionLevel;
286
+ low: StreamResolutionLevel;
287
+ };
288
+ type: TemplateType;
289
+ quality: VideoQuality;
290
+ }[];
291
+ '7-1': {
292
+ position: number[];
293
+ resolution: {
294
+ normal: StreamResolutionLevel;
295
+ low: StreamResolutionLevel;
296
+ };
297
+ type: TemplateType;
298
+ quality: VideoQuality;
299
+ }[];
300
+ '8-1': {
301
+ position: number[];
302
+ resolution: {
303
+ normal: StreamResolutionLevel;
304
+ low: StreamResolutionLevel;
305
+ };
306
+ type: TemplateType;
307
+ quality: VideoQuality;
308
+ }[];
309
+ '9-1': {
310
+ position: number[];
311
+ resolution: {
312
+ normal: StreamResolutionLevel;
313
+ low: StreamResolutionLevel;
314
+ };
315
+ type: TemplateType;
316
+ quality: VideoQuality;
317
+ }[];
318
+ };
319
+ export declare const COMMON_TEMPLATE: ITemplate;
320
+ export declare const CONTENT_TEMPLATE: ITemplate;
321
+ /**
322
+ * 全屏布局
323
+ */
324
+ export declare const FULL_TEMPLATE: TemplateInfos;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Meeting layout init template data
3
+ *
4
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
5
+ * @date 2019-10-24 20:41:38
6
+ */
7
+ import { ITemplate } from '../../type';
8
+ export declare const COMMON_MOBILE_VERTICAL_TEMPLATE: ITemplate;
9
+ export declare const COMMON_MOBILE_HORIZONTAL_TEMPLATE: ITemplate;
@@ -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
  */
@@ -574,7 +506,6 @@ export interface IConfAuxProperties {
574
506
  * @property { string } avatar 头像
575
507
  * @property { InviteInfo } inviteInfo 会议分享信息,包含会议邀请链接、电话,WebRTC、终端等端的入会方式;
576
508
  * @property { string } meetingId 当前会议ID
577
- * @property { string } displayNum 显示的会议号
578
509
  */
579
510
  export interface IConferenceInfo {
580
511
  callNumber?: string;
@@ -860,39 +791,42 @@ export interface ISpeakerInfo {
860
791
  /**
861
792
  * 布局对象
862
793
  *
863
- * @property { number[] } position 模版位置,业务层可以忽略
864
- * @property { StreamResolutionLevel } resolution 当前布局对象的分辨数据
865
794
  * @property { IRoster } roster 参会者基本信息、状态信息,例如:用户名、麦克风/摄像头状态、是否是主会场等信息
866
- * @property { any } rotate 当前参会者的旋转信息
867
795
  * @property { ILayoutState } state 当前参会者的画面状态信息,暂时未使用
796
+ * @property { any } rotate 当前参会者的旋转信息,用于设置video标签样式
868
797
  * @property { { left: string; top: string; width: string; height: string } } positionStyle 当前参会者的位置样式
798
+ * @property { string } avatar 人物头像
799
+ * @property { string } textAvatar 名称头像
800
+ * @property { ExternalTemplateConfig } templateConfig 忽略
869
801
  * @property { { width: number; height: number } } positionInfo 忽略
870
- * @property { 0 | 100 | 200 } quality 质量
802
+ * @property { number[] } position 忽略
871
803
  * @property { boolean } deal 忽略
872
- * @property { number } zIndex 忽略
804
+ * @property { number } index 忽略
805
+ * @property { number } resolution 忽略, 2.0.2以前的版本 自定义布局roster请流使用
806
+ * @property { number } quality 忽略, 2.0.2以前的版本 自定义布局roster请流使用
873
807
  */
874
808
  export interface ILayout {
875
- position?: number[];
876
- resolution?: StreamResolutionLevel;
877
809
  roster: IRoster;
878
- rotate?: any;
879
810
  state?: ILayoutState;
811
+ rotate?: any;
880
812
  positionStyle?: {
881
813
  left: string;
882
814
  top: string;
883
815
  width: string;
884
816
  height: string;
885
817
  };
818
+ avatar?: string;
819
+ textAvatar?: string;
820
+ templateConfig?: ExternalTemplateConfig;
821
+ position?: number[];
886
822
  positionInfo?: {
887
823
  width: number;
888
824
  height: number;
889
825
  };
890
- quality?: 0 | 100 | 200;
891
826
  deal?: boolean;
892
- zIndex?: number;
893
- avatar?: string;
894
- textAvatar?: string;
895
827
  index?: number;
828
+ resolution?: number;
829
+ quality?: number;
896
830
  }
897
831
  /**
898
832
  * Local布局对象