@xylink/xy-rtc-sdk 2.0.1-beta.9 → 2.0.3-beta.12
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 +85 -118
- package/lib/src/index.d.ts +20 -11
- package/lib/src/main/client.d.ts +429 -89
- 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 +101 -40
- 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 -3
- 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,63 @@ 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: {
|
|
42
|
+
min: number;
|
|
43
|
+
ideal: number;
|
|
44
|
+
};
|
|
45
|
+
height: {
|
|
46
|
+
min: number;
|
|
47
|
+
ideal: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
20
50
|
export declare const BASE_CONTRAINTS: IBASE_CONTRAINTS;
|
|
21
51
|
export declare const CONTENT_BASE_CONTRAINTS: ICONTENT_CONTRAINTS;
|
|
22
|
-
export declare const
|
|
23
|
-
720: {
|
|
52
|
+
export declare const FIREFOX_CONTENT_CONTRAINTS: {
|
|
53
|
+
'720': {
|
|
24
54
|
min: {
|
|
25
55
|
frameRate: number;
|
|
26
|
-
width:
|
|
27
|
-
|
|
28
|
-
max: number;
|
|
29
|
-
};
|
|
30
|
-
height: {
|
|
31
|
-
ideal: number;
|
|
32
|
-
max: number;
|
|
33
|
-
};
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
34
58
|
cursor: string;
|
|
35
59
|
aspectRatio: number;
|
|
36
60
|
resizeMode: "crop-and-scale";
|
|
37
61
|
logicalSurface: true;
|
|
38
62
|
};
|
|
39
63
|
max: {
|
|
40
|
-
frameRate:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
width: {
|
|
45
|
-
ideal: number;
|
|
46
|
-
max: number;
|
|
47
|
-
};
|
|
48
|
-
height: {
|
|
49
|
-
ideal: number;
|
|
50
|
-
max: number;
|
|
51
|
-
};
|
|
64
|
+
frameRate: number;
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
52
67
|
cursor: string;
|
|
53
68
|
aspectRatio: number;
|
|
54
69
|
resizeMode: "crop-and-scale";
|
|
55
70
|
logicalSurface: true;
|
|
56
71
|
};
|
|
57
72
|
};
|
|
58
|
-
1080: {
|
|
73
|
+
'1080': {
|
|
59
74
|
min: {
|
|
60
75
|
frameRate: number;
|
|
61
|
-
width:
|
|
62
|
-
|
|
63
|
-
max: number;
|
|
64
|
-
};
|
|
65
|
-
height: {
|
|
66
|
-
ideal: number;
|
|
67
|
-
max: number;
|
|
68
|
-
};
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
69
78
|
cursor: string;
|
|
70
79
|
aspectRatio: number;
|
|
71
80
|
resizeMode: "crop-and-scale";
|
|
72
81
|
logicalSurface: true;
|
|
73
82
|
};
|
|
74
83
|
max: {
|
|
75
|
-
frameRate:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
width: {
|
|
80
|
-
ideal: number;
|
|
81
|
-
max: number;
|
|
82
|
-
};
|
|
83
|
-
height: {
|
|
84
|
-
ideal: number;
|
|
85
|
-
max: number;
|
|
86
|
-
};
|
|
84
|
+
frameRate: number;
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
87
|
cursor: string;
|
|
88
88
|
aspectRatio: number;
|
|
89
89
|
resizeMode: "crop-and-scale";
|
|
@@ -91,169 +91,136 @@ export declare const CONTENT_CONTRAINTS: {
|
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
|
-
export declare const
|
|
95
|
-
|
|
94
|
+
export declare const CONTENT_CONTRAINTS: {
|
|
95
|
+
'720': {
|
|
96
96
|
min: {
|
|
97
97
|
frameRate: number;
|
|
98
|
-
width:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
max: number;
|
|
102
|
-
};
|
|
103
|
-
height: {
|
|
104
|
-
min: number;
|
|
105
|
-
ideal: number;
|
|
106
|
-
max: number;
|
|
107
|
-
};
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
cursor: string;
|
|
108
101
|
aspectRatio: number;
|
|
109
102
|
resizeMode: "crop-and-scale";
|
|
103
|
+
logicalSurface: true;
|
|
110
104
|
};
|
|
111
105
|
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
|
-
};
|
|
106
|
+
frameRate: number;
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
cursor: string;
|
|
127
110
|
aspectRatio: number;
|
|
128
111
|
resizeMode: "crop-and-scale";
|
|
112
|
+
logicalSurface: true;
|
|
129
113
|
};
|
|
130
114
|
};
|
|
131
|
-
|
|
115
|
+
'1080': {
|
|
132
116
|
min: {
|
|
133
117
|
frameRate: number;
|
|
134
|
-
width:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
max: number;
|
|
138
|
-
};
|
|
139
|
-
height: {
|
|
140
|
-
min: number;
|
|
141
|
-
ideal: number;
|
|
142
|
-
max: number;
|
|
143
|
-
};
|
|
118
|
+
width: number;
|
|
119
|
+
height: number;
|
|
120
|
+
cursor: string;
|
|
144
121
|
aspectRatio: number;
|
|
145
122
|
resizeMode: "crop-and-scale";
|
|
123
|
+
logicalSurface: true;
|
|
146
124
|
};
|
|
147
125
|
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
|
-
};
|
|
126
|
+
frameRate: number;
|
|
127
|
+
width: number;
|
|
128
|
+
height: number;
|
|
129
|
+
cursor: string;
|
|
163
130
|
aspectRatio: number;
|
|
164
131
|
resizeMode: "crop-and-scale";
|
|
132
|
+
logicalSurface: true;
|
|
165
133
|
};
|
|
166
134
|
};
|
|
167
|
-
|
|
135
|
+
} | {
|
|
136
|
+
'720': {
|
|
168
137
|
min: {
|
|
169
138
|
frameRate: number;
|
|
170
139
|
width: {
|
|
171
|
-
min: number;
|
|
172
140
|
ideal: number;
|
|
173
141
|
max: number;
|
|
174
142
|
};
|
|
175
143
|
height: {
|
|
176
|
-
min: number;
|
|
177
144
|
ideal: number;
|
|
178
145
|
max: number;
|
|
179
146
|
};
|
|
147
|
+
cursor: string;
|
|
180
148
|
aspectRatio: number;
|
|
181
149
|
resizeMode: "crop-and-scale";
|
|
150
|
+
logicalSurface: true;
|
|
182
151
|
};
|
|
183
152
|
max: {
|
|
184
153
|
frameRate: {
|
|
185
|
-
|
|
186
|
-
exact: number;
|
|
154
|
+
ideal: number;
|
|
187
155
|
max: number;
|
|
188
156
|
};
|
|
189
157
|
width: {
|
|
190
|
-
min: number;
|
|
191
158
|
ideal: number;
|
|
192
159
|
max: number;
|
|
193
160
|
};
|
|
194
161
|
height: {
|
|
195
|
-
min: number;
|
|
196
162
|
ideal: number;
|
|
197
163
|
max: number;
|
|
198
164
|
};
|
|
165
|
+
cursor: string;
|
|
199
166
|
aspectRatio: number;
|
|
200
167
|
resizeMode: "crop-and-scale";
|
|
168
|
+
logicalSurface: true;
|
|
201
169
|
};
|
|
202
170
|
};
|
|
203
|
-
|
|
171
|
+
'1080': {
|
|
204
172
|
min: {
|
|
205
173
|
frameRate: number;
|
|
206
174
|
width: {
|
|
207
|
-
min: number;
|
|
208
175
|
ideal: number;
|
|
209
176
|
max: number;
|
|
210
177
|
};
|
|
211
178
|
height: {
|
|
212
|
-
min: number;
|
|
213
179
|
ideal: number;
|
|
214
180
|
max: number;
|
|
215
181
|
};
|
|
182
|
+
cursor: string;
|
|
216
183
|
aspectRatio: number;
|
|
217
184
|
resizeMode: "crop-and-scale";
|
|
185
|
+
logicalSurface: true;
|
|
218
186
|
};
|
|
219
187
|
max: {
|
|
220
188
|
frameRate: {
|
|
221
|
-
min: number;
|
|
222
189
|
ideal: number;
|
|
223
190
|
max: number;
|
|
224
191
|
};
|
|
225
192
|
width: {
|
|
226
|
-
min: number;
|
|
227
193
|
ideal: number;
|
|
228
194
|
max: number;
|
|
229
195
|
};
|
|
230
196
|
height: {
|
|
231
|
-
min: number;
|
|
232
197
|
ideal: number;
|
|
233
198
|
max: number;
|
|
234
199
|
};
|
|
200
|
+
cursor: string;
|
|
235
201
|
aspectRatio: number;
|
|
236
202
|
resizeMode: "crop-and-scale";
|
|
203
|
+
logicalSurface: true;
|
|
237
204
|
};
|
|
238
205
|
};
|
|
239
206
|
};
|
|
207
|
+
export declare const PEOPLE_CONTRAINTS: {
|
|
208
|
+
[key: string]: any;
|
|
209
|
+
};
|
|
240
210
|
export declare const CONFIGURATION: RTCConfiguration;
|
|
241
211
|
export declare const NEW_CODE_MAP: {
|
|
242
|
-
|
|
243
|
-
SERVER_INNER_ERROR: string;
|
|
244
|
-
PEER_NET_DISCONNECT: string;
|
|
245
|
-
LOCAL_NET_DISCONNECT: string;
|
|
212
|
+
[key: string]: string;
|
|
246
213
|
};
|
|
214
|
+
export declare const DEFAULT_ROSTER: IRoster;
|
|
247
215
|
export declare const DEFAULT: IDefault;
|
|
248
216
|
export declare const TEMPLATE_MODE: ITemplateMode[];
|
|
249
217
|
export declare const CONTENT_TEMPLATE_MODE: IContentTemplateMode[];
|
|
218
|
+
export declare const TEMPLATE_DEFAULT_MODE = "SPEAKER";
|
|
219
|
+
export declare const CONTENT_DEFAULT_TEMPLATE_MODE = "MULTI_PIC_CONTENT_HIGH_PRIORITY";
|
|
250
220
|
export declare const APP_NAME: {
|
|
251
221
|
STANDARD_WEBRTC: string;
|
|
252
222
|
THIRD_WEBRTC: string;
|
|
253
223
|
};
|
|
254
224
|
export declare const EVENT_TYPE_MAP: {
|
|
255
|
-
|
|
256
|
-
unmuteAudio: string;
|
|
257
|
-
muteVideo: string;
|
|
258
|
-
unmuteVideo: string;
|
|
225
|
+
[key: string]: string;
|
|
259
226
|
};
|
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';
|