@xylink/xy-rtc-sdk 2.1.2 → 3.8.0-beta.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.
Files changed (48) hide show
  1. package/README.MD +37 -37
  2. package/lib/{src/action → action}/index.d.ts +237 -236
  3. package/lib/{src/enum → enum}/contraints.d.ts +116 -116
  4. package/lib/{src/enum → enum}/errorCode.d.ts +880 -880
  5. package/lib/{src/enum → enum}/index.d.ts +137 -133
  6. package/lib/{src/index.d.ts → index.d.ts} +34 -34
  7. package/lib/{src/main → main}/client.d.ts +878 -808
  8. package/lib/{src/main → main}/deviceManager.d.ts +164 -164
  9. package/lib/{src/main → main}/helper.d.ts +51 -51
  10. package/lib/{src/main → main}/iauth.d.ts +33 -33
  11. package/lib/{src/main → main}/layoutManager.d.ts +214 -214
  12. package/lib/{src/main → main}/peer.d.ts +311 -311
  13. package/lib/{src/main → main}/qualityManager.d.ts +39 -39
  14. package/lib/{src/main → main}/stream.d.ts +263 -243
  15. package/lib/{src/main → main}/videoManager.d.ts +65 -65
  16. package/lib/{src/tools → tools}/audioLevel.d.ts +23 -23
  17. package/lib/{src/tools → tools}/browser.d.ts +55 -55
  18. package/lib/{src/tools → tools}/config.d.ts +12 -12
  19. package/lib/{src/tools → tools}/db.d.ts +85 -85
  20. package/lib/{src/tools → tools}/detect.d.ts +44 -45
  21. package/lib/{src/tools → tools}/emmitter.d.ts +15 -15
  22. package/lib/{src/tools → tools}/enum.d.ts +6 -6
  23. package/lib/{src/tools → tools}/httpClient.d.ts +64 -64
  24. package/lib/{src/tools → tools}/i18n.d.ts +8 -8
  25. package/lib/{src/tools → tools}/index.d.ts +8 -8
  26. package/lib/{src/tools → tools}/logger.d.ts +151 -151
  27. package/lib/{src/tools → tools}/socket.d.ts +53 -53
  28. package/lib/{src/tools → tools}/store.d.ts +15 -15
  29. package/lib/{src/tools → tools}/template.d.ts +14 -14
  30. package/lib/{src/tools → tools}/utils.d.ts +73 -67
  31. package/lib/{src/tools → tools}/verify.d.ts +7 -7
  32. package/lib/{src/type → type}/base.d.ts +71 -71
  33. package/lib/{src/type → type}/client.d.ts +1121 -1106
  34. package/lib/{src/type → type}/device.d.ts +77 -77
  35. package/lib/{src/type → type}/index.d.ts +11 -11
  36. package/lib/{src/type → type}/quality.d.ts +77 -77
  37. package/lib/{src/type → type}/stream.d.ts +426 -426
  38. package/lib/xyrtc.cjs.js +1 -0
  39. package/lib/xyrtc.umd.js +1 -0
  40. package/package.json +119 -130
  41. package/scripts/build_lib.js +16 -0
  42. package/scripts/utils.js +27 -0
  43. package/scripts/webpack.common.js +139 -0
  44. package/scripts/webpack.dev.js +27 -0
  45. package/scripts/webpack.sdk.js +68 -0
  46. package/tsconfig.lib.json +37 -0
  47. package/lib/index.es.js +0 -3
  48. package/lib/index.js +0 -3
package/README.MD CHANGED
@@ -1,38 +1,38 @@
1
- # XYLINK WEBRTC SDK
2
-
3
- ## 介绍
4
-
5
- XY RTC Web SDK 是小鱼易连音视频通讯解决方案的Web端SDK,它是通过 HTML 网页加载的 JavaScript 库,采用 WebRTC 技术,开发者可以使用 XY RTC Web SDK 提供的 API 建立连接,控制实时多人音视频通话。
6
-
7
- 目前 XY RTC Web SDK 主要支持 Chrome v72+ 和 Edge v80+ 浏览器。
8
- ## 安装
9
- ``` bash
10
- # 通过 Yarn 安装
11
- $ yarn add @xylink/xy-rtc-sdk
12
-
13
- # 通过 Npm 安装
14
- $ npm install @xylink/xy-rtc-sdk --save
15
- ```
16
- ## 示例
17
-
18
- > **注意**:请务必使用 HTTPS 协议或者 localhost 开发、测试,否则无法正常使用 XY RTC SDK 进行加入会议操作;
19
-
20
-
21
- ```bash
22
- import xyRTC from "@xylink/xy-rtc-sdk";
23
-
24
- const client = xyRTC.createClient();
25
- ```
26
-
27
-
28
- 具体可参考[详细API文档](https://openapi.xylink.com/common/meeting/api/description?platform=web)完成音视频通话。
29
- ## 开源示例项目
30
- 我们在 GitHub 上提供了开源的示例项目供你参考。
31
-
32
- - Vue 版本:https://github.com/xylink-com/xylink-rtc-vue-demo
33
- - React 版本:https://github.com/xylink-com/xylink-rtc-demo
34
-
35
-
36
- 如果你是第一次集成 XY RTC SDK 产品,你可以使用我们基于 SDK 实现的产品进行体验:[小鱼 Web 会议](https://cdn.xylink.com/webrtc/web/index.html#/)。 我们会将 SDK 的最新功能在小鱼 Web 会议上进行集成展示出来,方便作为你的一种参考方式。
37
- ## 版本更新内容
1
+ # XYLINK WEBRTC SDK
2
+
3
+ ## 介绍
4
+
5
+ XY RTC Web SDK 是小鱼易连音视频通讯解决方案的Web端SDK,它是通过 HTML 网页加载的 JavaScript 库,采用 WebRTC 技术,开发者可以使用 XY RTC Web SDK 提供的 API 建立连接,控制实时多人音视频通话。
6
+
7
+ 目前 XY RTC Web SDK 主要支持 Chrome v72+ 和 Edge v80+ 浏览器。
8
+ ## 安装
9
+ ``` bash
10
+ # 通过 Yarn 安装
11
+ $ yarn add @xylink/xy-rtc-sdk
12
+
13
+ # 通过 Npm 安装
14
+ $ npm install @xylink/xy-rtc-sdk --save
15
+ ```
16
+ ## 示例
17
+
18
+ > **注意**:请务必使用 HTTPS 协议或者 localhost 开发、测试,否则无法正常使用 XY RTC SDK 进行加入会议操作;
19
+
20
+
21
+ ```bash
22
+ import xyRTC from "@xylink/xy-rtc-sdk";
23
+
24
+ const client = xyRTC.createClient();
25
+ ```
26
+
27
+
28
+ 具体可参考[详细API文档](https://openapi.xylink.com/common/meeting/api/description?platform=web)完成音视频通话。
29
+ ## 开源示例项目
30
+ 我们在 GitHub 上提供了开源的示例项目供你参考。
31
+
32
+ - Vue 版本:https://github.com/xylink-com/xylink-rtc-vue-demo
33
+ - React 版本:https://github.com/xylink-com/xylink-rtc-demo
34
+
35
+
36
+ 如果你是第一次集成 XY RTC SDK 产品,你可以使用我们基于 SDK 实现的产品进行体验:[小鱼 Web 会议](https://cdn.xylink.com/webrtc/web/index.html#/)。 我们会将 SDK 的最新功能在小鱼 Web 会议上进行集成展示出来,方便作为你的一种参考方式。
37
+ ## 版本更新内容
38
38
  具体可查看[发版说明文档](https://openapi.xylink.com/common/meeting/doc/version?platform=web)。
@@ -1,236 +1,237 @@
1
- import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams } from '../type';
2
- import Logger from '../tools/logger';
3
- export interface ICommonParams {
4
- securityKey: string;
5
- }
6
- declare class Action {
7
- private http;
8
- private logHttp;
9
- private meetingInfo;
10
- private seqId;
11
- private statesTime;
12
- commonParams: ICommonParams;
13
- randomDeviceSN: string;
14
- constructor();
15
- setBaseUrl(baseUrl: string, logUrl: string): void;
16
- setLogBaseUrl(logUrl: string): void;
17
- setClientInfo({ clientId, clientSecret }: {
18
- clientId: string;
19
- clientSecret: string;
20
- }): void;
21
- setLogger(logger: Logger): void;
22
- setMeetingInfo(info: IMeetingInfo): void;
23
- setLoginInfo(loginInfo: IToken | null): void;
24
- getLoginInfo(): IToken;
25
- /**
26
- * 设置默认参数,如securityKey
27
- *
28
- * @param data
29
- */
30
- setCommonParams: (data: any) => void;
31
- /**
32
- * 日志上传
33
- *
34
- * @param data
35
- * @returns
36
- */
37
- upload(data: any): Promise<any>;
38
- /**
39
- * 获取公钥,加密登录需使用此公钥
40
- *
41
- * @param { string } account 小鱼账号
42
- * @returns
43
- */
44
- getPublicKey(account: string): Promise<any>;
45
- /**
46
- * 不加密登录
47
- *
48
- * @param sdkUserInfo
49
- */
50
- login(sdkUserInfo: ISdkUserInfo): Promise<any>;
51
- /**
52
- * 加密登录
53
- *
54
- * @param { ISdkUserInfo } sdkUserInfo 小鱼账号
55
- */
56
- encryptLogin(sdkUserInfo: ISdkUserInfo): Promise<any>;
57
- /**
58
- * 定制(RSA直接加密)登录接口(适配SHA512加密老用户)
59
- *
60
- * @param data
61
- * @returns
62
- */
63
- customLogin: (data: any) => Promise<any>;
64
- /**
65
- * 获取匿名账号
66
- *
67
- * @param params
68
- */
69
- getSdkUserInfo(params: ILoginExtAccount): Promise<any>;
70
- /**
71
- * 根据Token获取用户信息
72
- *
73
- * @param { string } token
74
- * @returns
75
- */
76
- getUserInfo(token: string): Promise<any>;
77
- /**
78
- * 获取云会议室信息
79
- *
80
- * @param params
81
- * @returns
82
- */
83
- getCallUri(params: {
84
- number: string;
85
- deviceType: number;
86
- country: string;
87
- }): Promise<any>;
88
- /**
89
- * 校验会议室密码
90
- *
91
- * @param { string } confNumber 会议号
92
- * @param { string } password 密码
93
- * @returns
94
- */
95
- verifyPassword(confNumber: string, password: string): Promise<any>;
96
- /**
97
- * 举手发言
98
- *
99
- * @param { string } type
100
- * @param { string } meetingId
101
- * @param { string } di
102
- * @param { string } conferenceNo 会议号
103
- * @returns
104
- */
105
- hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
106
- /**
107
- * 获取i18n/errorcode等链接
108
- *
109
- * @returns
110
- */
111
- getDefaultServerConfig(): Promise<any>;
112
- /**
113
- * 获取json文件内容
114
- *
115
- * @param { string } url
116
- * @returns
117
- */
118
- getCodeByJson(url: string): Promise<any>;
119
- /**
120
- * 获取随机云会议室号(目前仅用户巡课)
121
- *
122
- * @param { number } userProfileId 用户ID
123
- * @param { string } securityKey
124
- * @param { IGetConferenceParams } params
125
- * @returns
126
- */
127
- getConference(userProfileId: number, securityKey: string, params: IGetConferenceParams): Promise<any>;
128
- /**
129
- * 会议信息埋点
130
- *
131
- * @param { TCategory } category
132
- * @param { TEventName } eventName
133
- * @param { Object } params
134
- */
135
- setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
136
- /**
137
- * 监课模式不需要入会密码
138
- *
139
- * @param { string } confNumber
140
- * @returns
141
- */
142
- ignoreMeetingMonitor(confNumber: string): Promise<any>;
143
- /**
144
- * 信令多活:获取信令服务信息
145
- *
146
- * @param { number } userId 用户ID
147
- * @param { string } server 服务端地址
148
- * @param { boolean } isSupportHybridCloud 是否支持混合云
149
- * @returns
150
- */
151
- getAllocation(userId: number, server: string, isSupportHybridCloud?: boolean): Promise<any>;
152
- /**
153
- * 获取会议室水印
154
- *
155
- * @param { string } conferenceNumber
156
- * @returns
157
- */
158
- getWatermarkContent: (conferenceNumber: string) => Promise<any>;
159
- /**
160
- * 根据外部企业ID获取内部企业ID
161
- *
162
- * @param param0
163
- * @returns
164
- */
165
- getEnterpriseId: ({ extId, clientId, clientSecret, httpServer }: {
166
- extId: string;
167
- clientId: string;
168
- clientSecret: string;
169
- httpServer?: string | undefined;
170
- }) => Promise<any>;
171
- /**
172
- * WebRTC 内外网探测
173
- *
174
- * @param param0
175
- * @returns
176
- */
177
- locator: ({ extId, clientId, clientSecret, httpServer }: {
178
- extId: string;
179
- clientId: string;
180
- clientSecret: string;
181
- httpServer?: string | undefined;
182
- }) => Promise<any>;
183
- /**
184
- * 监会操作
185
- *
186
- * @param params meetingId: 会议号;action: 操作类型;operations: 操作信息
187
- * @returns [hasError, dada]
188
- */
189
- monitorOperation(params: {
190
- meetingId: string;
191
- action: string;
192
- operations: Array<{
193
- callUri: string;
194
- params: string;
195
- }>;
196
- }): Promise<[boolean, any]>;
197
- /**
198
- * 监会 updateWebViewProp 操作
199
- *
200
- * @param meetingId 会议号
201
- * @param operations 操作信息
202
- */
203
- updateWebViewProp(meetingId: string, operations?: Array<{
204
- callUri: string;
205
- params: string;
206
- }>): Promise<[boolean, any]>;
207
- /**
208
- * 检查会议室录制权限
209
- *
210
- * @param { string } confNumber 云会议室号
211
- * @param { string } meetingId 会议室ID
212
- * @returns
213
- */
214
- checkPermissionWithMeetingNumber(confNumber: string, meetingId: string): Promise<any>;
215
- /**
216
- * 录制存储空间检查
217
- *
218
- * @param { string } recordingUrl
219
- * @returns
220
- */
221
- checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<any>;
222
- /**
223
- * 获取企业管理平台带宽配置
224
- *
225
- * @returns
226
- */
227
- getWebRxBandwidth(userId: number): Promise<any>;
228
- /**
229
- * 刷新Token
230
- *
231
- * @returns
232
- */
233
- refreshToken(refresh_token: string): Promise<any>;
234
- }
235
- declare const _default: Action;
236
- export default _default;
1
+ import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams } from '../type';
2
+ import Logger from '../tools/logger';
3
+ export interface ICommonParams {
4
+ securityKey: string;
5
+ }
6
+ declare class Action {
7
+ private http;
8
+ private logHttp;
9
+ private meetingInfo;
10
+ private seqId;
11
+ private statesTime;
12
+ commonParams: ICommonParams;
13
+ randomDeviceSN: string;
14
+ constructor();
15
+ setBaseUrl(baseUrl: string, logUrl: string): void;
16
+ setLogBaseUrl(logUrl: string): void;
17
+ setClientInfo({ clientId, clientSecret }: {
18
+ clientId: string;
19
+ clientSecret: string;
20
+ }): void;
21
+ setLogger(logger: Logger): void;
22
+ setMeetingInfo(info: IMeetingInfo): void;
23
+ setLoginInfo(loginInfo: IToken | null): void;
24
+ getLoginInfo(): IToken;
25
+ /**
26
+ * 设置默认参数,如securityKey
27
+ *
28
+ * @param data
29
+ */
30
+ setCommonParams: (data: any) => void;
31
+ /**
32
+ * 日志上传
33
+ *
34
+ * @param data
35
+ * @returns
36
+ */
37
+ upload(data: any): Promise<any>;
38
+ /**
39
+ * 获取公钥,加密登录需使用此公钥
40
+ *
41
+ * @param { string } account 小鱼账号
42
+ * @returns
43
+ */
44
+ getPublicKey(account: string): Promise<any>;
45
+ /**
46
+ * 不加密登录
47
+ *
48
+ * @param sdkUserInfo
49
+ */
50
+ login(sdkUserInfo: ISdkUserInfo): Promise<any>;
51
+ /**
52
+ * 加密登录
53
+ *
54
+ * @param { ISdkUserInfo } sdkUserInfo 小鱼账号
55
+ */
56
+ encryptLogin(sdkUserInfo: ISdkUserInfo): Promise<any>;
57
+ /**
58
+ * 定制(RSA直接加密)登录接口(适配SHA512加密老用户)
59
+ *
60
+ * @param data
61
+ * @returns
62
+ */
63
+ customLogin: (data: any) => Promise<any>;
64
+ /**
65
+ * 获取匿名账号
66
+ *
67
+ * @param params
68
+ */
69
+ getSdkUserInfo(params: ILoginExtAccount): Promise<any>;
70
+ /**
71
+ * 根据Token获取用户信息
72
+ *
73
+ * @param { string } token
74
+ * @returns
75
+ */
76
+ getUserInfo(token: string): Promise<any>;
77
+ /**
78
+ * 获取云会议室信息
79
+ *
80
+ * @param params
81
+ * @returns
82
+ */
83
+ getCallUri(params: {
84
+ number: string;
85
+ deviceType: number;
86
+ country: string;
87
+ }): Promise<any>;
88
+ /**
89
+ * 校验会议室密码
90
+ *
91
+ * @param { string } confNumber 会议号
92
+ * @param { string } password 密码
93
+ * @returns
94
+ */
95
+ verifyPassword(confNumber: string, password: string): Promise<any>;
96
+ /**
97
+ * 举手发言
98
+ *
99
+ * @param { string } type
100
+ * @param { string } meetingId
101
+ * @param { string } di
102
+ * @param { string } conferenceNo 会议号
103
+ * @returns
104
+ */
105
+ hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
106
+ /**
107
+ * 获取i18n/errorcode等链接
108
+ *
109
+ * @returns
110
+ */
111
+ getDefaultServerConfig(): Promise<any>;
112
+ /**
113
+ * 获取json文件内容
114
+ *
115
+ * @param { string } url
116
+ * @returns
117
+ */
118
+ getCodeByJson(url: string): Promise<any>;
119
+ /**
120
+ * 获取随机云会议室号(目前仅用户巡课)
121
+ *
122
+ * @param { number } userProfileId 用户ID
123
+ * @param { string } securityKey
124
+ * @param { IGetConferenceParams } params
125
+ * @returns
126
+ */
127
+ getConference(userProfileId: number, securityKey: string, params: IGetConferenceParams): Promise<any>;
128
+ /**
129
+ * 功能操作上报记录
130
+ *
131
+ * @private
132
+ * @param { TCategory } category - 事件类别
133
+ * @param { TEventName } eventName - 事件名称
134
+ * @param { Objet } params - 事件详细数据
135
+ */
136
+ setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
137
+ /**
138
+ * 监课模式不需要入会密码
139
+ *
140
+ * @param { string } confNumber
141
+ * @returns
142
+ */
143
+ ignoreMeetingMonitor(confNumber: string): Promise<any>;
144
+ /**
145
+ * 信令多活:获取信令服务信息
146
+ *
147
+ * @param { number } userId 用户ID
148
+ * @param { string } server 服务端地址
149
+ * @param { boolean } isSupportHybridCloud 是否支持混合云
150
+ * @returns
151
+ */
152
+ getAllocation(userId: number, server: string, isSupportHybridCloud?: boolean): Promise<any>;
153
+ /**
154
+ * 获取会议室水印
155
+ *
156
+ * @param { string } conferenceNumber
157
+ * @returns
158
+ */
159
+ getWatermarkContent: (conferenceNumber: string) => Promise<any>;
160
+ /**
161
+ * 根据外部企业ID获取内部企业ID
162
+ *
163
+ * @param param0
164
+ * @returns
165
+ */
166
+ getEnterpriseId: ({ extId, clientId, clientSecret, httpServer }: {
167
+ extId: string;
168
+ clientId: string;
169
+ clientSecret: string;
170
+ httpServer?: string | undefined;
171
+ }) => Promise<any>;
172
+ /**
173
+ * WebRTC 内外网探测
174
+ *
175
+ * @param param0
176
+ * @returns
177
+ */
178
+ locator: ({ extId, clientId, clientSecret, httpServer }: {
179
+ extId: string;
180
+ clientId: string;
181
+ clientSecret: string;
182
+ httpServer?: string | undefined;
183
+ }) => Promise<any>;
184
+ /**
185
+ * 监会操作
186
+ *
187
+ * @param params meetingId: 会议号;action: 操作类型;operations: 操作信息
188
+ * @returns [hasError, dada]
189
+ */
190
+ monitorOperation(params: {
191
+ meetingId: string;
192
+ action: string;
193
+ operations: Array<{
194
+ callUri: string;
195
+ params: string;
196
+ }>;
197
+ }): Promise<[boolean, any]>;
198
+ /**
199
+ * 监会 updateWebViewProp 操作
200
+ *
201
+ * @param meetingId 会议号
202
+ * @param operations 操作信息
203
+ */
204
+ updateWebViewProp(meetingId: string, operations?: Array<{
205
+ callUri: string;
206
+ params: string;
207
+ }>): Promise<[boolean, any]>;
208
+ /**
209
+ * 检查会议室录制权限
210
+ *
211
+ * @param { string } confNumber 云会议室号
212
+ * @param { string } meetingId 会议室ID
213
+ * @returns
214
+ */
215
+ checkPermissionWithMeetingNumber(confNumber: string, meetingId: string): Promise<any>;
216
+ /**
217
+ * 录制存储空间检查
218
+ *
219
+ * @param { string } recordingUrl
220
+ * @returns
221
+ */
222
+ checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<any>;
223
+ /**
224
+ * 获取企业管理平台带宽配置
225
+ *
226
+ * @returns
227
+ */
228
+ getWebRxBandwidth(userId: number): Promise<any>;
229
+ /**
230
+ * 刷新Token
231
+ *
232
+ * @returns
233
+ */
234
+ refreshToken(refresh_token: string): Promise<any>;
235
+ }
236
+ declare const _default: Action;
237
+ export default _default;