@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.
- package/lib/action/index.d.ts +2 -1
- package/lib/enum/index.d.ts +11 -7
- package/lib/index.d.ts +2 -0
- package/lib/main/client.d.ts +16 -2
- package/lib/main/{layoutManager.d.ts → layout/index.d.ts} +184 -87
- package/lib/main/layout/template.d.ts +64 -0
- package/lib/tools/browser.d.ts +58 -49
- package/lib/tools/template/index.d.ts +324 -0
- package/lib/tools/template/mobile.d.ts +9 -0
- package/lib/type/client.d.ts +19 -85
- package/lib/type/layout.d.ts +164 -13
- package/lib/type/stream.d.ts +1 -1
- package/lib/xyrtc.cjs.js +1 -1
- package/lib/xyrtc.umd.js +1 -1
- package/package.json +1 -1
- package/lib/tools/template.d.ts +0 -21
package/lib/type/layout.d.ts
CHANGED
|
@@ -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,166 @@ 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 } isLocalHide - 是否隐藏本地画面
|
|
145
|
+
* @param { boolean } isChairmanMode - 是否是主会场模式
|
|
146
|
+
* @param { TemplateType } templateType - 全屏画面类型
|
|
147
|
+
* @param { LayoutOrientationType } orientation - 是否是移动端,及方向
|
|
148
|
+
* @param { FocusViewConfig } focusViewConfig - 切换的主画面信息
|
|
149
|
+
*/
|
|
150
|
+
export interface TemplateParams {
|
|
151
|
+
modeType?: TemplateMode | ContentTemplateMode;
|
|
152
|
+
currentCount?: number;
|
|
153
|
+
participantCount?: number;
|
|
154
|
+
isLocalHide?: boolean;
|
|
155
|
+
isChairmanMode?: boolean;
|
|
156
|
+
templateType?: TemplateType;
|
|
157
|
+
orientation?: LayoutOrientationType;
|
|
158
|
+
focusViewConfig?: FocusViewConfig;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Layout 移动端布局方向
|
|
162
|
+
*
|
|
163
|
+
* @param NONE -1 - 默认布局(PC)
|
|
164
|
+
* @param MOBILE_HORIZONTAL 0 - 移动端横屏布局
|
|
165
|
+
* @param MOBILE_VERTICAL 1 - 移动端竖屏布局
|
|
166
|
+
*/
|
|
167
|
+
export declare enum LayoutOrientationType {
|
|
168
|
+
NONE = -1,
|
|
169
|
+
MOBILE_HORIZONTAL = 0,
|
|
170
|
+
MOBILE_VERTICAL = 1
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 指定的主画面的信息
|
|
174
|
+
*
|
|
175
|
+
* @property { string } id - 指定的主画面的LayoutId
|
|
176
|
+
* @property { TemplateType } type - 画面类型
|
|
177
|
+
*/
|
|
178
|
+
export interface FocusViewConfig {
|
|
179
|
+
id: string;
|
|
180
|
+
type: TemplateType;
|
|
181
|
+
}
|
package/lib/type/stream.d.ts
CHANGED