@xylink/xy-rtc-sdk 2.0.1-beta.8 → 2.0.3-beta.11
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/README.MD +56 -22
- package/lib/index.cjs.js +1 -1
- package/lib/index.js +1 -1
- package/lib/src/action/index.d.ts +26 -6
- package/lib/src/enum/errorCode.d.ts +6 -0
- package/lib/src/enum/index.d.ts +77 -118
- package/lib/src/index.d.ts +20 -11
- package/lib/src/main/client.d.ts +429 -91
- package/lib/src/main/deviceManager.d.ts +31 -5
- package/lib/src/main/helper.d.ts +24 -5
- package/lib/src/main/layoutManager.d.ts +100 -45
- package/lib/src/main/peer.d.ts +173 -33
- package/lib/src/main/stream.d.ts +87 -23
- package/lib/src/main/videoManager.d.ts +3 -3
- package/lib/src/tools/browser.d.ts +18 -3
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/tools/db.d.ts +1 -1
- package/lib/src/tools/detect.d.ts +6 -0
- package/lib/src/tools/emmitter.d.ts +4 -4
- package/lib/src/tools/enum.d.ts +4 -57
- package/lib/src/tools/httpClient.d.ts +15 -7
- package/lib/src/tools/i18n.d.ts +8 -0
- package/lib/src/tools/index.d.ts +1 -1
- package/lib/src/tools/logger.d.ts +110 -8
- package/lib/src/tools/socket.d.ts +5 -3
- package/lib/src/tools/utils.d.ts +6 -4
- package/lib/src/type/base.d.ts +29 -0
- package/lib/src/type/client.d.ts +923 -0
- package/lib/src/type/device.d.ts +77 -0
- package/lib/src/type/index.d.ts +8 -615
- package/lib/src/type/stream.d.ts +350 -0
- package/package.json +56 -33
- package/lib/src/test/main/client.d.ts +0 -2
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-30 14:14:04
|
|
6
6
|
*/
|
|
7
|
-
import { ILoginExtAccount, ISdkUserInfo, TStateAction,
|
|
7
|
+
import { ILoginExtAccount, ISdkUserInfo, TStateAction, TEventName, IMeetingInfo, TCategory } from '../type';
|
|
8
8
|
import Logger from '../tools/logger';
|
|
9
|
+
export interface ICommonParams {
|
|
10
|
+
securityKey: string;
|
|
11
|
+
}
|
|
9
12
|
declare class Action {
|
|
10
13
|
private http;
|
|
11
14
|
private logHttp;
|
|
12
|
-
private clientId;
|
|
13
15
|
private meetingInfo;
|
|
16
|
+
private seqId;
|
|
17
|
+
private statesTime;
|
|
18
|
+
commonParams: ICommonParams;
|
|
14
19
|
constructor();
|
|
15
20
|
setBaseUrl(baseUrl: string, logUrl: string): void;
|
|
16
21
|
setLogBaseUrl(logUrl: string): void;
|
|
@@ -34,13 +39,28 @@ declare class Action {
|
|
|
34
39
|
setLoginInfo(loginInfo: any): void;
|
|
35
40
|
getUserInfo(token: string): Promise<any>;
|
|
36
41
|
getCallUri(params: any): Promise<any>;
|
|
37
|
-
verifyPassword(confNumber: string, password: string
|
|
42
|
+
verifyPassword(confNumber: string, password: string): Promise<any>;
|
|
38
43
|
hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
|
|
39
|
-
fetchErrorCode(
|
|
44
|
+
fetchErrorCode(): Promise<any>;
|
|
40
45
|
getErrorCodeByJson(url: string): Promise<any>;
|
|
41
46
|
getConference(userProfileId: number, securityKey: string): Promise<any>;
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
setStates1(action: TStateAction, eventName: TEventName, params?: {}): Promise<void>;
|
|
48
|
+
setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
|
|
49
|
+
igonreMeetingMonito(confNumber: string): Promise<any>;
|
|
50
|
+
getAllocation(userId: number, server: string, isSupportHybridCloud?: boolean): Promise<any>;
|
|
51
|
+
getWatermarkContent: (conferenceNumber: string) => Promise<any>;
|
|
52
|
+
getEnterpriseId: ({ extId, clientId, clientSecret, httpServer }: {
|
|
53
|
+
extId: string;
|
|
54
|
+
clientId: string;
|
|
55
|
+
clientSecret: string;
|
|
56
|
+
httpServer?: string | undefined;
|
|
57
|
+
}) => Promise<any>;
|
|
58
|
+
locator: ({ extId, clientId, clientSecret, httpServer }: {
|
|
59
|
+
extId: string;
|
|
60
|
+
clientId: string;
|
|
61
|
+
clientSecret: string;
|
|
62
|
+
httpServer?: string | undefined;
|
|
63
|
+
}) => Promise<any>;
|
|
44
64
|
}
|
|
45
65
|
declare const _default: Action;
|
|
46
66
|
export default _default;
|
package/lib/src/enum/index.d.ts
CHANGED
|
@@ -4,8 +4,18 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-30 14:12:52
|
|
6
6
|
*/
|
|
7
|
-
import { ICONTENT_CONTRAINTS, IBASE_CONTRAINTS, IDefault, IMUTE_MAP, ITemplateMode, IContentTemplateMode } from '../type';
|
|
7
|
+
import { ICONTENT_CONTRAINTS, IBASE_CONTRAINTS, IDefault, IMUTE_MAP, ITemplateMode, IContentTemplateMode, IRoster } from '../type';
|
|
8
|
+
export declare const DETECT_LOCATOR_SERVER_NAME = "WebrtcSigGW";
|
|
9
|
+
export declare const DEVICE_TYPE = 17;
|
|
10
|
+
export declare const SELF_MOCK_PID = 9999999999;
|
|
11
|
+
export declare const STREAM_CHANNEL_COUNT = 11;
|
|
12
|
+
export declare const MAX_PARTICIPANT_COUNT = 112;
|
|
8
13
|
export declare const STREAM_ERROR_CODE_MAP: number[];
|
|
14
|
+
export declare const SUPPORT_DEVICE_TYPE: string[];
|
|
15
|
+
export declare const MAX_PAGE_SIZE = 9;
|
|
16
|
+
export declare const NETWORK_TYPE_MAP: {
|
|
17
|
+
[key: string]: number;
|
|
18
|
+
};
|
|
9
19
|
export declare const MUTE_MAP: IMUTE_MAP;
|
|
10
20
|
export declare const CONTRAINTS_MAP: {
|
|
11
21
|
0: number[];
|
|
@@ -17,73 +27,57 @@ export declare const CONTRAINTS_MAP: {
|
|
|
17
27
|
11: number[];
|
|
18
28
|
12: number[];
|
|
19
29
|
};
|
|
30
|
+
export declare const BASE_RESOLUTION_CONTRAINTS: {
|
|
31
|
+
width: {
|
|
32
|
+
min: number;
|
|
33
|
+
ideal: number;
|
|
34
|
+
};
|
|
35
|
+
height: {
|
|
36
|
+
min: number;
|
|
37
|
+
ideal: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare const RESOLUTION_360_CONTRAINTS: {
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
};
|
|
20
44
|
export declare const BASE_CONTRAINTS: IBASE_CONTRAINTS;
|
|
21
45
|
export declare const CONTENT_BASE_CONTRAINTS: ICONTENT_CONTRAINTS;
|
|
22
|
-
export declare const
|
|
23
|
-
720: {
|
|
46
|
+
export declare const FIREFOX_CONTENT_CONTRAINTS: {
|
|
47
|
+
'720': {
|
|
24
48
|
min: {
|
|
25
49
|
frameRate: number;
|
|
26
|
-
width:
|
|
27
|
-
|
|
28
|
-
max: number;
|
|
29
|
-
};
|
|
30
|
-
height: {
|
|
31
|
-
ideal: number;
|
|
32
|
-
max: number;
|
|
33
|
-
};
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
34
52
|
cursor: string;
|
|
35
53
|
aspectRatio: number;
|
|
36
54
|
resizeMode: "crop-and-scale";
|
|
37
55
|
logicalSurface: true;
|
|
38
56
|
};
|
|
39
57
|
max: {
|
|
40
|
-
frameRate:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
width: {
|
|
45
|
-
ideal: number;
|
|
46
|
-
max: number;
|
|
47
|
-
};
|
|
48
|
-
height: {
|
|
49
|
-
ideal: number;
|
|
50
|
-
max: number;
|
|
51
|
-
};
|
|
58
|
+
frameRate: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
52
61
|
cursor: string;
|
|
53
62
|
aspectRatio: number;
|
|
54
63
|
resizeMode: "crop-and-scale";
|
|
55
64
|
logicalSurface: true;
|
|
56
65
|
};
|
|
57
66
|
};
|
|
58
|
-
1080: {
|
|
67
|
+
'1080': {
|
|
59
68
|
min: {
|
|
60
69
|
frameRate: number;
|
|
61
|
-
width:
|
|
62
|
-
|
|
63
|
-
max: number;
|
|
64
|
-
};
|
|
65
|
-
height: {
|
|
66
|
-
ideal: number;
|
|
67
|
-
max: number;
|
|
68
|
-
};
|
|
70
|
+
width: number;
|
|
71
|
+
height: number;
|
|
69
72
|
cursor: string;
|
|
70
73
|
aspectRatio: number;
|
|
71
74
|
resizeMode: "crop-and-scale";
|
|
72
75
|
logicalSurface: true;
|
|
73
76
|
};
|
|
74
77
|
max: {
|
|
75
|
-
frameRate:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
width: {
|
|
80
|
-
ideal: number;
|
|
81
|
-
max: number;
|
|
82
|
-
};
|
|
83
|
-
height: {
|
|
84
|
-
ideal: number;
|
|
85
|
-
max: number;
|
|
86
|
-
};
|
|
78
|
+
frameRate: number;
|
|
79
|
+
width: number;
|
|
80
|
+
height: number;
|
|
87
81
|
cursor: string;
|
|
88
82
|
aspectRatio: number;
|
|
89
83
|
resizeMode: "crop-and-scale";
|
|
@@ -91,159 +85,127 @@ export declare const CONTENT_CONTRAINTS: {
|
|
|
91
85
|
};
|
|
92
86
|
};
|
|
93
87
|
};
|
|
94
|
-
export declare const
|
|
95
|
-
|
|
88
|
+
export declare const CONTENT_CONTRAINTS: {
|
|
89
|
+
'720': {
|
|
96
90
|
min: {
|
|
97
91
|
frameRate: number;
|
|
98
|
-
width:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
max: number;
|
|
102
|
-
};
|
|
103
|
-
height: {
|
|
104
|
-
min: number;
|
|
105
|
-
ideal: number;
|
|
106
|
-
max: number;
|
|
107
|
-
};
|
|
92
|
+
width: number;
|
|
93
|
+
height: number;
|
|
94
|
+
cursor: string;
|
|
108
95
|
aspectRatio: number;
|
|
109
96
|
resizeMode: "crop-and-scale";
|
|
97
|
+
logicalSurface: true;
|
|
110
98
|
};
|
|
111
99
|
max: {
|
|
112
|
-
frameRate:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
};
|
|
117
|
-
width: {
|
|
118
|
-
min: number;
|
|
119
|
-
ideal: number;
|
|
120
|
-
max: number;
|
|
121
|
-
};
|
|
122
|
-
height: {
|
|
123
|
-
min: number;
|
|
124
|
-
ideal: number;
|
|
125
|
-
max: number;
|
|
126
|
-
};
|
|
100
|
+
frameRate: number;
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
cursor: string;
|
|
127
104
|
aspectRatio: number;
|
|
128
105
|
resizeMode: "crop-and-scale";
|
|
106
|
+
logicalSurface: true;
|
|
129
107
|
};
|
|
130
108
|
};
|
|
131
|
-
|
|
109
|
+
'1080': {
|
|
132
110
|
min: {
|
|
133
111
|
frameRate: number;
|
|
134
|
-
width:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
max: number;
|
|
138
|
-
};
|
|
139
|
-
height: {
|
|
140
|
-
min: number;
|
|
141
|
-
ideal: number;
|
|
142
|
-
max: number;
|
|
143
|
-
};
|
|
112
|
+
width: number;
|
|
113
|
+
height: number;
|
|
114
|
+
cursor: string;
|
|
144
115
|
aspectRatio: number;
|
|
145
116
|
resizeMode: "crop-and-scale";
|
|
117
|
+
logicalSurface: true;
|
|
146
118
|
};
|
|
147
119
|
max: {
|
|
148
|
-
frameRate:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
};
|
|
153
|
-
width: {
|
|
154
|
-
min: number;
|
|
155
|
-
ideal: number;
|
|
156
|
-
max: number;
|
|
157
|
-
};
|
|
158
|
-
height: {
|
|
159
|
-
min: number;
|
|
160
|
-
ideal: number;
|
|
161
|
-
max: number;
|
|
162
|
-
};
|
|
120
|
+
frameRate: number;
|
|
121
|
+
width: number;
|
|
122
|
+
height: number;
|
|
123
|
+
cursor: string;
|
|
163
124
|
aspectRatio: number;
|
|
164
125
|
resizeMode: "crop-and-scale";
|
|
126
|
+
logicalSurface: true;
|
|
165
127
|
};
|
|
166
128
|
};
|
|
167
|
-
|
|
129
|
+
} | {
|
|
130
|
+
'720': {
|
|
168
131
|
min: {
|
|
169
132
|
frameRate: number;
|
|
170
133
|
width: {
|
|
171
|
-
min: number;
|
|
172
134
|
ideal: number;
|
|
173
135
|
max: number;
|
|
174
136
|
};
|
|
175
137
|
height: {
|
|
176
|
-
min: number;
|
|
177
138
|
ideal: number;
|
|
178
139
|
max: number;
|
|
179
140
|
};
|
|
141
|
+
cursor: string;
|
|
180
142
|
aspectRatio: number;
|
|
181
143
|
resizeMode: "crop-and-scale";
|
|
144
|
+
logicalSurface: true;
|
|
182
145
|
};
|
|
183
146
|
max: {
|
|
184
147
|
frameRate: {
|
|
185
|
-
|
|
186
|
-
exact: number;
|
|
148
|
+
ideal: number;
|
|
187
149
|
max: number;
|
|
188
150
|
};
|
|
189
151
|
width: {
|
|
190
|
-
min: number;
|
|
191
152
|
ideal: number;
|
|
192
153
|
max: number;
|
|
193
154
|
};
|
|
194
155
|
height: {
|
|
195
|
-
min: number;
|
|
196
156
|
ideal: number;
|
|
197
157
|
max: number;
|
|
198
158
|
};
|
|
159
|
+
cursor: string;
|
|
199
160
|
aspectRatio: number;
|
|
200
161
|
resizeMode: "crop-and-scale";
|
|
162
|
+
logicalSurface: true;
|
|
201
163
|
};
|
|
202
164
|
};
|
|
203
|
-
|
|
165
|
+
'1080': {
|
|
204
166
|
min: {
|
|
205
167
|
frameRate: number;
|
|
206
168
|
width: {
|
|
207
|
-
min: number;
|
|
208
169
|
ideal: number;
|
|
209
170
|
max: number;
|
|
210
171
|
};
|
|
211
172
|
height: {
|
|
212
|
-
min: number;
|
|
213
173
|
ideal: number;
|
|
214
174
|
max: number;
|
|
215
175
|
};
|
|
176
|
+
cursor: string;
|
|
216
177
|
aspectRatio: number;
|
|
217
178
|
resizeMode: "crop-and-scale";
|
|
179
|
+
logicalSurface: true;
|
|
218
180
|
};
|
|
219
181
|
max: {
|
|
220
182
|
frameRate: {
|
|
221
|
-
min: number;
|
|
222
183
|
ideal: number;
|
|
223
184
|
max: number;
|
|
224
185
|
};
|
|
225
186
|
width: {
|
|
226
|
-
min: number;
|
|
227
187
|
ideal: number;
|
|
228
188
|
max: number;
|
|
229
189
|
};
|
|
230
190
|
height: {
|
|
231
|
-
min: number;
|
|
232
191
|
ideal: number;
|
|
233
192
|
max: number;
|
|
234
193
|
};
|
|
194
|
+
cursor: string;
|
|
235
195
|
aspectRatio: number;
|
|
236
196
|
resizeMode: "crop-and-scale";
|
|
197
|
+
logicalSurface: true;
|
|
237
198
|
};
|
|
238
199
|
};
|
|
239
200
|
};
|
|
201
|
+
export declare const PEOPLE_CONTRAINTS: {
|
|
202
|
+
[key: string]: any;
|
|
203
|
+
};
|
|
240
204
|
export declare const CONFIGURATION: RTCConfiguration;
|
|
241
205
|
export declare const NEW_CODE_MAP: {
|
|
242
|
-
|
|
243
|
-
SERVER_INNER_ERROR: string;
|
|
244
|
-
PEER_NET_DISCONNECT: string;
|
|
245
|
-
LOCAL_NET_DISCONNECT: string;
|
|
206
|
+
[key: string]: string;
|
|
246
207
|
};
|
|
208
|
+
export declare const DEFAULT_ROSTER: IRoster;
|
|
247
209
|
export declare const DEFAULT: IDefault;
|
|
248
210
|
export declare const TEMPLATE_MODE: ITemplateMode[];
|
|
249
211
|
export declare const CONTENT_TEMPLATE_MODE: IContentTemplateMode[];
|
|
@@ -254,8 +216,5 @@ export declare const APP_NAME: {
|
|
|
254
216
|
THIRD_WEBRTC: string;
|
|
255
217
|
};
|
|
256
218
|
export declare const EVENT_TYPE_MAP: {
|
|
257
|
-
|
|
258
|
-
unmuteAudio: string;
|
|
259
|
-
muteVideo: string;
|
|
260
|
-
unmuteVideo: string;
|
|
219
|
+
[key: string]: string;
|
|
261
220
|
};
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* XYLink WebRTC SDK Lib
|
|
3
|
+
*
|
|
4
|
+
* 主入口文件,提供 createClient、createStream、版本等基本信息和方法;
|
|
5
|
+
*
|
|
3
6
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
7
|
* @date 2019-10-14 18:20:28
|
|
5
8
|
*/
|
|
6
9
|
import Logger from './tools/logger';
|
|
7
10
|
import Client from './main/client';
|
|
8
11
|
import Stream from './main/stream';
|
|
9
|
-
import { IClientConfig, IConfig } from './type';
|
|
12
|
+
import { IClientConfig, IConfig, TLocale, ICheckSystemRequirements } from './type';
|
|
10
13
|
import DeviceManager from './main/deviceManager';
|
|
11
|
-
import { getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo } from './main/helper';
|
|
12
|
-
|
|
14
|
+
import { getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo, getSendSupportedCodec, detectLocator } from './main/helper';
|
|
15
|
+
interface IXyRTC {
|
|
13
16
|
version: string;
|
|
14
|
-
|
|
15
|
-
checkSupportShareContent: () => boolean;
|
|
17
|
+
client: Client | null;
|
|
16
18
|
logger: Logger;
|
|
17
|
-
|
|
19
|
+
checkSupportWebRTC: () => Promise<ICheckSystemRequirements>;
|
|
20
|
+
checkSupportMobileWebRTC: () => Promise<ICheckSystemRequirements>;
|
|
21
|
+
checkSupportShareContent: () => boolean;
|
|
22
|
+
setLocale: (language: TLocale) => void;
|
|
23
|
+
createClient: (config: IClientConfig) => Client;
|
|
18
24
|
createStream: () => Stream;
|
|
19
25
|
setConfig: (config: IConfig) => void;
|
|
20
|
-
closePreviewStream: (stream: MediaStream) =>
|
|
21
|
-
setOutputAudioDevice: (element:
|
|
26
|
+
closePreviewStream: (stream: MediaStream) => void;
|
|
27
|
+
setOutputAudioDevice: (element: HTMLMediaElement, outputValue: string) => void;
|
|
22
28
|
render: void;
|
|
23
|
-
}
|
|
29
|
+
}
|
|
30
|
+
declare const xyRTC: IXyRTC;
|
|
24
31
|
export default xyRTC;
|
|
25
|
-
export { DeviceManager, getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo };
|
|
32
|
+
export { Client, Stream, DeviceManager, getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo, getSendSupportedCodec, detectLocator };
|
|
33
|
+
export * from './type';
|
|
34
|
+
export { ERROR_CODE } from './enum/errorCode';
|