@xylink/xy-rtc-sdk 3.10.0-beta.4 → 100.0.0-beta.44
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 +30 -12
- package/build.config.json +10 -0
- package/lib/action/index.d.ts +57 -45
- package/lib/enum/analyser.d.ts +7 -0
- package/lib/enum/client.d.ts +8 -2
- package/lib/enum/constraints.d.ts +11 -16
- package/lib/enum/device.d.ts +0 -6
- package/lib/enum/errorCode.d.ts +5 -2
- package/lib/enum/index.d.ts +43 -5
- package/lib/enum/polling.d.ts +2 -0
- package/lib/feature/customMessage/index.d.ts +29 -0
- package/lib/feature/edu/index.d.ts +34 -0
- package/lib/feature/edu/index.type.d.ts +29 -0
- package/lib/feature/index.d.ts +3 -1
- package/lib/feature/{speaker.d.ts → speaker/index.d.ts} +29 -9
- package/lib/feature/speaker/index.type.d.ts +17 -0
- package/lib/index.d.ts +65 -28
- package/lib/interface/baseModule.type.d.ts +9 -0
- package/lib/interface/clientInterface.type.d.ts +83 -0
- package/lib/interface/contentTrackInterface.type.d.ts +15 -0
- package/lib/interface/event.type.d.ts +316 -0
- package/lib/interface/peopleTrackInterface.type.d.ts +17 -0
- package/lib/main/ability/const.d.ts +4 -1
- package/lib/main/ability/index.d.ts +7 -1
- package/lib/main/{auth.d.ts → auth/index.d.ts} +29 -19
- package/lib/main/client.d.ts +365 -595
- package/lib/main/clientBase.d.ts +38 -0
- package/lib/main/clientState.d.ts +56 -0
- package/lib/main/{deviceManager.d.ts → device/index.d.ts} +45 -13
- package/lib/{type/device.d.ts → main/device/index.type.d.ts} +65 -16
- package/lib/main/helper/index.d.ts +120 -0
- package/lib/main/layout/index.d.ts +118 -105
- package/lib/main/layout/index.type.d.ts +270 -0
- package/lib/main/layout/polling.d.ts +212 -0
- package/lib/main/layout/state.d.ts +163 -0
- package/lib/main/layout/template.d.ts +15 -7
- package/lib/main/media/index.d.ts +177 -0
- package/lib/main/media/index.type.d.ts +9 -0
- package/lib/main/meeting/control.d.ts +107 -0
- package/lib/main/meeting/control.type.d.ts +24 -0
- package/lib/main/{meeting.d.ts → meeting/index.d.ts} +46 -7
- package/lib/main/meeting/verify.d.ts +69 -0
- package/lib/main/peer.d.ts +120 -41
- package/lib/main/plugin/index.d.ts +28 -0
- package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
- package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
- package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
- package/lib/main/render/index.d.ts +116 -0
- package/lib/main/render/index.type.d.ts +24 -0
- package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
- package/lib/main/render/videoManager.type.d.ts +66 -0
- package/lib/main/roster/index.d.ts +39 -0
- package/lib/main/server/index.d.ts +79 -0
- package/lib/main/server/index.type.d.ts +21 -0
- package/lib/main/signal/index.d.ts +15 -0
- package/lib/main/socket/index.d.ts +95 -0
- package/lib/main/stream/index.d.ts +182 -0
- package/lib/main/track/baseTrack.d.ts +178 -0
- package/lib/main/track/contentTrack.d.ts +161 -0
- package/lib/main/track/customContentTrack.d.ts +18 -0
- package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
- package/lib/main/track/helper.d.ts +53 -0
- package/lib/main/track/videoAudioCapture.d.ts +90 -0
- package/lib/main/track/videoAudioTrack.d.ts +243 -0
- package/lib/main/vom/index.d.ts +44 -0
- package/lib/main/vom/index.type.d.ts +1 -0
- package/lib/tools/analyser.d.ts +30 -7
- package/lib/tools/analyserManager.d.ts +55 -0
- package/lib/tools/dbManager.d.ts +12 -1
- package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
- package/lib/tools/detectStream/index.d.ts +84 -0
- package/lib/tools/detectStream/index.type.d.ts +56 -0
- package/lib/tools/detectTool/index.d.ts +191 -0
- package/lib/tools/detectTool/index.type.d.ts +62 -0
- package/lib/tools/emitter.d.ts +27 -6
- package/lib/tools/enum.d.ts +1 -1
- package/lib/tools/httpClient.d.ts +5 -1
- package/lib/tools/i18n.d.ts +1 -1
- package/lib/tools/index.d.ts +1 -8
- package/lib/tools/log/logger.d.ts +41 -21
- package/lib/tools/log/logger.worker.d.ts +1 -1
- package/lib/tools/log/loggerManager.d.ts +2 -2
- package/lib/tools/pressure/index.d.ts +33 -0
- package/lib/tools/pressure/index.type.d.ts +22 -0
- package/lib/tools/promiseQueue.d.ts +6 -0
- package/lib/tools/regex.d.ts +4 -0
- package/lib/tools/snapshot.d.ts +1 -1
- package/lib/tools/socket.d.ts +12 -2
- package/lib/tools/template/index.d.ts +11 -88
- package/lib/tools/template/mobile.d.ts +1 -1
- package/lib/tools/template/polling.d.ts +8 -0
- package/lib/tools/utils.d.ts +25 -16
- package/lib/tools/verify.d.ts +7 -0
- package/lib/type/ability.d.ts +1 -1
- package/lib/type/analyser.d.ts +26 -1
- package/lib/type/auth.d.ts +19 -19
- package/lib/type/base.d.ts +27 -31
- package/lib/type/capture.d.ts +9 -0
- package/lib/type/client.d.ts +178 -333
- package/lib/type/index.d.ts +22 -2
- package/lib/type/layout.d.ts +81 -45
- package/lib/type/logger.d.ts +19 -12
- package/lib/type/meeting.d.ts +101 -56
- package/lib/type/peer.d.ts +65 -1
- package/lib/type/polling.d.ts +194 -0
- package/lib/type/quality.d.ts +12 -2
- package/lib/type/socket.d.ts +0 -18
- package/lib/type/stream.d.ts +42 -24
- package/lib/type/track.d.ts +131 -0
- package/lib/xyrtc.cjs.js +1 -1
- package/lib/xyrtc.umd.js +1 -1
- package/package.json +32 -52
- package/lib/main/clientImplements.d.ts +0 -99
- package/lib/main/helper.d.ts +0 -104
- package/lib/main/stream.d.ts +0 -418
- package/lib/tools/detect.d.ts +0 -44
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import XYRTCClient from '../client';
|
|
2
|
+
import { OriginalNotification, OriginalRealTimeNotification, IReturnResult, ISubTitle, IEPMessage, IWaitingState, IMeetingControl, IRecordStatusNotification, IRecordingStateChanged, XYBaseModule } from '../../type/index';
|
|
3
|
+
export declare class XYMeetingControl implements XYBaseModule {
|
|
4
|
+
private client;
|
|
5
|
+
private logger;
|
|
6
|
+
private action;
|
|
7
|
+
private onhold;
|
|
8
|
+
private handStatus;
|
|
9
|
+
private cacheMeetingControlMessage;
|
|
10
|
+
private recordStatusNotification;
|
|
11
|
+
private recordState;
|
|
12
|
+
constructor(client: XYRTCClient);
|
|
13
|
+
destroy(): void;
|
|
14
|
+
getOnHold(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 设置本地是否在等候室
|
|
17
|
+
*
|
|
18
|
+
* @param { boolean } onhold - 是否在等候室
|
|
19
|
+
*/
|
|
20
|
+
setOnHold(onhold: boolean): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 本地举手、结束发言等操作
|
|
23
|
+
*
|
|
24
|
+
* @param { 'handup' | 'handdown' | 'mute' } type 操作类型
|
|
25
|
+
* @param { boolean } handStatus 是否举手
|
|
26
|
+
* @returns { Promise<boolean> } 举手状态
|
|
27
|
+
*/
|
|
28
|
+
onHand(type: 'handup' | 'handdown' | 'mute', handStatus: boolean): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* 处理联席主持人/主持人/改名权限 等消息
|
|
31
|
+
*
|
|
32
|
+
* @param { OriginalNotification } data - 消息内容
|
|
33
|
+
*/
|
|
34
|
+
handleNotificationMessage(data: OriginalNotification): void;
|
|
35
|
+
/**
|
|
36
|
+
* 会控互动工具相关数据, 签到等
|
|
37
|
+
*
|
|
38
|
+
* @param { OriginalRealTimeNotification } data - 信令下发的原始数据
|
|
39
|
+
*/
|
|
40
|
+
handleRealTimeNotificationMessage(data: OriginalRealTimeNotification): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* 获取签到文案
|
|
43
|
+
*
|
|
44
|
+
* @property { SignInTextParams } - 参数
|
|
45
|
+
* @returns { Promise<SignInText | null> } - 签到文案
|
|
46
|
+
*/
|
|
47
|
+
private getSignInText;
|
|
48
|
+
/**
|
|
49
|
+
* 签到
|
|
50
|
+
*
|
|
51
|
+
* @property { string } questionnaireId - 业务ID
|
|
52
|
+
* @returns { Promise<IReturnResult> } - 签到结果
|
|
53
|
+
*/
|
|
54
|
+
signIn(questionnaireId: string): Promise<IReturnResult>;
|
|
55
|
+
/**
|
|
56
|
+
* 上报Web轮询能力
|
|
57
|
+
*/
|
|
58
|
+
reportPollingCapability(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* 处理字幕、点名消息
|
|
61
|
+
*
|
|
62
|
+
* @param { ISubTitle } data - 字幕、点名消息
|
|
63
|
+
*/
|
|
64
|
+
onSubTitle(data: ISubTitle): void;
|
|
65
|
+
/**
|
|
66
|
+
* 处理会控上报开启/关闭摄像头事件
|
|
67
|
+
*
|
|
68
|
+
* @param { Object } data - 远端数据
|
|
69
|
+
*/
|
|
70
|
+
handleEPMessage(data: IEPMessage): void;
|
|
71
|
+
/**
|
|
72
|
+
* 处理等候室状态
|
|
73
|
+
*
|
|
74
|
+
* @param { IWaitingState } data
|
|
75
|
+
*/
|
|
76
|
+
handleWaitingState(data: IWaitingState): void;
|
|
77
|
+
/**
|
|
78
|
+
* 会议重连后,重新处理缓存的会控消息
|
|
79
|
+
*/
|
|
80
|
+
resendMeetingControlMessage(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* 处理会控消息,如音频、主会场、content等
|
|
83
|
+
*
|
|
84
|
+
* @param { IMeetingControl } data 会控消息
|
|
85
|
+
*/
|
|
86
|
+
onMeetingControlMessage(data: IMeetingControl): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* 处理本地录制结果上报Message
|
|
89
|
+
*
|
|
90
|
+
* @param { IRecordingStateChanged } data - 录制状态
|
|
91
|
+
*/
|
|
92
|
+
onRecordingStateChangedMessage(data: IRecordingStateChanged): void;
|
|
93
|
+
/**
|
|
94
|
+
* 处理远端录制状态上报
|
|
95
|
+
*
|
|
96
|
+
* @param { IRecordStatusNotification } data - 录制状态
|
|
97
|
+
*/
|
|
98
|
+
onRecordStatusNotificationMessage(data: IRecordStatusNotification): void;
|
|
99
|
+
/**
|
|
100
|
+
* 上报远端录制状态
|
|
101
|
+
*/
|
|
102
|
+
emitRecordStatusNotification(): void;
|
|
103
|
+
/**
|
|
104
|
+
* 停止云端录制
|
|
105
|
+
*/
|
|
106
|
+
stopCloudRecord(): IReturnResult | Promise<never>;
|
|
107
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EVENT_TYPE } from '../../type/index';
|
|
2
|
+
/**
|
|
3
|
+
* 信令上报原始的消息
|
|
4
|
+
*
|
|
5
|
+
* @property { number } subType - 消息类型
|
|
6
|
+
* @property { string } content - 消息详细内容
|
|
7
|
+
* @property { string } requestId - 消息ID
|
|
8
|
+
*/
|
|
9
|
+
export interface OriginalNotification {
|
|
10
|
+
subType: number;
|
|
11
|
+
content: string;
|
|
12
|
+
requestId: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 会控互动工具相关数据, 签到等
|
|
16
|
+
*/
|
|
17
|
+
export interface OriginalRealTimeNotification {
|
|
18
|
+
count: number;
|
|
19
|
+
events: {
|
|
20
|
+
content: string;
|
|
21
|
+
type: EVENT_TYPE;
|
|
22
|
+
action: EVENT_TYPE;
|
|
23
|
+
}[];
|
|
24
|
+
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Meeting Info Control
|
|
3
3
|
*
|
|
4
4
|
* Created at : 2022-10-27 13:58:22
|
|
5
|
-
* Last modified :
|
|
5
|
+
* Last modified : 2024-06-07 18:34:37
|
|
6
6
|
*/
|
|
7
|
-
import { IRecordPermission, IExportUserInfo, IConfMgmtUrl, ILayout, IMediaConfig, IReqInfo, LayoutAvatarType, TLayoutMap, InviteInfo, MEETING_DIRECTION } from '
|
|
8
|
-
import Client from '
|
|
7
|
+
import { IConferenceInfo, IRecordPermission, IExportUserInfo, IConfMgmtUrl, ILayout, IMediaConfig, IReqInfo, LayoutAvatarType, TLayoutMap, InviteInfo, MEETING_DIRECTION, IVideoProfile, IMeetingControl, FocusViewAction } from '../../type/index';
|
|
8
|
+
import Client from '../client';
|
|
9
9
|
declare class Meeting {
|
|
10
10
|
private client;
|
|
11
11
|
private logger;
|
|
@@ -18,6 +18,7 @@ declare class Meeting {
|
|
|
18
18
|
private mediaConfig;
|
|
19
19
|
private enterpriseConfig;
|
|
20
20
|
private userInfo;
|
|
21
|
+
private meetingControlInfo;
|
|
21
22
|
constructor(client: Client);
|
|
22
23
|
getRecordPermission(): IRecordPermission;
|
|
23
24
|
getLayoutImageAvatarMap(): Map<string, {
|
|
@@ -26,7 +27,15 @@ declare class Meeting {
|
|
|
26
27
|
}>;
|
|
27
28
|
getEnterpriseMediaConfig(): IMediaConfig;
|
|
28
29
|
getUserInfo(): IExportUserInfo | null;
|
|
30
|
+
getConferenceInfo(): IConferenceInfo;
|
|
29
31
|
getLayoutAvatarType(): LayoutAvatarType;
|
|
32
|
+
getMeetingControlInfo(): IMeetingControl | null;
|
|
33
|
+
/**
|
|
34
|
+
* 设置会控消息
|
|
35
|
+
*
|
|
36
|
+
* @param { IMeetingControl } info
|
|
37
|
+
*/
|
|
38
|
+
setMeetingControlInfo(info: IMeetingControl): void;
|
|
30
39
|
/**
|
|
31
40
|
* 登录用户信息和个人云会议室信息
|
|
32
41
|
*/
|
|
@@ -100,10 +109,10 @@ declare class Meeting {
|
|
|
100
109
|
*/
|
|
101
110
|
private getVCConfInfo;
|
|
102
111
|
/**
|
|
103
|
-
*
|
|
112
|
+
* 获取水印内容及范围
|
|
104
113
|
*
|
|
105
114
|
* @private
|
|
106
|
-
* @param { string } confAuxProperties
|
|
115
|
+
* @param { string } confAuxProperties - 水印配置信息
|
|
107
116
|
*/
|
|
108
117
|
private getWatermarkContent;
|
|
109
118
|
/**
|
|
@@ -114,6 +123,19 @@ declare class Meeting {
|
|
|
114
123
|
* 2023-8-3 鉴于安全考虑,此接口需提供MeetingId字段;
|
|
115
124
|
*/
|
|
116
125
|
getMeetingInviteInfo(): Promise<InviteInfo>;
|
|
126
|
+
/**
|
|
127
|
+
* 通过会控设置焦点画面
|
|
128
|
+
*
|
|
129
|
+
* @param { string } id - 指定切换到焦点画面的endpointId
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
setMeetingFocusView(id: string, action: FocusViewAction): Promise<import("../../type/index").IReturnResult>;
|
|
133
|
+
/**
|
|
134
|
+
* 修改参会者名称,目前仅支持修改Local
|
|
135
|
+
*
|
|
136
|
+
* @param { string } newName - 新名称
|
|
137
|
+
*/
|
|
138
|
+
rename(newName: string, callback?: () => void): Promise<import("../../type/index").IReturnResult | undefined>;
|
|
117
139
|
/**
|
|
118
140
|
* 企业配置信息
|
|
119
141
|
*
|
|
@@ -127,6 +149,13 @@ declare class Meeting {
|
|
|
127
149
|
* @param { MEETING_DIRECTION } direction - 配置上下行方向配置
|
|
128
150
|
*/
|
|
129
151
|
processMediaConfig(direction: MEETING_DIRECTION): void;
|
|
152
|
+
/**
|
|
153
|
+
* 配置上行分辨率配置
|
|
154
|
+
*
|
|
155
|
+
* @param { MEETING_DIRECTION } direction - 配置上下行方向配置
|
|
156
|
+
* @param { IVideoProfile } profile - 配置最大分辨率/帧率
|
|
157
|
+
*/
|
|
158
|
+
processVideoProfileConfig(direction: MEETING_DIRECTION, profile: IVideoProfile): void;
|
|
130
159
|
/**
|
|
131
160
|
* 企业配置信息
|
|
132
161
|
*
|
|
@@ -134,6 +163,10 @@ declare class Meeting {
|
|
|
134
163
|
* 2. 禁用语音转写英文翻译
|
|
135
164
|
*/
|
|
136
165
|
setEnterpriseBuffetConfig(): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* 结束全体会议
|
|
168
|
+
*/
|
|
169
|
+
endAllMeeting(): Promise<import("../../type/index").IReturnResult>;
|
|
137
170
|
/**
|
|
138
171
|
* 处理信令下发的等候室
|
|
139
172
|
*
|
|
@@ -151,9 +184,15 @@ declare class Meeting {
|
|
|
151
184
|
/**
|
|
152
185
|
* 根据企业配置媒体能力,得到最终的请流参数
|
|
153
186
|
*
|
|
154
|
-
* @param {IReqInfo[]} reqInfoList 请流列表数据
|
|
155
|
-
* @returns {IReqInfo[]}
|
|
187
|
+
* @param { IReqInfo[] } reqInfoList 请流列表数据
|
|
188
|
+
* @returns { IReqInfo[] } - 最终的请流列表
|
|
156
189
|
*/
|
|
157
190
|
convertReqList(reqInfoList: IReqInfo[]): IReqInfo[];
|
|
191
|
+
/**
|
|
192
|
+
* 处理云会议室属性消息
|
|
193
|
+
*
|
|
194
|
+
* @param { object } data - 云会议室属性消息
|
|
195
|
+
*/
|
|
196
|
+
handleConferencePropertiesMessage(data: any): void;
|
|
158
197
|
}
|
|
159
198
|
export default Meeting;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 校验模块,包含校验会议、会议密码等
|
|
3
|
+
*
|
|
4
|
+
* Created at : 2024-05-13 14:43:44
|
|
5
|
+
* Last modified : 2024-06-07 18:34:59
|
|
6
|
+
*/
|
|
7
|
+
import { ICall, IReturnResult, XYBaseModule } from '../../type/index';
|
|
8
|
+
import XYRTCClient from '../client';
|
|
9
|
+
export declare class Verify implements XYBaseModule {
|
|
10
|
+
private client;
|
|
11
|
+
private logger;
|
|
12
|
+
private action;
|
|
13
|
+
private meetingVerified;
|
|
14
|
+
constructor(client: XYRTCClient);
|
|
15
|
+
destroy(): void;
|
|
16
|
+
/**
|
|
17
|
+
* 校验会议室号
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
* @param { ICall } params
|
|
21
|
+
* @property { string } confNumber - 会议号
|
|
22
|
+
* @property { string } password - 会议密码
|
|
23
|
+
* @returns { Promise<IReturnResult> } - 结果
|
|
24
|
+
*/
|
|
25
|
+
checkMeetingNumber(params: ICall): Promise<IReturnResult>;
|
|
26
|
+
/**
|
|
27
|
+
* 校验会议室密码
|
|
28
|
+
*
|
|
29
|
+
* @param { string } confNumber - 会议号
|
|
30
|
+
* @param { string } password - 会议密码
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
checkMeetingPassword(confNumber: string, password: string): Promise<IReturnResult>;
|
|
34
|
+
/**
|
|
35
|
+
* 检查会议室类型是否支持
|
|
36
|
+
*
|
|
37
|
+
* @param { string } deviceType - 会议室类型
|
|
38
|
+
* @returns { boolean } - 是否支持呼叫
|
|
39
|
+
*/
|
|
40
|
+
private isSupportedCall;
|
|
41
|
+
/**
|
|
42
|
+
* 处理密码验证逻辑
|
|
43
|
+
*
|
|
44
|
+
* @param { string } confNumber - 会议号
|
|
45
|
+
* @param { string } password - 密码
|
|
46
|
+
* @param { string | number } hideId - 是否是隐身入会模式
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
private handlePasswordValidation;
|
|
50
|
+
/**
|
|
51
|
+
* 完成会议室校验,上报会议室信息
|
|
52
|
+
*
|
|
53
|
+
* @returns { Promise<IReturnResult> } - 校验结果
|
|
54
|
+
*/
|
|
55
|
+
private completeMeetingVerify;
|
|
56
|
+
/**
|
|
57
|
+
* 校验会议室前置任务
|
|
58
|
+
*
|
|
59
|
+
* @returns { Promise<IReturnResult> } - 校验结果
|
|
60
|
+
*/
|
|
61
|
+
private preVerifyTasks;
|
|
62
|
+
/**
|
|
63
|
+
* 校验会控主持密码
|
|
64
|
+
*
|
|
65
|
+
* @param { string } pwd - 会控密码
|
|
66
|
+
* @returns { Promise<IReturnResult> } - 校验结果
|
|
67
|
+
*/
|
|
68
|
+
verifyControlPassword(pwd: string): Promise<IReturnResult>;
|
|
69
|
+
}
|
package/lib/main/peer.d.ts
CHANGED
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-25 18:53:01
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { IStreamSender, ICandidate, PushType, ISenderMap, PeerState, ICEState } from '../type/index';
|
|
8
8
|
import Client from './client';
|
|
9
9
|
import Logger from '../tools/log/logger';
|
|
10
|
-
import
|
|
10
|
+
import VideoAudioTrack from './track/videoAudioTrack';
|
|
11
|
+
import ContentTrack from './track/contentTrack';
|
|
11
12
|
/**
|
|
12
|
-
* Peer模块,用于管理
|
|
13
|
-
*
|
|
14
|
-
* @class Peer
|
|
13
|
+
* Peer模块,用于管理 P2S 连接和内部事件
|
|
15
14
|
*/
|
|
16
15
|
export default class Peer {
|
|
17
16
|
private connectTimer;
|
|
@@ -19,60 +18,92 @@ export default class Peer {
|
|
|
19
18
|
client: Client;
|
|
20
19
|
peerConnection: RTCPeerConnection | null;
|
|
21
20
|
logger: Logger;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
iceConnectionState: string;
|
|
21
|
+
connectState: {
|
|
22
|
+
peer: PeerState;
|
|
23
|
+
ice: ICEState;
|
|
26
24
|
};
|
|
27
|
-
stream: Stream;
|
|
28
25
|
streamSenders: IStreamSender[];
|
|
29
26
|
senderMap: ISenderMap;
|
|
30
27
|
private senderTimer;
|
|
31
|
-
private isRestartIceConnection;
|
|
32
|
-
private isFirstConnected;
|
|
33
28
|
private videoCodecs;
|
|
34
29
|
private audioCodecs;
|
|
35
30
|
private qualityWorker;
|
|
36
31
|
private localIPAddress;
|
|
37
|
-
|
|
32
|
+
private peerLibStatus;
|
|
33
|
+
private firstCallState;
|
|
34
|
+
private peerCallState;
|
|
35
|
+
private isReceivedTrackMsg;
|
|
36
|
+
private isCreatedOffer;
|
|
37
|
+
private isReceivedAnswer;
|
|
38
|
+
private contentTrackSize;
|
|
39
|
+
private detectTrackMsgTimer;
|
|
40
|
+
private candidateList;
|
|
41
|
+
constructor(client: Client, isRenew?: boolean);
|
|
42
|
+
/**
|
|
43
|
+
* 初始化质量统计WebWorker模块
|
|
44
|
+
*/
|
|
38
45
|
private initQualityWorker;
|
|
39
|
-
restart(): void;
|
|
40
46
|
/**
|
|
41
47
|
* 初始化Peer模块
|
|
42
48
|
* 1. 创建PeerConnection
|
|
43
49
|
* 2. 初始化监听事件
|
|
44
|
-
*
|
|
45
|
-
* @private
|
|
46
50
|
*/
|
|
47
51
|
private init;
|
|
48
52
|
/**
|
|
49
|
-
* 向
|
|
53
|
+
* 向Client发送消息
|
|
50
54
|
*
|
|
51
55
|
* @private
|
|
52
|
-
* @param {
|
|
53
|
-
* @param { string } code 状态码
|
|
54
|
-
* @param { string } msg 消息内容
|
|
55
|
-
* @param { any } detail 消息数据
|
|
56
|
+
* @param { XYClientEventKey } type - 消息Key
|
|
57
|
+
* @param { string } code - 状态码
|
|
58
|
+
* @param { string } msg - 消息内容
|
|
59
|
+
* @param { any } detail - 消息数据
|
|
56
60
|
*/
|
|
57
61
|
private sendEmmit;
|
|
58
62
|
/**
|
|
59
|
-
*
|
|
63
|
+
* 获取Peer是否连接成功
|
|
60
64
|
*
|
|
61
|
-
* @
|
|
65
|
+
* @returns { boolean } - 是否连接成功
|
|
66
|
+
*/
|
|
67
|
+
getPeerConnectionStatus(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 停止状态检查定时器,重置重连状态
|
|
62
70
|
*/
|
|
63
71
|
private stopConnectTimer;
|
|
64
72
|
/**
|
|
65
|
-
*
|
|
73
|
+
* 启动检测监听到Track回调消息检测器
|
|
66
74
|
*
|
|
67
|
-
*
|
|
75
|
+
* 检测场景:当Peer连接成功,但是未收到Track消息,导致收音频/视频异常问题
|
|
76
|
+
* 检测次数:1次,如仍然失败,则直接退会
|
|
77
|
+
*/
|
|
78
|
+
private startDetectTrackMsgTimer;
|
|
79
|
+
/**
|
|
80
|
+
* 清理Track回调检测器定时器
|
|
81
|
+
*/
|
|
82
|
+
private stopDetectTrackMsgTimer;
|
|
83
|
+
/**
|
|
84
|
+
* 监听peer连接状态,Timeout:40s
|
|
68
85
|
*/
|
|
69
86
|
private initTimer;
|
|
87
|
+
/**
|
|
88
|
+
* 处理各种与媒体协商失败报错异常
|
|
89
|
+
* 处理方式:上报结果并退会
|
|
90
|
+
*
|
|
91
|
+
* @param { string } code - 错误码
|
|
92
|
+
*/
|
|
93
|
+
private handlePeerConnectError;
|
|
70
94
|
/**
|
|
71
95
|
* ice协商回调事件
|
|
72
96
|
*
|
|
73
97
|
* @private
|
|
74
98
|
*/
|
|
75
99
|
private onHandleNegotiationNeeded;
|
|
100
|
+
/**
|
|
101
|
+
* 修改SDP内容
|
|
102
|
+
*
|
|
103
|
+
* @param { string } sdp - offer sdp报文信息
|
|
104
|
+
* @returns { string } - 修改后的报文
|
|
105
|
+
*/
|
|
106
|
+
private appendExtmap;
|
|
76
107
|
/**
|
|
77
108
|
* 创建offer,并针对stream设置初始带宽
|
|
78
109
|
*
|
|
@@ -93,11 +124,17 @@ export default class Peer {
|
|
|
93
124
|
* 处理candidate消息
|
|
94
125
|
*
|
|
95
126
|
* @public
|
|
96
|
-
* @param { ICandidate } body candidate消息内容
|
|
127
|
+
* @param { ICandidate } body - candidate消息内容
|
|
97
128
|
*/
|
|
98
129
|
handleCandidate(body: ICandidate): Promise<void>;
|
|
99
130
|
/**
|
|
100
|
-
*
|
|
131
|
+
* 缓存协商的Candidate节点信息
|
|
132
|
+
*
|
|
133
|
+
* @param { string } candidate - ICE Candidate协商节点信息
|
|
134
|
+
*/
|
|
135
|
+
private cacheCandidateData;
|
|
136
|
+
/**
|
|
137
|
+
* 响应Answer
|
|
101
138
|
*
|
|
102
139
|
* @public
|
|
103
140
|
* @param { RTCSessionDescriptionInit } answer answerSDP内容,设置到peerConnection上
|
|
@@ -116,33 +153,51 @@ export default class Peer {
|
|
|
116
153
|
frameRate?: number | undefined;
|
|
117
154
|
} | undefined, isIncreaseBase: boolean | undefined, stream: MediaStream | null): Promise<void>;
|
|
118
155
|
/**
|
|
119
|
-
*
|
|
120
|
-
* Maybe status:'new', 'checking', 'connected', 'completed', 'failed', 'disconnected', 'closed'
|
|
156
|
+
* ICE Connection status change
|
|
121
157
|
*
|
|
122
|
-
* @
|
|
123
|
-
* @param { Event } e ice连接回调状态事件
|
|
158
|
+
* @param { Event } e - ICE状态回调事件
|
|
124
159
|
*/
|
|
125
160
|
private onHandleIceConnectionStateChange;
|
|
126
161
|
/**
|
|
127
|
-
*
|
|
128
|
-
* pc.connectionState: connected,disconnected,failed,closed,connecting,new
|
|
162
|
+
* PeerConnection connect state change
|
|
129
163
|
*
|
|
130
|
-
*
|
|
164
|
+
* Only supports Chrome 72 or higher, Firefox 113 or higher
|
|
165
|
+
*
|
|
166
|
+
* @param { Event } e - ICE状态回调事件
|
|
131
167
|
*/
|
|
132
168
|
private onHandleConnectionStateChange;
|
|
169
|
+
/**
|
|
170
|
+
* 统一处理WebRTC PeerConnection连接状态事件
|
|
171
|
+
*/
|
|
172
|
+
private peerStateChange;
|
|
173
|
+
/**
|
|
174
|
+
* WebRTC ICE探测错误事件监听
|
|
175
|
+
*
|
|
176
|
+
* @param { Event } e - 错误信息
|
|
177
|
+
*/
|
|
133
178
|
onHandleIcecandidateerror(e: Event): void;
|
|
179
|
+
/**
|
|
180
|
+
* WebRTC ICE协商事件
|
|
181
|
+
*
|
|
182
|
+
* @param { any } ice - ICE报文
|
|
183
|
+
*/
|
|
134
184
|
private onHandleIcecandidate;
|
|
185
|
+
/**
|
|
186
|
+
* Peer已经连接成功
|
|
187
|
+
*
|
|
188
|
+
* @returns { boolean } - True或者False
|
|
189
|
+
*/
|
|
190
|
+
get isPeerConnected(): boolean;
|
|
135
191
|
/**
|
|
136
192
|
* 重连PeerConnection
|
|
137
193
|
*
|
|
138
|
-
* @
|
|
194
|
+
* @param { 'socket' | 'peer' } entry - 重连入口
|
|
139
195
|
*/
|
|
140
|
-
restartIceConnection(
|
|
196
|
+
restartIceConnection(entry: 'socket' | 'peer'): Promise<void>;
|
|
141
197
|
/**
|
|
142
198
|
* 关闭PeerConnection连接、销毁状态
|
|
143
199
|
*/
|
|
144
|
-
|
|
145
|
-
setRestartIceConnection(isRestartIceConnection?: boolean): void;
|
|
200
|
+
destroy(): void;
|
|
146
201
|
/**
|
|
147
202
|
* Push people and content tracks of stream
|
|
148
203
|
*
|
|
@@ -150,7 +205,7 @@ export default class Peer {
|
|
|
150
205
|
* @param { Stream } stream - Stream Library
|
|
151
206
|
* @param { PushType } pushType - 推送类型,All全推送、Video只推送video、Audio只推送audio、Content只推送content video流
|
|
152
207
|
*/
|
|
153
|
-
publish(
|
|
208
|
+
publish(track: VideoAudioTrack | ContentTrack, pushType: PushType): void;
|
|
154
209
|
/**
|
|
155
210
|
* people and content sender status
|
|
156
211
|
*
|
|
@@ -173,8 +228,6 @@ export default class Peer {
|
|
|
173
228
|
closeContentStream(): void;
|
|
174
229
|
/**
|
|
175
230
|
* Get peerConnection status
|
|
176
|
-
*
|
|
177
|
-
* @public
|
|
178
231
|
*/
|
|
179
232
|
getPeerStatus(): boolean;
|
|
180
233
|
/**
|
|
@@ -204,6 +257,16 @@ export default class Peer {
|
|
|
204
257
|
* @param { RTCRtpTransceiverDirection } direction 指定添加到peer上的方向
|
|
205
258
|
*/
|
|
206
259
|
private streamConfigProcessor;
|
|
260
|
+
/**
|
|
261
|
+
* 计算一组StreamConfig中Track面积最小的尺寸信息
|
|
262
|
+
*
|
|
263
|
+
* @param { IStreamConfig[] } streamConfigList - An array of `IStreamConfig` objects
|
|
264
|
+
*/
|
|
265
|
+
private calculateContentTrackSize;
|
|
266
|
+
/**
|
|
267
|
+
* 重置ContentTrack尺寸信息
|
|
268
|
+
*/
|
|
269
|
+
resetContentTrackSize(): void;
|
|
207
270
|
/**
|
|
208
271
|
* 添加Track轨道数据
|
|
209
272
|
*
|
|
@@ -233,6 +296,14 @@ export default class Peer {
|
|
|
233
296
|
* @param { RTCRtpTransceiverDirection } direction - 通道方向
|
|
234
297
|
*/
|
|
235
298
|
private replaceTrackProcessor;
|
|
299
|
+
/**
|
|
300
|
+
* 重置sender发送器的编码器scaleResolutionDownBy参数
|
|
301
|
+
*
|
|
302
|
+
* @param { MediaStreamTrack } track - MediaStreamTrack数据
|
|
303
|
+
* @param { RTCRtpSender } sender - 编码发送器
|
|
304
|
+
* @param { IStreamConfig } streamConfig - 自定义流配置
|
|
305
|
+
*/
|
|
306
|
+
private resetEncodingsScale;
|
|
236
307
|
/**
|
|
237
308
|
* 向peer添加Track轨道数据
|
|
238
309
|
*
|
|
@@ -242,6 +313,14 @@ export default class Peer {
|
|
|
242
313
|
* @param { IStreamConfig } streamConfig 自定义Stream流对象
|
|
243
314
|
*/
|
|
244
315
|
private addTransceiver;
|
|
316
|
+
/**
|
|
317
|
+
* 计算编码器分辨率裁剪比例
|
|
318
|
+
*
|
|
319
|
+
* @param { MediaStreamTrack } track - MediaStream Track
|
|
320
|
+
* @param { IStreamConfig } streamConfig - 自定义Stream流对象
|
|
321
|
+
* @returns { number } - 裁剪比例
|
|
322
|
+
*/
|
|
323
|
+
private calculateScaleValue;
|
|
245
324
|
/**
|
|
246
325
|
* 关联自定义stream对象和Sender发送器数据
|
|
247
326
|
*
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebRTC SDK AI Plugin Lib
|
|
3
|
+
*
|
|
4
|
+
* Created at : 2024-05-14 14:54:33
|
|
5
|
+
* Last modified : 2024-05-14 15:21:59
|
|
6
|
+
*/
|
|
7
|
+
import XYRTCClient from '../client';
|
|
8
|
+
import { XYBaseModule } from '../../type/index';
|
|
9
|
+
export declare class XYPlugin implements XYBaseModule {
|
|
10
|
+
private logger;
|
|
11
|
+
private plugin;
|
|
12
|
+
constructor(client: XYRTCClient);
|
|
13
|
+
/**
|
|
14
|
+
* 获取所有可用的插件
|
|
15
|
+
* @returns { array } - 插件列表
|
|
16
|
+
*/
|
|
17
|
+
getPlugin(): any[];
|
|
18
|
+
/**
|
|
19
|
+
* 销毁插件
|
|
20
|
+
*/
|
|
21
|
+
destroy(): void;
|
|
22
|
+
/**
|
|
23
|
+
* 注册Web AI插件
|
|
24
|
+
*
|
|
25
|
+
* @param { Array } plugins - 插件列表
|
|
26
|
+
*/
|
|
27
|
+
registerPlugins(plugins: any[]): void;
|
|
28
|
+
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* WebRTC SDK Quality Manager
|
|
3
3
|
*
|
|
4
4
|
* Created at : 2023-04-27 15:27:15
|
|
5
|
-
* Last modified :
|
|
5
|
+
* Last modified : 2024-04-23 19:03:09
|
|
6
6
|
*/
|
|
7
|
-
import { IInternals, IWorkerVideoReceiver, IVideoReceiverMessage, IQualityConfig } from '
|
|
7
|
+
import { IInternals, IWorkerVideoReceiver, IVideoReceiverMessage, IQualityConfig } from '../../type/index';
|
|
8
8
|
declare class Quality {
|
|
9
9
|
currentInternals: IInternals;
|
|
10
10
|
nextInternals: IInternals;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
*
|
|
6
6
|
* Created at : 2023-04-24 14:16:27
|
|
7
|
-
* Last modified :
|
|
7
|
+
* Last modified : 2024-06-06 16:01:56
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: {
|
|
10
10
|
new (scriptURL: string | URL, options?: WorkerOptions | undefined): Worker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Client from '
|
|
2
|
-
import { IConfInfo, IInternals } from '
|
|
3
|
-
declare class
|
|
1
|
+
import Client from '../client';
|
|
2
|
+
import { IConfInfo, IInternals, XYBaseModule } from '../../type/index';
|
|
3
|
+
declare class XYQualityReport implements XYBaseModule {
|
|
4
4
|
private client;
|
|
5
5
|
private reportDataTime;
|
|
6
6
|
private meetingQualityData;
|
|
@@ -30,7 +30,7 @@ declare class QualityManager {
|
|
|
30
30
|
*
|
|
31
31
|
* @private
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
destroy(): void;
|
|
34
34
|
/**
|
|
35
35
|
* 清除网络信号统计定时器
|
|
36
36
|
*
|
|
@@ -65,5 +65,11 @@ declare class QualityManager {
|
|
|
65
65
|
* @returns { number } level 计算得到的网络信号等级
|
|
66
66
|
*/
|
|
67
67
|
private calcNetQualityLevel;
|
|
68
|
+
/**
|
|
69
|
+
* Internals统计数据-期望带宽
|
|
70
|
+
*
|
|
71
|
+
* @param { IInternals } internals - 统计数据
|
|
72
|
+
*/
|
|
73
|
+
getNewInternals(internals: IInternals): IInternals;
|
|
68
74
|
}
|
|
69
|
-
export default
|
|
75
|
+
export default XYQualityReport;
|