@xylink/xy-rtc-sdk 2.0.2 → 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/lib/index.cjs.js +1 -1
- package/lib/index.js +1 -1
- package/lib/src/action/index.d.ts +21 -5
- package/lib/src/enum/errorCode.d.ts +4 -1
- package/lib/src/enum/index.d.ts +102 -0
- package/lib/src/index.d.ts +6 -4
- package/lib/src/main/client.d.ts +52 -5
- package/lib/src/main/deviceManager.d.ts +9 -1
- package/lib/src/main/helper.d.ts +20 -1
- package/lib/src/main/layoutManager.d.ts +7 -4
- package/lib/src/main/peer.d.ts +5 -6
- package/lib/src/main/stream.d.ts +65 -8
- package/lib/src/main/videoManager.d.ts +1 -1
- package/lib/src/tools/browser.d.ts +15 -0
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/tools/detect.d.ts +6 -0
- package/lib/src/tools/enum.d.ts +4 -28
- package/lib/src/tools/httpClient.d.ts +10 -2
- package/lib/src/tools/i18n.d.ts +8 -0
- package/lib/src/tools/socket.d.ts +1 -1
- package/lib/src/tools/utils.d.ts +2 -2
- package/lib/src/type/base.d.ts +17 -0
- package/lib/src/type/client.d.ts +58 -13
- package/lib/src/type/device.d.ts +2 -2
- package/lib/src/type/stream.d.ts +6 -1
- package/package.json +1 -1
|
@@ -6,13 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
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;
|
|
14
16
|
private seqId;
|
|
15
17
|
private statesTime;
|
|
18
|
+
commonParams: ICommonParams;
|
|
16
19
|
constructor();
|
|
17
20
|
setBaseUrl(baseUrl: string, logUrl: string): void;
|
|
18
21
|
setLogBaseUrl(logUrl: string): void;
|
|
@@ -36,15 +39,28 @@ declare class Action {
|
|
|
36
39
|
setLoginInfo(loginInfo: any): void;
|
|
37
40
|
getUserInfo(token: string): Promise<any>;
|
|
38
41
|
getCallUri(params: any): Promise<any>;
|
|
39
|
-
verifyPassword(confNumber: string, password: string
|
|
42
|
+
verifyPassword(confNumber: string, password: string): Promise<any>;
|
|
40
43
|
hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
|
|
41
|
-
fetchErrorCode(
|
|
44
|
+
fetchErrorCode(): Promise<any>;
|
|
42
45
|
getErrorCodeByJson(url: string): Promise<any>;
|
|
43
46
|
getConference(userProfileId: number, securityKey: string): Promise<any>;
|
|
44
47
|
setStates1(action: TStateAction, eventName: TEventName, params?: {}): Promise<void>;
|
|
45
48
|
setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
|
|
46
|
-
igonreMeetingMonito(confNumber: string
|
|
47
|
-
getAllocation(userId: number): Promise<any>;
|
|
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>;
|
|
48
64
|
}
|
|
49
65
|
declare const _default: Action;
|
|
50
66
|
export default _default;
|
package/lib/src/enum/index.d.ts
CHANGED
|
@@ -5,12 +5,17 @@
|
|
|
5
5
|
* @date 2019-10-30 14:12:52
|
|
6
6
|
*/
|
|
7
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;
|
|
8
10
|
export declare const SELF_MOCK_PID = 9999999999;
|
|
9
11
|
export declare const STREAM_CHANNEL_COUNT = 11;
|
|
10
12
|
export declare const MAX_PARTICIPANT_COUNT = 112;
|
|
11
13
|
export declare const STREAM_ERROR_CODE_MAP: number[];
|
|
12
14
|
export declare const SUPPORT_DEVICE_TYPE: string[];
|
|
13
15
|
export declare const MAX_PAGE_SIZE = 9;
|
|
16
|
+
export declare const NETWORK_TYPE_MAP: {
|
|
17
|
+
[key: string]: number;
|
|
18
|
+
};
|
|
14
19
|
export declare const MUTE_MAP: IMUTE_MAP;
|
|
15
20
|
export declare const CONTRAINTS_MAP: {
|
|
16
21
|
0: number[];
|
|
@@ -22,9 +27,106 @@ export declare const CONTRAINTS_MAP: {
|
|
|
22
27
|
11: number[];
|
|
23
28
|
12: number[];
|
|
24
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
|
+
};
|
|
25
44
|
export declare const BASE_CONTRAINTS: IBASE_CONTRAINTS;
|
|
26
45
|
export declare const CONTENT_BASE_CONTRAINTS: ICONTENT_CONTRAINTS;
|
|
46
|
+
export declare const FIREFOX_CONTENT_CONTRAINTS: {
|
|
47
|
+
'720': {
|
|
48
|
+
min: {
|
|
49
|
+
frameRate: number;
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
cursor: string;
|
|
53
|
+
aspectRatio: number;
|
|
54
|
+
resizeMode: "crop-and-scale";
|
|
55
|
+
logicalSurface: true;
|
|
56
|
+
};
|
|
57
|
+
max: {
|
|
58
|
+
frameRate: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
cursor: string;
|
|
62
|
+
aspectRatio: number;
|
|
63
|
+
resizeMode: "crop-and-scale";
|
|
64
|
+
logicalSurface: true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
'1080': {
|
|
68
|
+
min: {
|
|
69
|
+
frameRate: number;
|
|
70
|
+
width: number;
|
|
71
|
+
height: number;
|
|
72
|
+
cursor: string;
|
|
73
|
+
aspectRatio: number;
|
|
74
|
+
resizeMode: "crop-and-scale";
|
|
75
|
+
logicalSurface: true;
|
|
76
|
+
};
|
|
77
|
+
max: {
|
|
78
|
+
frameRate: number;
|
|
79
|
+
width: number;
|
|
80
|
+
height: number;
|
|
81
|
+
cursor: string;
|
|
82
|
+
aspectRatio: number;
|
|
83
|
+
resizeMode: "crop-and-scale";
|
|
84
|
+
logicalSurface: true;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
27
88
|
export declare const CONTENT_CONTRAINTS: {
|
|
89
|
+
'720': {
|
|
90
|
+
min: {
|
|
91
|
+
frameRate: number;
|
|
92
|
+
width: number;
|
|
93
|
+
height: number;
|
|
94
|
+
cursor: string;
|
|
95
|
+
aspectRatio: number;
|
|
96
|
+
resizeMode: "crop-and-scale";
|
|
97
|
+
logicalSurface: true;
|
|
98
|
+
};
|
|
99
|
+
max: {
|
|
100
|
+
frameRate: number;
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
cursor: string;
|
|
104
|
+
aspectRatio: number;
|
|
105
|
+
resizeMode: "crop-and-scale";
|
|
106
|
+
logicalSurface: true;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
'1080': {
|
|
110
|
+
min: {
|
|
111
|
+
frameRate: number;
|
|
112
|
+
width: number;
|
|
113
|
+
height: number;
|
|
114
|
+
cursor: string;
|
|
115
|
+
aspectRatio: number;
|
|
116
|
+
resizeMode: "crop-and-scale";
|
|
117
|
+
logicalSurface: true;
|
|
118
|
+
};
|
|
119
|
+
max: {
|
|
120
|
+
frameRate: number;
|
|
121
|
+
width: number;
|
|
122
|
+
height: number;
|
|
123
|
+
cursor: string;
|
|
124
|
+
aspectRatio: number;
|
|
125
|
+
resizeMode: "crop-and-scale";
|
|
126
|
+
logicalSurface: true;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
} | {
|
|
28
130
|
'720': {
|
|
29
131
|
min: {
|
|
30
132
|
frameRate: number;
|
package/lib/src/index.d.ts
CHANGED
|
@@ -9,15 +9,17 @@
|
|
|
9
9
|
import Logger from './tools/logger';
|
|
10
10
|
import Client from './main/client';
|
|
11
11
|
import Stream from './main/stream';
|
|
12
|
-
import { IClientConfig, IConfig } from './type';
|
|
12
|
+
import { IClientConfig, IConfig, TLocale, ICheckSystemRequirements } from './type';
|
|
13
13
|
import DeviceManager from './main/deviceManager';
|
|
14
|
-
import { getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo } from './main/helper';
|
|
14
|
+
import { getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo, getSendSupportedCodec, detectLocator } from './main/helper';
|
|
15
15
|
interface IXyRTC {
|
|
16
16
|
version: string;
|
|
17
17
|
client: Client | null;
|
|
18
18
|
logger: Logger;
|
|
19
|
-
checkSupportWebRTC: () =>
|
|
19
|
+
checkSupportWebRTC: () => Promise<ICheckSystemRequirements>;
|
|
20
|
+
checkSupportMobileWebRTC: () => Promise<ICheckSystemRequirements>;
|
|
20
21
|
checkSupportShareContent: () => boolean;
|
|
22
|
+
setLocale: (language: TLocale) => void;
|
|
21
23
|
createClient: (config: IClientConfig) => Client;
|
|
22
24
|
createStream: () => Stream;
|
|
23
25
|
setConfig: (config: IConfig) => void;
|
|
@@ -27,6 +29,6 @@ interface IXyRTC {
|
|
|
27
29
|
}
|
|
28
30
|
declare const xyRTC: IXyRTC;
|
|
29
31
|
export default xyRTC;
|
|
30
|
-
export { Client, Stream, DeviceManager, getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo };
|
|
32
|
+
export { Client, Stream, DeviceManager, getLayoutItemState, getVideoInfoByRotaion, getLayoutRotateInfo, getSendSupportedCodec, detectLocator };
|
|
31
33
|
export * from './type';
|
|
32
34
|
export { ERROR_CODE } from './enum/errorCode';
|
package/lib/src/main/client.d.ts
CHANGED
|
@@ -62,6 +62,11 @@ export default class Client extends Emmitter {
|
|
|
62
62
|
private errorcode;
|
|
63
63
|
private clientErrorState;
|
|
64
64
|
private limitResolution;
|
|
65
|
+
private reportDataTimer;
|
|
66
|
+
private reportDataFrequency;
|
|
67
|
+
private meetingQualityData;
|
|
68
|
+
private conferenceInfo;
|
|
69
|
+
private customLayoutCacheList;
|
|
65
70
|
private onDocumentChange;
|
|
66
71
|
constructor(config: IClientConfig, servers: IServers, logger: Logger);
|
|
67
72
|
static instance: Client;
|
|
@@ -130,6 +135,17 @@ export default class Client extends Emmitter {
|
|
|
130
135
|
* @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
|
|
131
136
|
*/
|
|
132
137
|
setVideoRenderer(key: string, wrapEleId: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* 重新播放视频
|
|
140
|
+
*
|
|
141
|
+
* @public
|
|
142
|
+
* @param { string[] ? } keys 指定重新播放的video
|
|
143
|
+
*/
|
|
144
|
+
playVideo(keys?: string[]): Promise<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* 重新播放音频
|
|
147
|
+
*/
|
|
148
|
+
playAudio(): Promise<boolean>;
|
|
133
149
|
/**
|
|
134
150
|
* 绑定streamId和audio ele元素,内部维护状态
|
|
135
151
|
*
|
|
@@ -159,6 +175,12 @@ export default class Client extends Emmitter {
|
|
|
159
175
|
* @param { number } currentPage 请求某一页数据
|
|
160
176
|
*/
|
|
161
177
|
setPageInfo(currentPage?: number): Promise<never> | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* 会议室信息,如号码、名称、类型、配置信息(是否有水印等)
|
|
180
|
+
*
|
|
181
|
+
* @private
|
|
182
|
+
*/
|
|
183
|
+
private handleConferenceInfo;
|
|
162
184
|
/**
|
|
163
185
|
* 处理wss返回的数据
|
|
164
186
|
*
|
|
@@ -236,8 +258,8 @@ export default class Client extends Emmitter {
|
|
|
236
258
|
* 小鱼账号初始登录,获取token方法
|
|
237
259
|
*
|
|
238
260
|
* @public
|
|
239
|
-
* @param { string } userName
|
|
240
|
-
* @param { string } password
|
|
261
|
+
* @param { string } userName 小鱼用户账号
|
|
262
|
+
* @param { string } password 小鱼用户账号密码
|
|
241
263
|
* @returns { Promise<Object> } { access_token }
|
|
242
264
|
*/
|
|
243
265
|
loginXYlinkAccount(userName: string, password: string): Promise<Object>;
|
|
@@ -250,7 +272,7 @@ export default class Client extends Emmitter {
|
|
|
250
272
|
getExternalLoginInfo(sdkUserInfo: ISdkUserInfo, params: ILoginExtAccount): Promise<{
|
|
251
273
|
code: number;
|
|
252
274
|
msg: string;
|
|
253
|
-
detail:
|
|
275
|
+
detail: any;
|
|
254
276
|
}>;
|
|
255
277
|
/**
|
|
256
278
|
* 第三方登录方法
|
|
@@ -274,7 +296,6 @@ export default class Client extends Emmitter {
|
|
|
274
296
|
* 获取错误码json链接
|
|
275
297
|
*
|
|
276
298
|
* @private
|
|
277
|
-
* @param { string } securityKey
|
|
278
299
|
* @returns
|
|
279
300
|
*/
|
|
280
301
|
private fetchErrorCode;
|
|
@@ -568,8 +589,9 @@ export default class Client extends Emmitter {
|
|
|
568
589
|
* @public
|
|
569
590
|
* @param { any } data 消息
|
|
570
591
|
* @param { boolean } isAutoAdd 序列号是否自动增加
|
|
592
|
+
* @param { boolean } isLog 是否写入日志
|
|
571
593
|
*/
|
|
572
|
-
sendSocketMessage(data: any, isAutoAdd?: boolean): void;
|
|
594
|
+
sendSocketMessage(data: any, isAutoAdd?: boolean, isLog?: boolean): void;
|
|
573
595
|
/**
|
|
574
596
|
* 校验会议室号
|
|
575
597
|
*
|
|
@@ -599,6 +621,31 @@ export default class Client extends Emmitter {
|
|
|
599
621
|
* @param { string[] } uriList 需要停止巡课的终端ID(callUri)
|
|
600
622
|
*/
|
|
601
623
|
stopMonitor(uriList?: string[]): void;
|
|
624
|
+
/**
|
|
625
|
+
* 订阅参会者信息
|
|
626
|
+
*
|
|
627
|
+
* @public
|
|
628
|
+
*/
|
|
629
|
+
subscribeBulkRoster(): Promise<unknown>;
|
|
630
|
+
/**
|
|
631
|
+
* 定时上报会议质量、网络数据
|
|
632
|
+
*
|
|
633
|
+
* @private
|
|
634
|
+
*/
|
|
635
|
+
private reportQualityData;
|
|
636
|
+
/**
|
|
637
|
+
* 发送会议质量数据
|
|
638
|
+
*
|
|
639
|
+
* @param { boolean ? } isLast 挂断状态
|
|
640
|
+
* @private
|
|
641
|
+
*/
|
|
642
|
+
private calcQualityData;
|
|
643
|
+
/**
|
|
644
|
+
* 停止上报网络数据
|
|
645
|
+
*
|
|
646
|
+
* @private
|
|
647
|
+
*/
|
|
648
|
+
private stopReportData;
|
|
602
649
|
/**
|
|
603
650
|
* 初始化DeviceManager事件
|
|
604
651
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @author jinghui-luo、chengfei
|
|
7
7
|
*
|
|
8
8
|
* Created at : 2020-11-26 14:41:51
|
|
9
|
-
* Last modified : 2021-
|
|
9
|
+
* Last modified : 2021-09-15 16:36:15
|
|
10
10
|
*/
|
|
11
11
|
import Logger from '../tools/logger';
|
|
12
12
|
import Emmitter from '../tools/emmitter';
|
|
@@ -70,10 +70,18 @@ declare class DeviceManager extends Emmitter {
|
|
|
70
70
|
* 销毁设备管理器实例
|
|
71
71
|
*/
|
|
72
72
|
destroy(): void;
|
|
73
|
+
/**
|
|
74
|
+
* 获取设备列表
|
|
75
|
+
*
|
|
76
|
+
* @private
|
|
77
|
+
* @returns { IDeviceList } list
|
|
78
|
+
*/
|
|
79
|
+
private getPrivateDevices;
|
|
73
80
|
/**
|
|
74
81
|
* 获取设备列表数据
|
|
75
82
|
*/
|
|
76
83
|
getDevices(): Promise<IDeviceList>;
|
|
84
|
+
setPermission(permission: ICurrentPermission): void;
|
|
77
85
|
/**
|
|
78
86
|
* 【私有方法】
|
|
79
87
|
* 向外提供权限信息
|
package/lib/src/main/helper.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @email luojinghui424@gmail.com
|
|
6
6
|
*
|
|
7
7
|
* Created at : 2021-01-09 14:45:46
|
|
8
|
-
* Last modified : 2021-
|
|
8
|
+
* Last modified : 2021-10-12 15:46:20
|
|
9
9
|
*/
|
|
10
10
|
import { ILayout, IVideoManagerState, IRotationInfoTotalItem } from '../type';
|
|
11
11
|
export declare const getLayoutItemState: (item: ILayout | ILayout, stream: MediaStream | null, vmState: IVideoManagerState) => "REQUEST" | "MUTE" | "NORMAL" | "AUDIO_TEL" | "AUDIO_ONLY" | "AUDIO_CONTENT";
|
|
@@ -30,3 +30,22 @@ export declare const getVideoInfoByRotaion: (width: number, height: number, cont
|
|
|
30
30
|
* @param containerHeight 当前参会者画面容器的高度
|
|
31
31
|
*/
|
|
32
32
|
export declare const getLayoutRotateInfo: (item: IRotationInfoTotalItem, containerWidth: number, containerHeight: number) => {};
|
|
33
|
+
/**
|
|
34
|
+
* 获取可支持的编解码
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
* @returns { Promise<Object> }
|
|
38
|
+
*/
|
|
39
|
+
export declare const getSendSupportedCodec: () => Object;
|
|
40
|
+
/**
|
|
41
|
+
* WebRTC 内外网探测
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
* @returns { Promise<Object> }
|
|
45
|
+
*/
|
|
46
|
+
export declare const detectLocator: ({ extId, clientId, clientSecret, httpServer }: {
|
|
47
|
+
extId: string;
|
|
48
|
+
clientId: string;
|
|
49
|
+
clientSecret: string;
|
|
50
|
+
httpServer?: string | undefined;
|
|
51
|
+
}) => Promise<string>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @email luojinghui424@gmail.com
|
|
7
7
|
*
|
|
8
8
|
* Created at : 2021-01-05 17:24:07
|
|
9
|
-
* Last modified : 2021-
|
|
9
|
+
* Last modified : 2021-10-18 16:03:49
|
|
10
10
|
*/
|
|
11
11
|
import Logger from '../tools/logger';
|
|
12
12
|
import { ILayout, IVideoRenders, IRoster, ITemplateObj, IScreenInfo, IMode, IOutputCustomLayout, ILayoutRoster, IResolutionType, IConfInfo, IPageInfo, IReqInfo, IQualityType, ICustomLayout } from '../type/index';
|
|
@@ -75,7 +75,9 @@ export default class LayoutManager {
|
|
|
75
75
|
* 回调 video 状态
|
|
76
76
|
*
|
|
77
77
|
* @param key endpointId + mediagroupId 组成的id
|
|
78
|
-
* @param data 最新的会议状态
|
|
78
|
+
* @param data 最新的会议状态 status === video track / video标签 监听到的状态
|
|
79
|
+
*
|
|
80
|
+
* state === roster 当前状态 + 上一次的status
|
|
79
81
|
*/
|
|
80
82
|
private onVideoStatusChange;
|
|
81
83
|
/**
|
|
@@ -85,6 +87,8 @@ export default class LayoutManager {
|
|
|
85
87
|
* @param wrapEleId wrap video element id
|
|
86
88
|
*/
|
|
87
89
|
setVideoRenderer(key: string, wrapEleId: string): void;
|
|
90
|
+
playVideo(keys?: string[]): Promise<void>;
|
|
91
|
+
updateLocalTrack(): void;
|
|
88
92
|
/**
|
|
89
93
|
* 使用最新的 videoTrackList 和 layoutResults 数据更新 layout 内容
|
|
90
94
|
*/
|
|
@@ -102,11 +106,10 @@ export default class LayoutManager {
|
|
|
102
106
|
* @param currentPage 请求某一页数据
|
|
103
107
|
*/
|
|
104
108
|
setPageInfo(currentPage?: number): void;
|
|
105
|
-
resetForceFullScreenId(): void;
|
|
106
109
|
/**
|
|
107
110
|
* 全屏请流
|
|
108
111
|
*/
|
|
109
|
-
calcForceFullScreenRequestLayout():
|
|
112
|
+
calcForceFullScreenRequestLayout(): boolean;
|
|
110
113
|
/**
|
|
111
114
|
* AUTO布局 请流
|
|
112
115
|
*/
|
package/lib/src/main/peer.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-25 18:53:01
|
|
6
6
|
*/
|
|
7
|
-
import { IInvite, IStreamObj, IStreamSender, IPushType, ICandidate } from '../type';
|
|
7
|
+
import { IInvite, IStreamObj, IStreamSender, IInternels, IPushType, ICandidate } from '../type';
|
|
8
8
|
import Client from './client';
|
|
9
9
|
import Logger from '../tools/logger';
|
|
10
10
|
import Stream from './stream';
|
|
@@ -19,10 +19,6 @@ export default class Peer {
|
|
|
19
19
|
client: Client;
|
|
20
20
|
peerConnection: RTCPeerConnection | null;
|
|
21
21
|
logger: Logger;
|
|
22
|
-
streams: {
|
|
23
|
-
localStream: MediaStream;
|
|
24
|
-
streams: MediaStream[];
|
|
25
|
-
};
|
|
26
22
|
invite: IInvite;
|
|
27
23
|
peerStatus: {
|
|
28
24
|
peerconnectionStatus: string;
|
|
@@ -35,6 +31,7 @@ export default class Peer {
|
|
|
35
31
|
private isShareContent;
|
|
36
32
|
private senderInterval;
|
|
37
33
|
constructor(client: Client, stream: Stream);
|
|
34
|
+
getInternels(): IInternels;
|
|
38
35
|
/**
|
|
39
36
|
* 初始化Peer模块
|
|
40
37
|
* 1. 创建PeerConnection
|
|
@@ -125,6 +122,7 @@ export default class Peer {
|
|
|
125
122
|
* @private
|
|
126
123
|
*/
|
|
127
124
|
private onHandleConnectionStateChange;
|
|
125
|
+
onHandleIcecandidateerror(e: Event): void;
|
|
128
126
|
/**
|
|
129
127
|
* 重连PeerConnection
|
|
130
128
|
*
|
|
@@ -177,8 +175,9 @@ export default class Peer {
|
|
|
177
175
|
setStream(streamList: IStreamObj[], kind: 'video' | 'audio'): void;
|
|
178
176
|
/**
|
|
179
177
|
* 计算发送/接收端internels统计数据,更新存储到到Layout结果数据中
|
|
180
|
-
*
|
|
181
178
|
* 自动每隔6s记录一次内容统计数据到数据库中
|
|
179
|
+
*
|
|
180
|
+
* @private
|
|
182
181
|
*/
|
|
183
182
|
private calcMeetingStats;
|
|
184
183
|
/**
|
package/lib/src/main/stream.d.ts
CHANGED
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-27 23:12:45
|
|
6
6
|
*/
|
|
7
|
-
import Logger from '
|
|
7
|
+
import Logger from '../tools/logger';
|
|
8
8
|
import Emmitter from '../tools/emmitter';
|
|
9
|
-
import { IStreamChangeType, IStreamObj, IGetMediaStreams, ISource, IStreamInitConfog, IStreamCurrent, IMediaSupportedConstraints, IStreamChange } from '../type';
|
|
9
|
+
import { IStreamChangeType, IStreamObj, IGetMediaStreams, ISource, IStreamInitConfog, IStreamCurrent, IMediaSupportedConstraints, IStreamChange, IStatus } from '../type';
|
|
10
10
|
import Peer from './peer';
|
|
11
11
|
import Client from './client';
|
|
12
12
|
export default class Stream extends Emmitter {
|
|
13
13
|
streams: IStreamObj[];
|
|
14
14
|
config: IStreamInitConfog;
|
|
15
15
|
current: IStreamCurrent;
|
|
16
|
+
isSupportReauthorize: boolean;
|
|
17
|
+
private isSupportAppendTrack;
|
|
16
18
|
private client;
|
|
17
19
|
private audioLevel;
|
|
18
20
|
private logger;
|
|
@@ -63,6 +65,15 @@ export default class Stream extends Emmitter {
|
|
|
63
65
|
switchDevice(type: 'audio' | 'video', deviceId: string): Promise<boolean>;
|
|
64
66
|
sendStreamStatus(): void;
|
|
65
67
|
private replaceAudioTrack;
|
|
68
|
+
/**
|
|
69
|
+
* 设备切换(视频)
|
|
70
|
+
* 1. 如果无法append多个track(Firefox会出现视频卡死现象), 则先删除video track
|
|
71
|
+
* 2. 创建新的stream, 获取到对应的videoTrack,添加给原先的stream
|
|
72
|
+
* 3. 如果可以append多个track,则此时会产生两个videoTrack,需删除原先的track. (后删除 可避免黑屏现象)
|
|
73
|
+
*
|
|
74
|
+
* @private
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
66
77
|
private replaceVideoTrack;
|
|
67
78
|
setAudioOrVideoStatus(type: string): Promise<undefined>;
|
|
68
79
|
private setStreamStatus;
|
|
@@ -72,19 +83,65 @@ export default class Stream extends Emmitter {
|
|
|
72
83
|
private getNextVideoContraints;
|
|
73
84
|
private getNextVideoMedia;
|
|
74
85
|
private createNextVideoTracks;
|
|
86
|
+
/**
|
|
87
|
+
* 删除video track
|
|
88
|
+
*
|
|
89
|
+
* @private
|
|
90
|
+
* @param { boolean } forceRemove 是否强制删除track, 默认不强制,只有track数量大于1才进行删除
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
75
93
|
private removePreviousVideoTracks;
|
|
94
|
+
/**
|
|
95
|
+
* 获取stop的track
|
|
96
|
+
*
|
|
97
|
+
* @param tracks
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
private getEndedTrack;
|
|
76
101
|
setStreamTracksStatus(stream: MediaStream, type: string): void;
|
|
77
102
|
close(): void;
|
|
78
103
|
private closeStreams;
|
|
79
104
|
getMediaStreams(): IGetMediaStreams;
|
|
105
|
+
/**
|
|
106
|
+
* 初始化流
|
|
107
|
+
*
|
|
108
|
+
* @param config
|
|
109
|
+
* @param params
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
80
112
|
init(config?: IStreamInitConfog, params?: {
|
|
81
113
|
muteVideo?: boolean;
|
|
82
114
|
muteAudio?: boolean;
|
|
83
|
-
}): Promise<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
115
|
+
}): Promise<IStatus>;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param { boolean } video 是否开启摄像头
|
|
119
|
+
* @param { boolean } audio 是否开启麦克风
|
|
120
|
+
* @param { string } videoId 摄像头设备ID
|
|
121
|
+
* @param { string } audioId 麦克风设备ID
|
|
122
|
+
* @param { boolean } isReduceResolution 是否降低分辨率采集, 默认采集720P,降低分辨率则采集360P
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
private getStream;
|
|
126
|
+
/**
|
|
127
|
+
* 无流入会
|
|
128
|
+
*
|
|
129
|
+
* @private
|
|
130
|
+
* @param status
|
|
131
|
+
* @returns
|
|
132
|
+
*/
|
|
133
|
+
private dealWithoutStreams;
|
|
134
|
+
/**
|
|
135
|
+
* 获取约束设置
|
|
136
|
+
*
|
|
137
|
+
* @private
|
|
138
|
+
* @param { boolean } video 是否采集视频流
|
|
139
|
+
* @param { boolean } audio 是否采集音频流
|
|
140
|
+
* @param { string } videoDeviceId 摄像头设备ID
|
|
141
|
+
* @param { string } audioDeviceId 麦克风设备ID
|
|
142
|
+
* @param { boolean } isReduceResolution 是否降低分辨率采集, 默认采集720P,降低分辨率则采集360P
|
|
143
|
+
* @returns
|
|
144
|
+
*/
|
|
88
145
|
private getInitContraints;
|
|
89
146
|
private initStreams;
|
|
90
147
|
/**
|
|
@@ -115,7 +172,7 @@ export default class Stream extends Emmitter {
|
|
|
115
172
|
*/
|
|
116
173
|
createContentStream(): Promise<IStreamObj[]>;
|
|
117
174
|
electronCapture(selectedSourceId: string): Promise<unknown>;
|
|
118
|
-
getElectronContentSources(desktopCapturer: any, types?: any): Promise<ISource[]>;
|
|
175
|
+
getElectronContentSources(desktopCapturer: any, types?: any): Promise<ISource[] | any>;
|
|
119
176
|
/**
|
|
120
177
|
* Create share electron content stream
|
|
121
178
|
*
|
|
@@ -10,6 +10,8 @@ export declare const platform: () => {
|
|
|
10
10
|
isAndroid: boolean;
|
|
11
11
|
isPc: boolean;
|
|
12
12
|
isMac: boolean;
|
|
13
|
+
isWindows: boolean;
|
|
14
|
+
isPad: boolean;
|
|
13
15
|
isChrome: boolean;
|
|
14
16
|
isLinux: boolean;
|
|
15
17
|
isFirefox: boolean;
|
|
@@ -19,6 +21,7 @@ export declare const platform: () => {
|
|
|
19
21
|
isZhazha: boolean;
|
|
20
22
|
isEdge: boolean;
|
|
21
23
|
isSafari: boolean;
|
|
24
|
+
isHuaweiBrowser: boolean;
|
|
22
25
|
};
|
|
23
26
|
export declare const getChromeVersion: () => {
|
|
24
27
|
major: any;
|
|
@@ -35,4 +38,16 @@ export declare const getSafariVersion: () => {
|
|
|
35
38
|
major: any;
|
|
36
39
|
minor: any;
|
|
37
40
|
} | undefined;
|
|
41
|
+
export declare const getFirefoxVersion: () => {
|
|
42
|
+
major: any;
|
|
43
|
+
minor: any;
|
|
44
|
+
} | undefined;
|
|
45
|
+
export declare const getAndroidVersion: () => {
|
|
46
|
+
major: any;
|
|
47
|
+
minor: any;
|
|
48
|
+
} | undefined;
|
|
49
|
+
export declare const getIOSVersion: () => {
|
|
50
|
+
major: any;
|
|
51
|
+
minor: any;
|
|
52
|
+
} | undefined;
|
|
38
53
|
export declare const getVerison: () => number;
|
|
@@ -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.0.3-beta.11 - build on 2022-01-13 14:59";
|
|
8
8
|
export declare const proxy: {
|
|
9
9
|
wssHost: string;
|
|
10
10
|
restHost: string;
|
|
@@ -5,8 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const detect: {
|
|
7
7
|
isMinBrowser: () => boolean;
|
|
8
|
+
isMobile: () => boolean;
|
|
9
|
+
isFirefox: () => boolean;
|
|
10
|
+
isSupportReauthorize: () => boolean;
|
|
11
|
+
isSupportAppendTrack: () => boolean;
|
|
8
12
|
isSupportRTC: () => boolean;
|
|
9
13
|
isSupportPeerCB: () => boolean;
|
|
10
14
|
isSupportWebsocket: () => boolean;
|
|
11
15
|
isSupportMedia: () => boolean;
|
|
16
|
+
isSupportH264: () => Promise<boolean>;
|
|
17
|
+
osVersion: () => string;
|
|
12
18
|
};
|