@xylink/xy-rtc-sdk 3.9.0 → 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.
@@ -0,0 +1,112 @@
1
+ /**
2
+ *
3
+ * @param { string } extId
4
+ */
5
+ export interface ExtInfo {
6
+ extId: string;
7
+ }
8
+ /**
9
+ * 登录方式
10
+ *
11
+ * @param XYAccount - 小鱼账号登录
12
+ * @param ExtUserId - 三方用户id登录
13
+ * @param ExtToken - authCode登录
14
+ */
15
+ export declare enum LoginType {
16
+ XYAccount = 0,
17
+ ExtUserId = 1,
18
+ ExtToken = 2
19
+ }
20
+ /**
21
+ * 三方用户统一认证登录 - 小鱼账号登录 参数
22
+ *
23
+ * @param { string } account - 用户账号
24
+ * @param { string } password - 用户密码
25
+ * @param { string? } countryCode - 国家码:默认+86
26
+ * @param { string? } extId - 企业ID
27
+ */
28
+ export interface LoginXYAccountParams {
29
+ account: string;
30
+ password: string;
31
+ countryCode?: string;
32
+ extId?: string;
33
+ }
34
+ /**
35
+ * 三方用户统一认证登录 - 用户ID参数
36
+ *
37
+ * @param { string } extUserId - 三方用户ID
38
+ * @param { string } authCode - 登录码
39
+ * @param { string } displayName - 用户名称
40
+ * @param { boolean? } tempUser - 是否临时用户
41
+ * @param { string? } extId - 企业ID
42
+ */
43
+ export interface LoginExtUserIdParams {
44
+ extUserId: string;
45
+ authCode: string;
46
+ displayName: string;
47
+ tempUser?: boolean;
48
+ extId?: string;
49
+ }
50
+ /**
51
+ * 三方用户统一认证登录 - token登录
52
+ *
53
+ * @param { string } authCode - 登录码
54
+ * @param { string? } extId - 企业ID
55
+ */
56
+ export interface LoginExtTokenParams {
57
+ authCode: string;
58
+ extId?: string;
59
+ }
60
+ interface LoginParamsTemp extends LoginXYAccountParams, LoginExtUserIdParams, LoginExtTokenParams {
61
+ }
62
+ /**
63
+ * 三方用户统一认证登录 参数
64
+ */
65
+ export type LoginParams = Partial<LoginParamsTemp>;
66
+ /**
67
+ * 第三方登录用户信息
68
+ *
69
+ * @property { string } displayName 用户名称
70
+ * @property { string } extId 企业id
71
+ * @property { string } extUserId 三方用户ID
72
+ * @property { string } authCode 授权码
73
+ * @property { boolean } tempUser 临时账号
74
+ */
75
+ export interface ILoginExtAccount {
76
+ displayName: string;
77
+ extId?: string;
78
+ extUserId?: string;
79
+ authCode?: string;
80
+ tempUser?: boolean;
81
+ }
82
+ /**
83
+ * 第三方登录sdk用户信息,由sdk server创建
84
+ *
85
+ * @property { string } userName sdk用户名
86
+ * @property { string } password sdk密码
87
+ * @property { string? } extId sdk企业Id
88
+ */
89
+ export interface ISdkUserInfo {
90
+ userName: string;
91
+ password: string;
92
+ extId?: string;
93
+ }
94
+ /**
95
+ * 授权码登录
96
+ *
97
+ * @property { string } extId 企业id
98
+ * @property { string } extUserId 用户id
99
+ * @property { string } displayName 用户名
100
+ * @property { string } oauthCode 授权码
101
+ * @property { boolean } isTempUser 是否是临时账号
102
+ * @property { string } channelId 渠道id
103
+ */
104
+ export interface ILoginWidthAuthCode {
105
+ extId: string;
106
+ extUserId: string;
107
+ displayName: string;
108
+ oauthCode: string;
109
+ isTempUser: boolean;
110
+ channelId: string;
111
+ }
112
+ export {};
@@ -15,3 +15,4 @@ export * from './layout';
15
15
  export * from './quality';
16
16
  export * from './peer';
17
17
  export * from './logger';
18
+ export * from './iauth';
@@ -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
+ }
@@ -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状态