@xylink/xy-rtc-sdk 4.0.2 → 4.0.4
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/action/index.d.ts +1 -1
- package/enum/index.d.ts +8 -0
- package/export/tools.d.ts +18 -0
- package/feature/artboard/index.d.ts +7 -0
- package/feature/audioPCM/index.d.ts +30 -0
- package/feature/contentPreserver/index.d.ts +39 -0
- package/feature/im/index.d.ts +1 -1
- package/index.d.ts +7 -4
- package/interface/clientInterface.type.d.ts +6 -6
- package/interface/event.type.d.ts +10 -2
- package/interface/extension.type.d.ts +11 -0
- package/interface/processor.type.d.ts +10 -0
- package/interface/videoAudioTrackInterface.type.d.ts +2 -2
- package/main/auth/index.d.ts +8 -15
- package/main/auth/rule.d.ts +10 -0
- package/main/client/clientBase.d.ts +9 -1
- package/main/client/index.d.ts +13 -18
- package/main/client/rule.d.ts +20 -0
- package/main/device/index.d.ts +12 -4
- package/main/device/index.type.d.ts +22 -0
- package/main/helper/index.d.ts +8 -0
- package/main/layout/index.d.ts +7 -0
- package/main/meeting/rule.d.ts +4 -0
- package/main/peer/index.d.ts +34 -5
- package/main/peer/index.type.d.ts +24 -0
- package/main/peer/state.d.ts +5 -0
- package/main/plugin/audioPCM/audio-processor.worklet.d.ts +1 -0
- package/main/plugin/audioPCM/index.d.ts +32 -0
- package/main/plugin/audioPCM/index.type.d.ts +29 -0
- package/main/plugin/audioPCM/processor.d.ts +69 -0
- package/main/plugin/contentPreserver/index.d.ts +31 -0
- package/main/plugin/contentPreserver/index.type.d.ts +69 -0
- package/main/plugin/contentPreserver/processor.d.ts +128 -0
- package/main/plugin/index.type.d.ts +21 -0
- package/main/quality/report.d.ts +1 -0
- package/main/render/audioManager.d.ts +46 -0
- package/main/render/index.d.ts +26 -9
- package/main/render/index.type.d.ts +2 -5
- package/main/render/videoManager.d.ts +36 -2
- package/main/render/videoManager.type.d.ts +10 -0
- package/main/server/index.type.d.ts +2 -0
- package/main/stream/index.d.ts +3 -2
- package/main/track/baseTrack.d.ts +1 -1
- package/main/track/contentTrack.d.ts +78 -3
- package/main/track/helper.d.ts +1 -13
- package/main/track/videoAudioTrack.d.ts +85 -9
- package/main/vom/config.d.ts +10 -0
- package/main/vom/index.d.ts +4 -0
- package/package.json +4 -1
- package/tools/log/logger.worker.d.ts +1 -1
- package/tools/socket/socket.d.ts +1 -1
- package/tools/utils.d.ts +4 -124
- package/type/base.d.ts +5 -5
- package/type/client.d.ts +3 -1
- package/type/stream.d.ts +8 -0
- package/type/track.d.ts +12 -3
- package/xyrtc.js +14572 -12426
- package/tools/data/list.d.ts +0 -87
- package/tools/data/map.d.ts +0 -17
- package/tools/detector/browser.d.ts +0 -114
- package/tools/detector/index.d.ts +0 -187
- package/tools/detector/index.type.d.ts +0 -51
- package/tools/detector/stream.d.ts +0 -77
- package/tools/detector/stream.type.d.ts +0 -56
- package/tools/emitter.d.ts +0 -42
- package/tools/frame/index.d.ts +0 -36
- package/tools/frame/index.type.d.ts +0 -1
- package/tools/index.d.ts +0 -72
- package/tools/pressure/index.d.ts +0 -26
- package/tools/pressure/index.type.d.ts +0 -22
- package/tools/queue/async.d.ts +0 -45
- package/tools/queue/queue.type.d.ts +0 -10
- package/tools/queue/sync.d.ts +0 -36
- package/tools/resize.d.ts +0 -64
- package/tools/snapshot/index.d.ts +0 -23
- package/tools/snapshot/index.type.d.ts +0 -38
- package/tools/store.d.ts +0 -47
- package/tools/verify.d.ts +0 -14
- package/tools/window.d.ts +0 -31
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRotationInfoTotalItem, XYVideoState, XYLayoutState, ILayout, XYLayoutStateResult } from '../../type/index';
|
|
1
|
+
import { IRotationInfoTotalItem, XYVideoState, XYLayoutState, ILayout, XYLayoutStateResult, XYMuteState } from '../../type/index';
|
|
2
2
|
import { default as Logger } from '../../tools/log/logger';
|
|
3
3
|
|
|
4
4
|
declare class VideoManager {
|
|
@@ -21,8 +21,36 @@ declare class VideoManager {
|
|
|
21
21
|
private videoStateChangeCallBack;
|
|
22
22
|
private videoPlayErrorCallBack;
|
|
23
23
|
constructor(logger?: Logger, isContent?: boolean);
|
|
24
|
+
/**
|
|
25
|
+
* 获取当前Layout状态
|
|
26
|
+
*
|
|
27
|
+
* @returns { XYLayoutState } - 当前Layout状态
|
|
28
|
+
*/
|
|
24
29
|
getLayoutState(): XYLayoutState;
|
|
30
|
+
/**
|
|
31
|
+
* 获取是否匹配
|
|
32
|
+
*
|
|
33
|
+
* @returns { boolean } - 是否匹配
|
|
34
|
+
*/
|
|
25
35
|
getIsMatch(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 获取当前正在播放的StreamId,异步更新此数据
|
|
38
|
+
*
|
|
39
|
+
* @returns { string } - 当前StreamId
|
|
40
|
+
*/
|
|
41
|
+
getStreamId(): string;
|
|
42
|
+
/**
|
|
43
|
+
* 获取当前配置的StreamId
|
|
44
|
+
*
|
|
45
|
+
* @returns { string } - 当前StreamId
|
|
46
|
+
*/
|
|
47
|
+
getCurrentStreamId(): string;
|
|
48
|
+
/**
|
|
49
|
+
* 获取当前Video状态
|
|
50
|
+
*
|
|
51
|
+
* @returns { XYVideoState } - 当前Video状态
|
|
52
|
+
*/
|
|
53
|
+
getVideoState(): XYVideoState;
|
|
26
54
|
/**
|
|
27
55
|
* 切换是否处理当前数据
|
|
28
56
|
*
|
|
@@ -30,6 +58,12 @@ declare class VideoManager {
|
|
|
30
58
|
* @returns { boolean } - 结果
|
|
31
59
|
*/
|
|
32
60
|
setIsMatch(is: boolean): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 设置视频是否静音
|
|
63
|
+
*
|
|
64
|
+
* @param { XYMuteState } state - 视频静音状态
|
|
65
|
+
*/
|
|
66
|
+
setMuteState(state: XYMuteState): void;
|
|
33
67
|
/**
|
|
34
68
|
* 设置当前Video对应的MediaStream流
|
|
35
69
|
*
|
|
@@ -180,6 +214,6 @@ declare class VideoManager {
|
|
|
180
214
|
*
|
|
181
215
|
* @param { string } key - 事件Key
|
|
182
216
|
*/
|
|
183
|
-
private
|
|
217
|
+
private emit;
|
|
184
218
|
}
|
|
185
219
|
export default VideoManager;
|
|
@@ -54,6 +54,16 @@ export declare enum XYLayoutState {
|
|
|
54
54
|
'AUDIO_CONTENT' = "AUDIO_CONTENT",
|
|
55
55
|
'ANSWER_PHONE' = "ANSWER_PHONE"
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* 音频播放状态
|
|
59
|
+
*
|
|
60
|
+
* @param MUTE - 音频暂停
|
|
61
|
+
* @param UNMUTE - 音频正常
|
|
62
|
+
*/
|
|
63
|
+
export declare enum XYMuteState {
|
|
64
|
+
'MUTE' = "MUTE",
|
|
65
|
+
'UNMUTE' = "UNMUTE"
|
|
66
|
+
}
|
|
57
67
|
/**
|
|
58
68
|
* 计算最新的LayoutState结果
|
|
59
69
|
*
|
|
@@ -30,6 +30,7 @@ export interface XYServerUrlInfo {
|
|
|
30
30
|
* @property { string } meetingControl - 会控地址
|
|
31
31
|
* @property { string } meetingControlMemebersUrl - 会控参会者地址
|
|
32
32
|
* @property { string } sidebarMeetingControlUrl - 会控侧边栏地址
|
|
33
|
+
* @property { string } whiteBoard - 白板地址
|
|
33
34
|
*/
|
|
34
35
|
export interface ClientServerConfig {
|
|
35
36
|
webServerUrl?: string;
|
|
@@ -40,6 +41,7 @@ export interface ClientServerConfig {
|
|
|
40
41
|
meetingControl?: string;
|
|
41
42
|
meetingControlMemebersUrl?: string;
|
|
42
43
|
sidebarMeetingControlUrl?: string;
|
|
44
|
+
whiteBoard?: string;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* 链接内容
|
package/main/stream/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { default as VideoAudioTrack } from '../track/videoAudioTrack';
|
|
|
4
4
|
import { default as XYRTCClient } from '../client';
|
|
5
5
|
import { default as Logger } from '../../tools/log/logger';
|
|
6
6
|
import { default as Peer } from '../peer/index';
|
|
7
|
-
import { SnapshotParams, SnapshotResult } from '
|
|
7
|
+
import { SnapshotParams, SnapshotResult } from '@xylink/xy-toolkit';
|
|
8
8
|
import { IStreamChangeType, IGetMediaStreams, StreamKind, OperateType, IInitContentStream, DualStreamMsg, AnalyserConfig, XYBaseModule } from '../../type/index';
|
|
9
9
|
|
|
10
10
|
export default class Stream implements XYBaseModule {
|
|
@@ -75,6 +75,7 @@ export default class Stream implements XYBaseModule {
|
|
|
75
75
|
getPlugin(): {
|
|
76
76
|
videoPlugin: any[];
|
|
77
77
|
audioPlugin: any[];
|
|
78
|
+
contentInputPlugin: any[];
|
|
78
79
|
};
|
|
79
80
|
getAudioAnalyserManager(): AnalyserManager;
|
|
80
81
|
/**
|
|
@@ -157,7 +158,7 @@ export default class Stream implements XYBaseModule {
|
|
|
157
158
|
* @param { AnalyserConfig } config - Analyser分析器构造器配置
|
|
158
159
|
* @return { AudioAnalyser | null } - 获取到的Stream
|
|
159
160
|
*/
|
|
160
|
-
getAudioAnalyser(id?: string, config?: AnalyserConfig): import('
|
|
161
|
+
getAudioAnalyser(id?: string, config?: AnalyserConfig): import('../..').AudioAnalyser | null;
|
|
161
162
|
/**
|
|
162
163
|
* 销毁音频分析器,释放资源
|
|
163
164
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { XYEmitter } from '
|
|
1
|
+
import { XYEmitter } from '@xylink/xy-toolkit';
|
|
2
2
|
import { default as Peer } from '../peer/index';
|
|
3
3
|
import { CaptureStatus, IEnableStreamConfig, IReturnResult, IStreamChangeType, IStreamConfig, StreamKind, XYDeviceEventKey, XYTrackEventKey } from '../../type/index';
|
|
4
4
|
import { default as Logger } from '../../tools/log/logger';
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { XYProcessorIF } from '../../interface/processor.type';
|
|
1
2
|
import { default as Peer } from '../peer/index';
|
|
2
3
|
import { default as BaseTrack } from './baseTrack';
|
|
3
4
|
import { default as Stream } from '../stream';
|
|
4
|
-
import { ContentTrackConfig, IReturnResult, XYElectronSource, IStreamChangeType, ShareContentStatus, TrackLibType, XYContentTrackIF } from '../../type/index';
|
|
5
|
+
import { ContentTrackConfig, IReturnResult, XYElectronSource, IStreamChangeType, ShareContentStatus, TrackLibType, XYContentTrackIF, IVideoProcessTrack } from '../../type/index';
|
|
5
6
|
|
|
6
7
|
declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
|
|
7
8
|
private trackType;
|
|
8
9
|
private baseTrackConfig;
|
|
9
10
|
private shareContentTimer;
|
|
10
11
|
shareContentStatus: ShareContentStatus;
|
|
12
|
+
private processorList;
|
|
13
|
+
private mediaStream;
|
|
14
|
+
private processorMediaStream;
|
|
15
|
+
private processorCount;
|
|
11
16
|
constructor(streamInstance: Stream);
|
|
12
17
|
getTrackType(): TrackLibType;
|
|
13
18
|
/**
|
|
@@ -18,6 +23,10 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
|
|
|
18
23
|
* 是否暂停共享
|
|
19
24
|
*/
|
|
20
25
|
get isShareContentPaused(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 初始化Content内部处理器
|
|
28
|
+
*/
|
|
29
|
+
private initContentInternalProcessor;
|
|
21
30
|
/**
|
|
22
31
|
* 采集屏幕/应用/网页标签视频流、支持在共享过程中,采集新的视频流
|
|
23
32
|
* 调用此方法后,SDK开始执行采集桌面屏幕/应用/网页标签流,采集完成后,即可推送到远端;
|
|
@@ -26,7 +35,7 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
|
|
|
26
35
|
* 使用场景:多人音视频通话时,需要分享共享内容时调用
|
|
27
36
|
* 调用时机:createContentTrack()完成之后
|
|
28
37
|
* 相关内容:基础功能-内容共享
|
|
29
|
-
* 注意事项:此方法是Promise
|
|
38
|
+
* 注意事项:此方法是Promise函数,需异步同步执行;执行过程中,可能需要授权屏幕采集权限,请在系统设置中完成授权;
|
|
30
39
|
*
|
|
31
40
|
* @since v4.0.0
|
|
32
41
|
* @param { ContentTrackConfig } config - 分享内容配置
|
|
@@ -71,11 +80,17 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
|
|
|
71
80
|
resume(): Promise<IReturnResult>;
|
|
72
81
|
/**
|
|
73
82
|
* 根据可用的流配置,采集共享视频流
|
|
74
|
-
* 如果失败,则降级采集
|
|
75
83
|
*
|
|
76
84
|
* @returns { Promise<MediaStream | IReturnResult> }
|
|
77
85
|
*/
|
|
78
86
|
private createContentMediaStream;
|
|
87
|
+
/**
|
|
88
|
+
* 创建下一个Content流
|
|
89
|
+
*
|
|
90
|
+
* @param { IVideoProcessTrack } processTrack - 处理后的轨道
|
|
91
|
+
* @returns { MediaStream } - 下一个Content流
|
|
92
|
+
*/
|
|
93
|
+
private createNextContentStream;
|
|
79
94
|
/**
|
|
80
95
|
* 采集Electron桌面共享视频流
|
|
81
96
|
*
|
|
@@ -156,5 +171,65 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
|
|
|
156
171
|
* @param { Peer } peer Peer模块
|
|
157
172
|
*/
|
|
158
173
|
handleChangeStream(body: IStreamChangeType, peer: Peer): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* AI插件-连接插件处理器
|
|
176
|
+
* 将插件处理器注入到视频流轨道中,执行视频流的定制处理;
|
|
177
|
+
* 使用场景:多人音视频通话时,需要针对视频流做定制处理,例如接入虚拟背景、美颜、水印、Content快照等功能,可通过注入插件机制处理视频流
|
|
178
|
+
* 调用时机:createContentTrack()完成之后
|
|
179
|
+
* 关联内容:N/A
|
|
180
|
+
*
|
|
181
|
+
* @since 4.0.4
|
|
182
|
+
* @param { XYProcessorIF } processor - 处理器模块,由各个插件实现(例如:ContentSnapshotPlugin、VirtualBackgroundPlugin)
|
|
183
|
+
* @returns { VideoAudioTrack } - 当前实力,支持链式调用,可链接多个流插件处理器
|
|
184
|
+
*/
|
|
185
|
+
connect(processor: XYProcessorIF): this;
|
|
186
|
+
/**
|
|
187
|
+
* AI插件-连接最终视频插件处理器
|
|
188
|
+
* 将插件处理器注入到视频流轨道中,执行视频流的定制处理,并返回处理过后的视频流;
|
|
189
|
+
* 使用场景:多人音视频通话时,需要针对视频流做定制处理,例如接入虚拟背景、美颜、水印等功能,可通过注入插件机制处理视频流
|
|
190
|
+
* 调用时机:createContentTrack()完成之后
|
|
191
|
+
* 关联内容:N/A
|
|
192
|
+
*
|
|
193
|
+
* @since 4.0.4
|
|
194
|
+
* @param { Function } processor - 视频处理器
|
|
195
|
+
* @returns { VideoAudioTrack } - current instance, support chain invoke
|
|
196
|
+
*/
|
|
197
|
+
connectToVideo(processor: Function): this;
|
|
198
|
+
/**
|
|
199
|
+
* 执行处理器队列任务
|
|
200
|
+
*
|
|
201
|
+
* @param { PluginProcessor } processTrack - 插件处理器
|
|
202
|
+
*/
|
|
203
|
+
private executeProcessor;
|
|
204
|
+
/**
|
|
205
|
+
* 获取处理器队列头部任务
|
|
206
|
+
*
|
|
207
|
+
* @returns
|
|
208
|
+
*/
|
|
209
|
+
private popProcessor;
|
|
210
|
+
/**
|
|
211
|
+
* 判断处理器队列是否是最后一个
|
|
212
|
+
*
|
|
213
|
+
* @returns { boolean } - true or false
|
|
214
|
+
*/
|
|
215
|
+
private isProcessorEnd;
|
|
216
|
+
/**
|
|
217
|
+
* AI插件-视频流轨道处理器链路的最终节点
|
|
218
|
+
*
|
|
219
|
+
* @since 4.0.4
|
|
220
|
+
* @param { IVideoProcessTrack } processTrack - transform track
|
|
221
|
+
* @returns { IVideoProcessTrack } - return IVideoProcessTrack
|
|
222
|
+
*/
|
|
223
|
+
processorDestination(processTrack: IVideoProcessTrack): Promise<IVideoProcessTrack>;
|
|
224
|
+
/**
|
|
225
|
+
* 清理基础的采集视频流
|
|
226
|
+
*/
|
|
227
|
+
private closeBaseMediaStream;
|
|
228
|
+
/**
|
|
229
|
+
* 切换Content音频流是否开启
|
|
230
|
+
*
|
|
231
|
+
* @param { boolean } enable - 是否开启
|
|
232
|
+
*/
|
|
233
|
+
private switchContentAudioTrackEnable;
|
|
159
234
|
}
|
|
160
235
|
export default ContentTrack;
|
package/main/track/helper.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Stream Constraints Helper Tools
|
|
3
3
|
*
|
|
4
4
|
* Created at : 2023-11-21 16:06:12
|
|
5
|
-
* Last modified :
|
|
5
|
+
* Last modified : 2025-03-20 16:59:44
|
|
6
6
|
*/
|
|
7
7
|
export declare const ANALYSER_LOCAL_PREFIX = "LOCAL_PREFIX_";
|
|
8
8
|
/**
|
|
@@ -29,18 +29,6 @@ export declare const mergeCompatibleConstraints: (baseConstraints?: any) => {
|
|
|
29
29
|
video: any;
|
|
30
30
|
audio: any;
|
|
31
31
|
};
|
|
32
|
-
/**
|
|
33
|
-
* 异步延迟等待
|
|
34
|
-
*
|
|
35
|
-
* @param { number } num - 延迟时间,单位毫秒
|
|
36
|
-
*/
|
|
37
|
-
export declare const sleepAsync: (num: number) => Promise<unknown>;
|
|
38
|
-
/**
|
|
39
|
-
* 同步延迟等待
|
|
40
|
-
*
|
|
41
|
-
* @param { number } msec - 延迟时间,单位毫秒
|
|
42
|
-
*/
|
|
43
|
-
export declare const sleepSync: (msec: number) => Promise<void>;
|
|
44
32
|
/**
|
|
45
33
|
* 处理采集视频流错误码
|
|
46
34
|
*
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { XYProcessorIF } from '../../interface/processor.type';
|
|
1
2
|
import { default as DeviceManager } from '../device/index';
|
|
2
3
|
import { default as Peer } from '../peer/index';
|
|
3
4
|
import { default as BaseTrack } from './baseTrack';
|
|
4
5
|
import { default as Stream } from '../stream';
|
|
5
|
-
import { CaptureStatus, DEVICE_KIND, FacingMode, IFacingMode,
|
|
6
|
+
import { CaptureStatus, DEVICE_KIND, FacingMode, IFacingMode, IStreamChangeType, IStreamConfig, OperateType, StreamKind, SwitchDeviceConfig, TrackLibType, AnalyserNode, PeopleTrackConfig, IReturnResult, XYVideoAudioTrackIF } from '../../type/index';
|
|
6
7
|
|
|
7
8
|
declare class VideoAudioTrack extends BaseTrack implements XYVideoAudioTrackIF {
|
|
8
9
|
deviceManager: DeviceManager;
|
|
@@ -10,13 +11,14 @@ declare class VideoAudioTrack extends BaseTrack implements XYVideoAudioTrackIF {
|
|
|
10
11
|
private analyserNode;
|
|
11
12
|
private facingMode;
|
|
12
13
|
private trackType;
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private processorCount;
|
|
14
|
+
private processorMap;
|
|
15
|
+
private processorCountMap;
|
|
16
16
|
private retryPublishStream;
|
|
17
17
|
private captureStream;
|
|
18
18
|
private meetingState;
|
|
19
19
|
private baseTrackConfig;
|
|
20
|
+
private currentVideoTracks;
|
|
21
|
+
private currentAudioTracks;
|
|
20
22
|
constructor(streamInstance: Stream);
|
|
21
23
|
getLocalStream(): IStreamConfig[];
|
|
22
24
|
getTrackType(): TrackLibType;
|
|
@@ -62,10 +64,34 @@ declare class VideoAudioTrack extends BaseTrack implements XYVideoAudioTrackIF {
|
|
|
62
64
|
* 调用时机:createVideoAudioTrack()完成之后
|
|
63
65
|
* 关联内容:N/A
|
|
64
66
|
*
|
|
65
|
-
* @param {
|
|
67
|
+
* @param { XYProcessorIF } processor - plugin processor
|
|
66
68
|
* @returns { VideoAudioTrack } - current instance, support chain invoke
|
|
67
69
|
*/
|
|
68
|
-
connect(processor:
|
|
70
|
+
connect(processor: XYProcessorIF): this;
|
|
71
|
+
/**
|
|
72
|
+
* AI插件-连接最终视频插件处理器
|
|
73
|
+
* 将插件处理器注入到视频流轨道中,执行视频流的定制处理,并返回处理过后的视频流;
|
|
74
|
+
* 使用场景:多人音视频通话时,需要针对视频流做定制处理,例如接入虚拟背景、美颜、水印等功能,可通过注入插件机制处理视频流
|
|
75
|
+
* 调用时机:createVideoAudioTrack()完成之后
|
|
76
|
+
* 关联内容:N/A
|
|
77
|
+
*
|
|
78
|
+
* @since 4.0.4
|
|
79
|
+
* @param { Function } processor - 视频处理器
|
|
80
|
+
* @returns { VideoAudioTrack } - current instance, support chain invoke
|
|
81
|
+
*/
|
|
82
|
+
connectToVideo(processor: Function): this;
|
|
83
|
+
/**
|
|
84
|
+
* AI插件-连接最终音频插件处理器
|
|
85
|
+
* 将音频处理器注入到音频流轨道中,执行音频流的定制处理,并返回处理过后的音频流;
|
|
86
|
+
* 使用场景:多人音视频通话时,需要针对音频流做定制处理,例如接入语音识别、语音合成等功能,可通过注入插件机制处理音频流
|
|
87
|
+
* 调用时机:createVideoAudioTrack()完成之后
|
|
88
|
+
* 关联内容:N/A
|
|
89
|
+
*
|
|
90
|
+
* @since 4.0.4
|
|
91
|
+
* @param { Function } processor - 音频处理器
|
|
92
|
+
* @returns { VideoAudioTrack } - current instance, support chain invoke
|
|
93
|
+
*/
|
|
94
|
+
connectToAudio(processor: Function): this;
|
|
69
95
|
/**
|
|
70
96
|
* 获取处理器队列头部任务
|
|
71
97
|
*
|
|
@@ -78,25 +104,63 @@ declare class VideoAudioTrack extends BaseTrack implements XYVideoAudioTrackIF {
|
|
|
78
104
|
* @returns { boolean } - true or false
|
|
79
105
|
*/
|
|
80
106
|
private isProcessorEnd;
|
|
107
|
+
/**
|
|
108
|
+
* 设置处理器列表
|
|
109
|
+
*
|
|
110
|
+
* @param { PluginType } processorType - 插件类型
|
|
111
|
+
* @param { Function } processor - 处理器
|
|
112
|
+
*/
|
|
113
|
+
private setProcessorList;
|
|
114
|
+
/**
|
|
115
|
+
* 设置处理器数量
|
|
116
|
+
*
|
|
117
|
+
* @param { PluginType } pluginType - 插件类型
|
|
118
|
+
*/
|
|
119
|
+
private setProcessorCount;
|
|
81
120
|
/**
|
|
82
121
|
* 执行处理器队列任务
|
|
83
122
|
*
|
|
84
123
|
* @param { PluginProcessor } processTrack - 插件处理器
|
|
85
124
|
*/
|
|
86
125
|
private executeProcessor;
|
|
126
|
+
/**
|
|
127
|
+
* 获取Local音频PCM处理器
|
|
128
|
+
*
|
|
129
|
+
* @returns { XYAudioPCMProcessor } - audio pcm processor
|
|
130
|
+
*/
|
|
131
|
+
private getAudioPCMProcessor;
|
|
132
|
+
/**
|
|
133
|
+
* 初始化音频处理器
|
|
134
|
+
*/
|
|
135
|
+
initAudioTrackProcessor(): void;
|
|
87
136
|
/**
|
|
88
137
|
* AI插件-摄像头和麦克风轨道处理器链路的最终节点
|
|
89
138
|
*
|
|
90
|
-
* @param {
|
|
91
|
-
* @returns {
|
|
139
|
+
* @param { T } processTrack - transform track
|
|
140
|
+
* @returns { Promise<MediaStreamTrack> } - return track
|
|
92
141
|
*/
|
|
93
|
-
processorDestination(processTrack:
|
|
142
|
+
processorDestination<T>(processTrack: T): Promise<T>;
|
|
94
143
|
/**
|
|
95
144
|
* 采集最大分辨率视频流或音频流
|
|
96
145
|
*
|
|
97
146
|
* @returns { Promise<MediaStream | null> }
|
|
98
147
|
*/
|
|
99
148
|
createUserMediaStream(): Promise<MediaStream | null>;
|
|
149
|
+
/**
|
|
150
|
+
* 处理视频流或音频流
|
|
151
|
+
* @param { MediaStreamTrack[] | null } tracks - 视频流或音频流
|
|
152
|
+
* @param { PluginType } type - 视频流或音频流类型
|
|
153
|
+
* @returns { Promise<MediaStreamTrack | null> } - 处理后的视频流或音频流
|
|
154
|
+
*/
|
|
155
|
+
private processTracks;
|
|
156
|
+
/**
|
|
157
|
+
* 合并视频流或音频流
|
|
158
|
+
*
|
|
159
|
+
* @param { MediaStreamTrack[] | null } videoTracks - 视频流
|
|
160
|
+
* @param { MediaStreamTrack[] | null } audioTracks - 音频流
|
|
161
|
+
* @returns { MediaStream } - 合并后的视频流或音频流
|
|
162
|
+
*/
|
|
163
|
+
private mergeAndPublishTracks;
|
|
100
164
|
/**
|
|
101
165
|
* 获取本地音频StreamConfig配置
|
|
102
166
|
*
|
|
@@ -226,6 +290,18 @@ declare class VideoAudioTrack extends BaseTrack implements XYVideoAudioTrackIF {
|
|
|
226
290
|
* Clear audio level
|
|
227
291
|
*/
|
|
228
292
|
private clearAudioLevel;
|
|
293
|
+
/**
|
|
294
|
+
* 恢复音频PCM处理器
|
|
295
|
+
*/
|
|
296
|
+
enableAudioPCMProcessor(enable?: boolean): void;
|
|
297
|
+
/**
|
|
298
|
+
* 清除音频PCM处理器
|
|
299
|
+
*/
|
|
300
|
+
disableAudioPCMProcessor(): void;
|
|
301
|
+
/**
|
|
302
|
+
* 销毁音频PCM处理器
|
|
303
|
+
*/
|
|
304
|
+
clearAudioPCMProcessor(): void;
|
|
229
305
|
/**
|
|
230
306
|
* 切换低性能模式,重新采集&发送People和Content的能力
|
|
231
307
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IStreamChange } from '../../type/index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 默认content 720p的vom配置
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_CONTENT_720P_STREAM_CHANGE: IStreamChange;
|
|
7
|
+
/**
|
|
8
|
+
* 默认content 1080p的vom配置
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEFAULT_CONTENT_1080P_STREAM_CHANGE: IStreamChange;
|
package/main/vom/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylink/xy-rtc-sdk",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"author": "jinghui-Luo",
|
|
5
5
|
"email": "luojinghui424@gmail.com",
|
|
6
6
|
"bugs": {
|
|
@@ -36,5 +36,8 @@
|
|
|
36
36
|
"terser": "^5.37.0",
|
|
37
37
|
"uuid": "^10.0.0"
|
|
38
38
|
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@xylink/xy-toolkit": "^0.1.0"
|
|
41
|
+
},
|
|
39
42
|
"scripts": {}
|
|
40
43
|
}
|
package/tools/socket/socket.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { XYEmitter } from '../emitter';
|
|
2
1
|
import { SocketOptions, XYSocketEventKey } from '../../type/index';
|
|
2
|
+
import { XYEmitter } from '@xylink/xy-toolkit';
|
|
3
3
|
import { default as Logger } from '../log/logger';
|
|
4
4
|
|
|
5
5
|
export declare class Socket extends XYEmitter<XYSocketEventKey> {
|
package/tools/utils.d.ts
CHANGED
|
@@ -1,67 +1,5 @@
|
|
|
1
1
|
import { IReturnResult, XYError } from '../type/index';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* 防抖函数
|
|
5
|
-
*
|
|
6
|
-
* 在事件被触发N秒后再执行回调,如果在这N秒内又被触发,则重新计时
|
|
7
|
-
* 适用于输入框实时搜索、窗口Resize等场景
|
|
8
|
-
*
|
|
9
|
-
* @param { Function } fn - 需要防抖的函数
|
|
10
|
-
* @param { number } delay - 延迟执行的时间(ms)
|
|
11
|
-
* @returns { Function } 返回新的防抖函数
|
|
12
|
-
*/
|
|
13
|
-
export declare const XYDebounce: (fn: Function, delay: number) => () => void;
|
|
14
|
-
/**
|
|
15
|
-
* 节流函数
|
|
16
|
-
*
|
|
17
|
-
* 规定一个单位时间,在这个单位时间内,只能有一次触发事件的回调函数执行
|
|
18
|
-
* 如果在同一个单位时间内某事件被触发多次,只有一次能生效
|
|
19
|
-
* 适用于拖拽场景、计算鼠标移动距离等场景
|
|
20
|
-
*
|
|
21
|
-
* @param { Function } fn - 需要节流的函数
|
|
22
|
-
* @param { number } delay - 最后一次延迟触发时间(ms)
|
|
23
|
-
* @param { number } atleast - 触发最短间隔时间(ms)
|
|
24
|
-
* @returns { Function } 返回新的节流函数
|
|
25
|
-
*/
|
|
26
|
-
export declare const XYThrottle: (fn: Function, delay: number, atleast: number) => () => void;
|
|
27
|
-
/**
|
|
28
|
-
* 获取当前时间
|
|
29
|
-
*
|
|
30
|
-
* 格式:xxxx-xx-xx xx:xx
|
|
31
|
-
*/
|
|
32
|
-
export declare const XYCurrentTime: () => string;
|
|
33
|
-
/**
|
|
34
|
-
* 获取当前时间
|
|
35
|
-
*
|
|
36
|
-
* Format:xxxx-xx-xx xx:xx:xx xx
|
|
37
|
-
*/
|
|
38
|
-
export declare const getTime: () => string;
|
|
39
|
-
/**
|
|
40
|
-
* 获取当前时间
|
|
41
|
-
*
|
|
42
|
-
* Format:xx:xx:xx xx
|
|
43
|
-
*/
|
|
44
|
-
export declare const getMillTime: () => string;
|
|
45
|
-
/**
|
|
46
|
-
* 计算两个时间戳相差的天数, 四舍五入保留一位小数
|
|
47
|
-
*
|
|
48
|
-
* @param { number } time1 - 时间戳1
|
|
49
|
-
* @param { number } time2 - 时间戳2
|
|
50
|
-
* @returns { number } day - 天数
|
|
51
|
-
*/
|
|
52
|
-
export declare const diffTime: (time1: number, time2: number) => number;
|
|
53
|
-
export declare function mapToObj<T>(data: Map<string, T>): {
|
|
54
|
-
[key: string]: T;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* 将对象转换为Map
|
|
58
|
-
*
|
|
59
|
-
* @param { object } obj - 需要转换的对象
|
|
60
|
-
* @returns { Map<string, any> } - 转换后的Map对象
|
|
61
|
-
*/
|
|
62
|
-
export declare function objToMap(obj: {
|
|
63
|
-
[key: string]: any;
|
|
64
|
-
}): Map<string, any>;
|
|
65
3
|
/**
|
|
66
4
|
* 获取上报数据状态
|
|
67
5
|
*
|
|
@@ -88,37 +26,6 @@ export declare const getError: (error?: any) => XYError;
|
|
|
88
26
|
* @returns { any } - 隐藏后的信息
|
|
89
27
|
*/
|
|
90
28
|
export declare const hideKeyInfo: (data: any, key: string | string[], maxDepth?: number) => any;
|
|
91
|
-
/**
|
|
92
|
-
* 判断值类型
|
|
93
|
-
*/
|
|
94
|
-
export declare const TYPEOF: {
|
|
95
|
-
isNumber(num: any): num is number;
|
|
96
|
-
isObject(obj: any): boolean;
|
|
97
|
-
isArray(arr: any): arr is any[];
|
|
98
|
-
isString(str: any): str is string;
|
|
99
|
-
isBoolean(str: any): str is boolean;
|
|
100
|
-
isUndefined(str: any): str is undefined;
|
|
101
|
-
isFunction(val: any): val is Function;
|
|
102
|
-
isLetter(val: any): boolean;
|
|
103
|
-
isChinese(val: any): boolean;
|
|
104
|
-
isNumberText(val: any): boolean;
|
|
105
|
-
isSpecialChar(val: any): boolean;
|
|
106
|
-
isWhiteSpace(val: any): boolean;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* JSON字符串转对象
|
|
110
|
-
*
|
|
111
|
-
* @param { any } jsonString
|
|
112
|
-
* @returns { object}
|
|
113
|
-
*/
|
|
114
|
-
export declare const jsonParse: (jsonString: any) => any;
|
|
115
|
-
/**
|
|
116
|
-
* 字符串转 JSON 字符串
|
|
117
|
-
*
|
|
118
|
-
* @param {string|object} value
|
|
119
|
-
* @returns {string}
|
|
120
|
-
*/
|
|
121
|
-
export declare const jsonStringify: (value: string | object) => string;
|
|
122
29
|
/**
|
|
123
30
|
* 清空中文/英文括号和括号内部的内容,返回一个新的字符串
|
|
124
31
|
*
|
|
@@ -127,36 +34,9 @@ export declare const jsonStringify: (value: string | object) => string;
|
|
|
127
34
|
*/
|
|
128
35
|
export declare const clearBrackets: (str: string) => string;
|
|
129
36
|
/**
|
|
130
|
-
*
|
|
37
|
+
* 获取调用者函数名称
|
|
131
38
|
*
|
|
132
|
-
* @
|
|
133
|
-
* @returns { string }
|
|
134
|
-
*/
|
|
135
|
-
export declare const buildQueryString: (params: Record<string, any>) => string;
|
|
136
|
-
/**
|
|
137
|
-
* 替换字符串中的占位符
|
|
138
|
-
*
|
|
139
|
-
* @param { string } str - 原始字符串
|
|
140
|
-
* @param { object } replacements - 替换的键值对
|
|
141
|
-
* @returns { string } 替换后的字符串
|
|
142
|
-
*/
|
|
143
|
-
export declare const replacePlaceholders: (str: string, replacements: {
|
|
144
|
-
[key: string]: string;
|
|
145
|
-
}) => string;
|
|
146
|
-
/**
|
|
147
|
-
* 拆分url
|
|
148
|
-
*
|
|
149
|
-
* @param { string } url - 需要拆分的url
|
|
150
|
-
* @returns
|
|
151
|
-
*/
|
|
152
|
-
export declare const splitUrl: (url: string) => {
|
|
153
|
-
baseUrl: string;
|
|
154
|
-
pathname: string;
|
|
155
|
-
} | {
|
|
156
|
-
baseUrl?: undefined;
|
|
157
|
-
pathname?: undefined;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* 取值小数三位
|
|
39
|
+
* @returns { string } 调用者函数名称
|
|
161
40
|
*/
|
|
162
|
-
|
|
41
|
+
declare function getCallerFunctionName(): string;
|
|
42
|
+
export { getCallerFunctionName };
|
package/type/base.d.ts
CHANGED
|
@@ -71,11 +71,11 @@ export type Key = string | number;
|
|
|
71
71
|
* @param { TIMESTAMP } - 时间戳
|
|
72
72
|
*/
|
|
73
73
|
export declare enum XY_STORAGE_KEY {
|
|
74
|
-
ABILITY = "
|
|
75
|
-
LOG_SERVER = "
|
|
76
|
-
ERROR_CODE = "
|
|
77
|
-
I18N_CODE = "
|
|
78
|
-
TIMESTAMP = "
|
|
74
|
+
ABILITY = "XY_ABILITY",
|
|
75
|
+
LOG_SERVER = "XY_LOG_SERVER",
|
|
76
|
+
ERROR_CODE = "XY_ERROR_CODE",
|
|
77
|
+
I18N_CODE = "XY_I18N_CODE",
|
|
78
|
+
TIMESTAMP = "XY_TIMESTAMP"
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* 可支持的编解码
|
package/type/client.d.ts
CHANGED
|
@@ -700,7 +700,7 @@ export interface IMeetingControl {
|
|
|
700
700
|
* @property { string } chairManUrl - 当前主画面设备的callUrl,没有为''
|
|
701
701
|
* @property { string } contentUri - 当前会议共享内容设别的callUrl,没有为''
|
|
702
702
|
* @property { string } actSpkUri - 当前会议语音激励者的callUrl,没有为''
|
|
703
|
-
* @property { IMediaGroupInfo[] }
|
|
703
|
+
* @property { IMediaGroupInfo[] } mediaGroupInfo - 多分组通人数信息,默认上报0和1分组,分别代表People通道和Content通道
|
|
704
704
|
* @property { ChairManReason } ChairManReason - 主画面对应的模式,默认是主会场模式
|
|
705
705
|
* @property { number } onHoldCount - 等候室人数
|
|
706
706
|
* @property { number } audioTxUnMuteEpCount - 未静音人数
|
|
@@ -1077,6 +1077,7 @@ export interface IReceiveCustomMessage {
|
|
|
1077
1077
|
* @property { boolean } enableMobileNotAuth 移动端是否支持无授权入会, 默认设置为false
|
|
1078
1078
|
* @property { boolean } enableWatermarkContent 是否启用获取content水印内容, 默认启用, 设置为true
|
|
1079
1079
|
* @property { boolean } enableHideLocalView 是否启用隐藏本地画面模式,默认不启用,设置为false
|
|
1080
|
+
* @property { boolean } enableAudioPCM 是否启用音频PCM,默认不启用,设置为false
|
|
1080
1081
|
*/
|
|
1081
1082
|
export interface IFeatureConfig {
|
|
1082
1083
|
enableMeetingShout?: boolean;
|
|
@@ -1092,6 +1093,7 @@ export interface IFeatureConfig {
|
|
|
1092
1093
|
enableMobileNotAuth?: boolean;
|
|
1093
1094
|
enableWatermarkContent?: boolean;
|
|
1094
1095
|
enableHideLocalView?: boolean;
|
|
1096
|
+
enableAudioPCM?: boolean;
|
|
1095
1097
|
}
|
|
1096
1098
|
/**
|
|
1097
1099
|
* SDK功能控制开关的key
|