@xylink/xy-rtc-sdk 2.0.4 → 2.1.0
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/index.es.js +1 -0
- package/lib/index.js +1 -1
- package/lib/src/action/index.d.ts +40 -13
- package/lib/src/enum/contraints.d.ts +217 -0
- package/lib/src/enum/errorCode.d.ts +874 -0
- package/lib/src/enum/index.d.ts +15 -186
- package/lib/src/main/client.d.ts +89 -29
- package/lib/src/main/helper.d.ts +1 -1
- package/lib/src/main/layoutManager.d.ts +46 -18
- package/lib/src/main/peer.d.ts +27 -4
- package/lib/src/main/stream.d.ts +27 -1
- package/lib/src/main/videoManager.d.ts +1 -1
- package/lib/src/tools/browser.d.ts +3 -1
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/tools/detect.d.ts +1 -0
- package/lib/src/tools/httpClient.d.ts +21 -11
- package/lib/src/tools/socket.d.ts +1 -1
- package/lib/src/tools/utils.d.ts +15 -2
- package/lib/src/tools/verify.d.ts +7 -0
- package/lib/src/type/base.d.ts +39 -2
- package/lib/src/type/client.d.ts +70 -10
- package/lib/src/type/stream.d.ts +29 -2
- package/package.json +7 -4
- package/lib/index.cjs.js +0 -1
package/lib/src/main/peer.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ export default class Peer {
|
|
|
30
30
|
private internels;
|
|
31
31
|
private isShareContent;
|
|
32
32
|
private senderInterval;
|
|
33
|
+
private isResendContentOffer;
|
|
34
|
+
private isRestartIceConnection;
|
|
33
35
|
constructor(client: Client, stream: Stream);
|
|
34
36
|
getInternels(): IInternels;
|
|
35
37
|
/**
|
|
@@ -45,7 +47,7 @@ export default class Peer {
|
|
|
45
47
|
*
|
|
46
48
|
* @private
|
|
47
49
|
* @param { string } type 消息Key
|
|
48
|
-
* @param {
|
|
50
|
+
* @param { string } code 状态码
|
|
49
51
|
* @param { string } msg 消息内容
|
|
50
52
|
* @param { any } detail 消息数据
|
|
51
53
|
*/
|
|
@@ -106,7 +108,7 @@ export default class Peer {
|
|
|
106
108
|
* @param { number } bandwidth 需要限定的带宽值
|
|
107
109
|
* @param { boolean } isIncreaseBase 带宽是否需要✖️系数1000
|
|
108
110
|
*/
|
|
109
|
-
setBandWidth(trackId: string, bandwidth
|
|
111
|
+
setBandWidth(trackId: string, bandwidth: number | undefined, isIncreaseBase: boolean | undefined, stream: MediaStream | null): Promise<void>;
|
|
110
112
|
/**
|
|
111
113
|
* View the cb of ice connectionn status change
|
|
112
114
|
* Maybe status:'new', 'checking', 'connected', 'completed', 'failed', 'disconnected', 'closed'
|
|
@@ -128,7 +130,7 @@ export default class Peer {
|
|
|
128
130
|
*
|
|
129
131
|
* @public
|
|
130
132
|
*/
|
|
131
|
-
restartIceConnection(): Promise<void>;
|
|
133
|
+
restartIceConnection(isRestartIceConnection?: boolean): Promise<void>;
|
|
132
134
|
/**
|
|
133
135
|
* 关闭PeerConnection连接、销毁状态
|
|
134
136
|
*/
|
|
@@ -141,6 +143,8 @@ export default class Peer {
|
|
|
141
143
|
* @param { IPushType } pushType 推送类型,all全推送,video只推送video,audio只推送audio, content只推送content video流
|
|
142
144
|
*/
|
|
143
145
|
publish(stream: Stream, pushType?: IPushType): void;
|
|
146
|
+
reSendContentOffer(): void;
|
|
147
|
+
resetContentStream(contentStreams: IStreamObj[]): void;
|
|
144
148
|
/**
|
|
145
149
|
* 替换People Video Track轨道
|
|
146
150
|
*
|
|
@@ -197,6 +201,16 @@ export default class Peer {
|
|
|
197
201
|
* @param { IStreamObj } item 自定义Stream流对象
|
|
198
202
|
*/
|
|
199
203
|
private addStreamRenders;
|
|
204
|
+
preferCodec(codecs: RTCRtpCodecCapability[], mimeType: string): RTCRtpCodecCapability[];
|
|
205
|
+
/**
|
|
206
|
+
* 向peer添加Track轨道数据
|
|
207
|
+
*
|
|
208
|
+
* @private
|
|
209
|
+
* @param { TCustomStream | MediaStreamTrack } track Track轨道数据
|
|
210
|
+
* @param { RTCRtpTransceiverDirection } direction 指定添加到peer上的方向
|
|
211
|
+
* @param { IStreamObj } item 自定义Stream流对象
|
|
212
|
+
*/
|
|
213
|
+
private addTransceiverByPeer;
|
|
200
214
|
/**
|
|
201
215
|
* 关联自定义stream对象和Sender发送器数据
|
|
202
216
|
*
|
|
@@ -214,7 +228,14 @@ export default class Peer {
|
|
|
214
228
|
*/
|
|
215
229
|
private replaceAudioTrack;
|
|
216
230
|
/**
|
|
217
|
-
*
|
|
231
|
+
* 替换视频Track轨道
|
|
232
|
+
*
|
|
233
|
+
* @private
|
|
234
|
+
* @param { IStreamObj[] } streamList 自定义媒体流对象列表数据
|
|
235
|
+
*/
|
|
236
|
+
private replaceVideoTrack;
|
|
237
|
+
/**
|
|
238
|
+
* Replace all Track
|
|
218
239
|
*
|
|
219
240
|
* @private
|
|
220
241
|
* @param { IStreamObj[] } streamList 自定义媒体流对象列表数据
|
|
@@ -224,6 +245,7 @@ export default class Peer {
|
|
|
224
245
|
* 获取sender的发送数据
|
|
225
246
|
*
|
|
226
247
|
* @private
|
|
248
|
+
* @param { 'sender' | 'audioSender' } key
|
|
227
249
|
* @param { RTCStatsReport } stats sender发送器的统计数据
|
|
228
250
|
* @param { IInternels } internels 自定义internels统计数据
|
|
229
251
|
* @param { IStreamSender } senderItem sender发送器对象
|
|
@@ -240,6 +262,7 @@ export default class Peer {
|
|
|
240
262
|
* @returns { IReceiver } 接收端的统计数据
|
|
241
263
|
*/
|
|
242
264
|
private getReceiverStatus;
|
|
265
|
+
private getReceiverAudioTrackStatus;
|
|
243
266
|
/**
|
|
244
267
|
* 计算速率
|
|
245
268
|
*
|
package/lib/src/main/stream.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export default class Stream extends Emmitter {
|
|
|
25
25
|
private isShareContent;
|
|
26
26
|
private audioDeviceId;
|
|
27
27
|
private videoDeviceId;
|
|
28
|
+
private isFirefox;
|
|
29
|
+
private isReduceResolution;
|
|
28
30
|
constructor(params: {
|
|
29
31
|
logger: Logger;
|
|
30
32
|
client?: Client;
|
|
@@ -113,6 +115,20 @@ export default class Stream extends Emmitter {
|
|
|
113
115
|
muteVideo?: boolean;
|
|
114
116
|
muteAudio?: boolean;
|
|
115
117
|
}): Promise<IStatus>;
|
|
118
|
+
/**
|
|
119
|
+
* 获取content采集配置信息
|
|
120
|
+
*
|
|
121
|
+
* @param {180 | 360 | 720} resolution
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
private getPeopleContraints;
|
|
125
|
+
/**
|
|
126
|
+
* 获取content采集配置信息
|
|
127
|
+
*
|
|
128
|
+
* @param { 720 | 1080 } resolution
|
|
129
|
+
* @returns
|
|
130
|
+
*/
|
|
131
|
+
private getContentContrints;
|
|
116
132
|
/**
|
|
117
133
|
*
|
|
118
134
|
* @param { boolean } video 是否开启摄像头
|
|
@@ -152,6 +168,11 @@ export default class Stream extends Emmitter {
|
|
|
152
168
|
* 3. 初始化remote画面
|
|
153
169
|
*/
|
|
154
170
|
initRemoteStreams(stream: MediaStream | null): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* firefox 采流
|
|
173
|
+
* @param stream
|
|
174
|
+
*/
|
|
175
|
+
initFirefoxRemoteStreams(stream: MediaStream): Promise<void>;
|
|
155
176
|
/**
|
|
156
177
|
* 1. 初始化本地Local画面
|
|
157
178
|
*/
|
|
@@ -169,8 +190,13 @@ export default class Stream extends Emmitter {
|
|
|
169
190
|
closeContentStream(): void;
|
|
170
191
|
/**
|
|
171
192
|
* 创建share content stream
|
|
193
|
+
*
|
|
194
|
+
* @public
|
|
195
|
+
* @param { { screenAudio : boolean } } screenAudio 是否开启共享屏幕声音
|
|
172
196
|
*/
|
|
173
|
-
createContentStream(
|
|
197
|
+
createContentStream({ screenAudio }?: {
|
|
198
|
+
screenAudio: boolean;
|
|
199
|
+
}): Promise<IStreamObj[]>;
|
|
174
200
|
electronCapture(selectedSourceId: string): Promise<unknown>;
|
|
175
201
|
getElectronContentSources(desktopCapturer: any, types?: any): Promise<ISource[] | any>;
|
|
176
202
|
/**
|
|
@@ -11,7 +11,7 @@ export declare const platform: () => {
|
|
|
11
11
|
isPc: boolean;
|
|
12
12
|
isMac: boolean;
|
|
13
13
|
isWindows: boolean;
|
|
14
|
-
|
|
14
|
+
isIPad: boolean;
|
|
15
15
|
isChrome: boolean;
|
|
16
16
|
isLinux: boolean;
|
|
17
17
|
isFirefox: boolean;
|
|
@@ -51,3 +51,5 @@ export declare const getIOSVersion: () => {
|
|
|
51
51
|
minor: any;
|
|
52
52
|
} | undefined;
|
|
53
53
|
export declare const getVerison: () => number;
|
|
54
|
+
export declare const isPC: boolean;
|
|
55
|
+
export declare const isMobile: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-24 14:06:05
|
|
6
6
|
*/
|
|
7
|
-
export declare const version = "2.0
|
|
7
|
+
export declare const version = "2.1.0 - build on 2022-05-20 13:50";
|
|
8
8
|
export declare const proxy: {
|
|
9
9
|
wssHost: string;
|
|
10
10
|
restHost: string;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
8
8
|
import Logger from '../tools/logger';
|
|
9
|
+
import { IToken, ISignParams } from '../type';
|
|
9
10
|
export interface IResponseSuccess {
|
|
10
11
|
code: number;
|
|
11
12
|
data: any;
|
|
@@ -14,15 +15,8 @@ export interface IResponseFailed {
|
|
|
14
15
|
code: number;
|
|
15
16
|
data: any;
|
|
16
17
|
}
|
|
17
|
-
export interface ISignParams {
|
|
18
|
-
method: string;
|
|
19
|
-
url: string;
|
|
20
|
-
data: string;
|
|
21
|
-
clientId: string;
|
|
22
|
-
clientSecret: string;
|
|
23
|
-
}
|
|
24
18
|
export interface IAxiosRequestConfig extends AxiosRequestConfig {
|
|
25
|
-
sign?: 0 | 1
|
|
19
|
+
sign?: 0 | 1;
|
|
26
20
|
clientSecret?: string;
|
|
27
21
|
clientId?: string;
|
|
28
22
|
}
|
|
@@ -33,13 +27,29 @@ declare class HttpClient {
|
|
|
33
27
|
logger: Logger | null;
|
|
34
28
|
private baseUrl;
|
|
35
29
|
private clientId;
|
|
30
|
+
private clientSecret;
|
|
31
|
+
private retryCount;
|
|
36
32
|
constructor(commonOption: IAxiosRequestConfig);
|
|
33
|
+
refreshToken(baseURL?: string): Promise<any>;
|
|
37
34
|
setLogger(logger: Logger): void;
|
|
38
35
|
setBaseUrl(url: string): void;
|
|
39
|
-
|
|
36
|
+
setClientInfo({ clientId, clientSecret }: {
|
|
37
|
+
clientId: string;
|
|
38
|
+
clientSecret: string;
|
|
39
|
+
}): void;
|
|
40
40
|
setHttpConfig(config: IAxiosRequestConfig): void;
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
getApiHeader(params: ISignParams): {
|
|
42
|
+
Authorization?: string | undefined;
|
|
43
|
+
'x-xy-clientid': string;
|
|
44
|
+
'x-xy-clienttype': string;
|
|
45
|
+
'x-xy-nonce': number;
|
|
46
|
+
'x-xy-timestamp': number;
|
|
47
|
+
'x-xy-signtype': string;
|
|
48
|
+
'x-xy-sign': string;
|
|
49
|
+
'x-xy-signatureversion': string;
|
|
50
|
+
};
|
|
51
|
+
setLoginInfo(loginInfo: IToken | null): void;
|
|
52
|
+
getLoginInfo(): any;
|
|
43
53
|
assignOptions: (option?: AxiosRequestConfig | undefined) => AxiosRequestConfig & {
|
|
44
54
|
params: any;
|
|
45
55
|
};
|
|
@@ -33,7 +33,7 @@ declare class Socket {
|
|
|
33
33
|
removeEvent(): void;
|
|
34
34
|
onOpenSocket: (e: any) => void;
|
|
35
35
|
onHandleMessage: (e: any) => void;
|
|
36
|
-
onCloseSocket: (e:
|
|
36
|
+
onCloseSocket: (e: CloseEvent) => void;
|
|
37
37
|
onErrorSocket: (e: any) => void;
|
|
38
38
|
sendHeartBeat(): void;
|
|
39
39
|
creatTimeout(): void;
|
package/lib/src/tools/utils.d.ts
CHANGED
|
@@ -46,9 +46,22 @@ export declare const diffTime: (time1: number, time2: number, format?: string) =
|
|
|
46
46
|
export declare function mapToObj<T>(data: Map<string, T>): {
|
|
47
47
|
[key: string]: T;
|
|
48
48
|
};
|
|
49
|
-
export declare const getStatus: (code:
|
|
50
|
-
code:
|
|
49
|
+
export declare const getStatus: (code: string, detail?: any, msg?: string) => {
|
|
50
|
+
code: string;
|
|
51
51
|
msg: string;
|
|
52
52
|
detail: any;
|
|
53
53
|
};
|
|
54
|
+
export declare const getMeetingStatus: (success: boolean, code?: string | undefined, msg?: string | undefined) => {
|
|
55
|
+
success: boolean;
|
|
56
|
+
data: {
|
|
57
|
+
code: string;
|
|
58
|
+
msg: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
success: boolean;
|
|
62
|
+
data: {
|
|
63
|
+
code?: undefined;
|
|
64
|
+
msg?: undefined;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
54
67
|
export declare const getErrorMsg: (err: Error) => string;
|
package/lib/src/type/base.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SDK对外回调错误消息
|
|
3
3
|
*
|
|
4
|
-
* @property {
|
|
4
|
+
* @property { string } code 错误码
|
|
5
5
|
* @property { string } msg 错误信息
|
|
6
6
|
* @property { unknwn } detail 数据详情
|
|
7
7
|
*/
|
|
8
8
|
export interface IStatus {
|
|
9
|
-
code:
|
|
9
|
+
code: string;
|
|
10
10
|
msg: string;
|
|
11
11
|
detail: any;
|
|
12
12
|
}
|
|
@@ -27,3 +27,40 @@ export interface ICheckSystemRequirements {
|
|
|
27
27
|
isSupportBrowser: boolean;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* token 信息
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export interface IToken {
|
|
35
|
+
access_token: string;
|
|
36
|
+
signSecret: string;
|
|
37
|
+
refresh_token?: string;
|
|
38
|
+
domain?: string;
|
|
39
|
+
expires_in?: number;
|
|
40
|
+
openid?: string;
|
|
41
|
+
scope?: string;
|
|
42
|
+
token_type?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
45
|
+
/**
|
|
46
|
+
* API网关 签名参数
|
|
47
|
+
*
|
|
48
|
+
* @property { Method } method 请求方法
|
|
49
|
+
* @property { string } url 请求url, 包含query参数
|
|
50
|
+
* @property { string } body 请求体, 需进行json转换, 无请求体,则传入""
|
|
51
|
+
* @property { string } clientId
|
|
52
|
+
* @property { string } clienttype
|
|
53
|
+
* @property { string } clientSecret 签名秘钥: 此密钥为网关平台颁发的ClientSecret. 未登录时,需传入此值
|
|
54
|
+
* @property { string } token 需进行token校验的,必须传入此值
|
|
55
|
+
* @property { string } signSecret 需进行token校验的,必须传入此值
|
|
56
|
+
*/
|
|
57
|
+
export interface ISignParams {
|
|
58
|
+
method: string;
|
|
59
|
+
url: string;
|
|
60
|
+
body: string;
|
|
61
|
+
clientId: string;
|
|
62
|
+
clienttype: string;
|
|
63
|
+
clientSecret: string;
|
|
64
|
+
token: string;
|
|
65
|
+
signSecret: string;
|
|
66
|
+
}
|
package/lib/src/type/client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IToken } from './base';
|
|
1
2
|
import VideoManager from '../main/videoManager';
|
|
2
3
|
/**
|
|
3
4
|
* 向Client推送流类型
|
|
@@ -110,6 +111,15 @@ export declare type IVideoAudioMessageType = 'AUDIO_MUTE' | 'VIDEO_MUTE' | 'AUDI
|
|
|
110
111
|
* @value AUDIO_CONTENT 仅音频共享
|
|
111
112
|
*/
|
|
112
113
|
export declare type ILayoutState = 'MUTE' | 'REQUEST' | 'NORMAL' | 'INVALID' | 'AUDIO_TEL' | 'AUDIO_ONLY' | 'AUDIO_CONTENT';
|
|
114
|
+
/**
|
|
115
|
+
* 分享content类型
|
|
116
|
+
*
|
|
117
|
+
* @value NONE 无
|
|
118
|
+
* @value AUDIO 只分享audio
|
|
119
|
+
* @value VIDEO 只分享video
|
|
120
|
+
* @value BOTH 分享video + audio
|
|
121
|
+
*/
|
|
122
|
+
export declare type IContentMode = 'NONE' | 'AUDIO' | 'VIDEO' | 'BOTH';
|
|
113
123
|
/**
|
|
114
124
|
* 埋点数据上报类型
|
|
115
125
|
*
|
|
@@ -178,11 +188,13 @@ export declare type IQualityType = 0 | 1 | 2;
|
|
|
178
188
|
* @property { string } __hideId 是否是隐身入会模式,hide代表隐身入会,为空代表正常模式
|
|
179
189
|
* @property { string } __monitorMode 是否是巡课模式,默认是'',MONITOR代表巡课模式
|
|
180
190
|
* @property { boolean } isThird 埋点
|
|
181
|
-
* @property { boolean } isSupportHybridCloud
|
|
191
|
+
* @property { boolean } isSupportHybridCloud 是否是混合云,默认公有云。 如果有探测到内网地址,则此值为true,将不进行鉴权。
|
|
192
|
+
* @property { boolean } isVerifyMeetingId 是否校验会议号,默认校验
|
|
182
193
|
*
|
|
183
194
|
*/
|
|
184
195
|
export interface IClientConfig {
|
|
185
|
-
clientId
|
|
196
|
+
clientId: string;
|
|
197
|
+
clientSecret?: string;
|
|
186
198
|
wssServer?: string;
|
|
187
199
|
httpServer?: string;
|
|
188
200
|
logServer?: string;
|
|
@@ -201,6 +213,7 @@ export interface IClientConfig {
|
|
|
201
213
|
__monitorMode?: string;
|
|
202
214
|
isThird?: boolean;
|
|
203
215
|
isSupportHybridCloud?: boolean;
|
|
216
|
+
isVerifyMeetingId?: boolean;
|
|
204
217
|
}
|
|
205
218
|
export interface ILayoutParams {
|
|
206
219
|
rosters: IRoster[];
|
|
@@ -215,6 +228,7 @@ export declare type ITemplateObj = {
|
|
|
215
228
|
position: number[];
|
|
216
229
|
resolution: IResolutionType;
|
|
217
230
|
zIndex?: number;
|
|
231
|
+
isContent?: boolean;
|
|
218
232
|
};
|
|
219
233
|
export interface ITypeTemplate {
|
|
220
234
|
[id: string]: ITemplateObj[];
|
|
@@ -245,6 +259,8 @@ export interface IDefault {
|
|
|
245
259
|
timestamp: number;
|
|
246
260
|
receiver: {};
|
|
247
261
|
sender: {};
|
|
262
|
+
audioReceiver: {};
|
|
263
|
+
audioSender: {};
|
|
248
264
|
};
|
|
249
265
|
RESOLUTION: number;
|
|
250
266
|
ROSTER: IRoster;
|
|
@@ -276,6 +292,7 @@ export interface IDefault {
|
|
|
276
292
|
height: number;
|
|
277
293
|
};
|
|
278
294
|
};
|
|
295
|
+
CONF_INFO: IConfInfo;
|
|
279
296
|
}
|
|
280
297
|
/**
|
|
281
298
|
* SDK登录结果
|
|
@@ -439,15 +456,9 @@ export interface IHttpConfig {
|
|
|
439
456
|
*
|
|
440
457
|
* 此信息是由业务层提供网关配置
|
|
441
458
|
*/
|
|
442
|
-
export interface IConfig {
|
|
459
|
+
export interface IConfig extends IToken {
|
|
443
460
|
client_id: string;
|
|
444
|
-
|
|
445
|
-
refresh_token?: string;
|
|
446
|
-
domain?: string;
|
|
447
|
-
expires_in?: string;
|
|
448
|
-
openid?: string;
|
|
449
|
-
scope?: string;
|
|
450
|
-
token_type?: string;
|
|
461
|
+
client_secret: string;
|
|
451
462
|
}
|
|
452
463
|
/**
|
|
453
464
|
* 会议室配置信息
|
|
@@ -920,4 +931,53 @@ export interface IBulkRoster {
|
|
|
920
931
|
participantId: string;
|
|
921
932
|
}[];
|
|
922
933
|
}
|
|
934
|
+
/**
|
|
935
|
+
* conf 会议属性
|
|
936
|
+
*
|
|
937
|
+
* @property { 'contentOnhold' } type 类型
|
|
938
|
+
* @property { string } audioTrackId content audio track id
|
|
939
|
+
* @property { string } contentUrl content uri
|
|
940
|
+
*/
|
|
941
|
+
export interface IConfProperty {
|
|
942
|
+
type: 'contentOnhold';
|
|
943
|
+
audioTrackId?: string;
|
|
944
|
+
contentUrl?: string;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* track 信息
|
|
948
|
+
*
|
|
949
|
+
* @property { string } streamId stream id
|
|
950
|
+
* @property { MediaStreamTrack } track
|
|
951
|
+
* @property { string } trackId track id
|
|
952
|
+
*/
|
|
953
|
+
export interface ITrackInfo {
|
|
954
|
+
streamId: string;
|
|
955
|
+
track: MediaStreamTrack;
|
|
956
|
+
trackId: string;
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* ws close reason
|
|
960
|
+
*/
|
|
961
|
+
export declare type TErrorReason<P = {}> = P & {
|
|
962
|
+
code?: number;
|
|
963
|
+
};
|
|
964
|
+
/**
|
|
965
|
+
* 是否静音
|
|
966
|
+
*
|
|
967
|
+
* @enum
|
|
968
|
+
*
|
|
969
|
+
* @property {number} AutoMute.SMART 智能静音
|
|
970
|
+
* @property {number} AutoMute.ALL 全部静音
|
|
971
|
+
* @property {number} AutoMute.NOT 不静音
|
|
972
|
+
* @property {number} AutoMute.FORCE 强制静音
|
|
973
|
+
*/
|
|
974
|
+
export declare enum AutoMute {
|
|
975
|
+
SMART = 0,
|
|
976
|
+
ALL = 1,
|
|
977
|
+
NOT = 2,
|
|
978
|
+
FORCE = 3
|
|
979
|
+
}
|
|
980
|
+
export interface IGetConferenceParams {
|
|
981
|
+
autoMute: AutoMute;
|
|
982
|
+
}
|
|
923
983
|
export {};
|
package/lib/src/type/stream.d.ts
CHANGED
|
@@ -49,6 +49,21 @@ export declare type IStreamObjType = 'contentStream' | 'previewStream' | 'pipeli
|
|
|
49
49
|
* @value 200 高帧率
|
|
50
50
|
*/
|
|
51
51
|
export declare type IMediaQualityType = 0 | 100 | 200;
|
|
52
|
+
/**
|
|
53
|
+
* content采集支持分辨率
|
|
54
|
+
*
|
|
55
|
+
* @value 720 1280*720
|
|
56
|
+
* @value 1080 1920*1080
|
|
57
|
+
*/
|
|
58
|
+
export declare type IContentResolutionType = 720 | 1080;
|
|
59
|
+
/**
|
|
60
|
+
* people采集支持分辨率
|
|
61
|
+
*
|
|
62
|
+
* @value 180 320*180
|
|
63
|
+
* @value 360 640*360
|
|
64
|
+
* @value 720 1280*720
|
|
65
|
+
*/
|
|
66
|
+
export declare type IPeopleResolutionType = 180 | 360 | 720;
|
|
52
67
|
/**
|
|
53
68
|
* 自定义流数据
|
|
54
69
|
*
|
|
@@ -161,6 +176,8 @@ export declare type IStreamInitConfog = {
|
|
|
161
176
|
* @property { number } timestamp 时间戳
|
|
162
177
|
* @property { [prop: string]: IReceiver } receiver 所有接收视频的列表数据
|
|
163
178
|
* @property { [prop: string]: ISender } sender 所有发送视频的列表数据
|
|
179
|
+
* @property { [prop: string]: IReceiver } audioReceiver 所有接收音频的列表数据
|
|
180
|
+
* @property { [prop: string]: ISender } audioSender 所有发送音频的列表数据
|
|
164
181
|
*/
|
|
165
182
|
export interface IInternels {
|
|
166
183
|
bytesReceived: number;
|
|
@@ -175,6 +192,12 @@ export interface IInternels {
|
|
|
175
192
|
sender: {
|
|
176
193
|
[prop: string]: ISender;
|
|
177
194
|
};
|
|
195
|
+
audioReceiver: {
|
|
196
|
+
[prop: string]: IReceiver;
|
|
197
|
+
};
|
|
198
|
+
audioSender: {
|
|
199
|
+
[prop: string]: ISender;
|
|
200
|
+
};
|
|
178
201
|
}
|
|
179
202
|
/**
|
|
180
203
|
* 接收器 Receiver 统计数据
|
|
@@ -235,6 +258,8 @@ export interface IReceiver {
|
|
|
235
258
|
jitter: number;
|
|
236
259
|
endpointId?: string;
|
|
237
260
|
participantId?: number;
|
|
261
|
+
mimeType?: string;
|
|
262
|
+
audioLevel?: number;
|
|
238
263
|
}
|
|
239
264
|
/**
|
|
240
265
|
* 发送器 Sender 统计数据
|
|
@@ -282,6 +307,8 @@ export interface ISender {
|
|
|
282
307
|
pliCount: number;
|
|
283
308
|
nackCount: number;
|
|
284
309
|
ssrc: string;
|
|
310
|
+
mimeType: string;
|
|
311
|
+
audioLevel?: number;
|
|
285
312
|
}
|
|
286
313
|
/**
|
|
287
314
|
* 基础视频约束配置
|
|
@@ -291,7 +318,7 @@ export interface ISender {
|
|
|
291
318
|
* @property { 'crop-and-scale' } resizeMode 裁剪模式,此处使用裁剪比例模式,以满足分辨率要求;
|
|
292
319
|
*/
|
|
293
320
|
export interface IBASE_CONTRAINTS {
|
|
294
|
-
frameRate
|
|
321
|
+
frameRate?: ConstrainDouble;
|
|
295
322
|
aspectRatio: number;
|
|
296
323
|
resizeMode: 'crop-and-scale';
|
|
297
324
|
}
|
|
@@ -309,8 +336,8 @@ export interface ICONTENT_CONTRAINTS {
|
|
|
309
336
|
cursor: string;
|
|
310
337
|
aspectRatio: number;
|
|
311
338
|
resizeMode: 'crop-and-scale';
|
|
312
|
-
frameRate: ConstrainDouble;
|
|
313
339
|
logicalSurface: true;
|
|
340
|
+
frameRate?: ConstrainDouble;
|
|
314
341
|
}
|
|
315
342
|
/**
|
|
316
343
|
* 媒体通知Web对视频流的分辨率、带宽信息、帧率进行限制
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylink/xy-rtc-sdk",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "XYRTC SDK(小鱼易连web音视频 sdk)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@typescript-eslint/eslint-plugin": "^2.9.0",
|
|
48
48
|
"@typescript-eslint/parser": "^2.9.0",
|
|
49
49
|
"@vitejs/plugin-react-refresh": "^1.3.2",
|
|
50
|
-
"antd": "4.
|
|
50
|
+
"antd": "4.10.1",
|
|
51
51
|
"axios": "^0.19.1",
|
|
52
52
|
"babel-loader": "^8.0.6",
|
|
53
53
|
"babel-plugin-import": "^1.12.2",
|
|
@@ -82,15 +82,18 @@
|
|
|
82
82
|
"typescript": "^4.3.2",
|
|
83
83
|
"validate-commit-msg": "^2.14.0",
|
|
84
84
|
"vconsole": "^3.3.4",
|
|
85
|
-
"vite": "^2.
|
|
85
|
+
"vite": "^2.6.13",
|
|
86
86
|
"vite-plugin-imp": "^2.0.7",
|
|
87
87
|
"vite-plugin-importer": "^0.2.1",
|
|
88
|
+
"vite-plugin-svgr": "^1.1.0",
|
|
88
89
|
"xytools": "1.5.2-beta.4"
|
|
89
90
|
},
|
|
90
91
|
"dependencies": {
|
|
91
|
-
"crypto-
|
|
92
|
+
"crypto-browserify": "^3.12.0",
|
|
93
|
+
"crypto-js": "^4.1.1",
|
|
92
94
|
"dexie": "^2.0.4",
|
|
93
95
|
"dexie-export-import": "^1.0.0-rc.1",
|
|
96
|
+
"encryptlong": "^3.1.4",
|
|
94
97
|
"js-base64": "^3.6.1",
|
|
95
98
|
"qs": "^6.9.4",
|
|
96
99
|
"uuid": "^7.0.2"
|