@xylink/xy-rtc-sdk 4.0.3 → 4.0.5

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.
Files changed (148) hide show
  1. package/action/ability.d.ts +0 -1
  2. package/action/api.d.ts +15 -1
  3. package/action/auth.d.ts +3 -4
  4. package/action/base.d.ts +2 -3
  5. package/action/config.d.ts +2 -3
  6. package/action/control.d.ts +3 -4
  7. package/action/enterprise.d.ts +4 -5
  8. package/action/http.d.ts +2 -3
  9. package/action/index.d.ts +9 -10
  10. package/action/index.type.d.ts +0 -1
  11. package/action/log.d.ts +1 -2
  12. package/action/meeting.d.ts +17 -4
  13. package/enum/client.d.ts +0 -1
  14. package/enum/constraints.d.ts +0 -1
  15. package/enum/errorCode/server.d.ts +0 -1
  16. package/enum/errorCode/signal.d.ts +0 -1
  17. package/enum/index.d.ts +8 -1
  18. package/enum/meeting.d.ts +0 -1
  19. package/enum/polling.d.ts +0 -1
  20. package/export/tools.d.ts +17 -0
  21. package/feature/artboard/index.d.ts +10 -4
  22. package/feature/audioPCM/index.d.ts +29 -0
  23. package/feature/contentPreserver/index.d.ts +38 -0
  24. package/feature/customMessage/index.d.ts +1 -2
  25. package/feature/edu/index.d.ts +1 -2
  26. package/feature/edu/index.type.d.ts +0 -1
  27. package/feature/im/index.d.ts +2 -3
  28. package/feature/query/index.d.ts +2 -3
  29. package/feature/speaker/index.d.ts +2 -3
  30. package/feature/speaker/index.type.d.ts +0 -1
  31. package/feature/translation/index.d.ts +34 -0
  32. package/feature/vep/index.d.ts +56 -0
  33. package/feature/vep/index.type.d.ts +139 -0
  34. package/index.d.ts +11 -9
  35. package/interface/clientInterface.type.d.ts +11 -12
  36. package/interface/contentTrackInterface.type.d.ts +0 -1
  37. package/interface/event.type.d.ts +10 -2
  38. package/interface/extension.type.d.ts +10 -0
  39. package/interface/processor.type.d.ts +9 -0
  40. package/interface/videoAudioTrackInterface.type.d.ts +2 -3
  41. package/main/ability/const.d.ts +0 -1
  42. package/main/ability/index.d.ts +1 -2
  43. package/main/auth/index.d.ts +9 -17
  44. package/main/auth/index.type.d.ts +0 -1
  45. package/main/auth/rule.d.ts +9 -0
  46. package/main/client/clientBase.d.ts +10 -3
  47. package/main/client/clientState.d.ts +1 -2
  48. package/main/client/index.d.ts +66 -47
  49. package/main/client/rule.d.ts +19 -0
  50. package/main/device/index.d.ts +12 -5
  51. package/main/device/index.type.d.ts +22 -0
  52. package/main/helper/i18n.d.ts +0 -1
  53. package/main/helper/index.d.ts +9 -2
  54. package/main/layout/index.d.ts +11 -5
  55. package/main/layout/index.type.d.ts +2 -3
  56. package/main/layout/polling.d.ts +2 -3
  57. package/main/layout/state.d.ts +3 -4
  58. package/main/layout/template/index.d.ts +0 -1
  59. package/main/layout/template/manager.d.ts +0 -1
  60. package/main/layout/template/mobile.d.ts +0 -1
  61. package/main/layout/template/polling.d.ts +0 -1
  62. package/main/media/index.d.ts +4 -5
  63. package/main/media/index.type.d.ts +0 -1
  64. package/main/meeting/control.d.ts +1 -2
  65. package/main/meeting/control.type.d.ts +0 -1
  66. package/main/meeting/index.d.ts +8 -3
  67. package/main/meeting/rule.d.ts +3 -0
  68. package/main/meeting/verify.d.ts +1 -2
  69. package/main/peer/index.d.ts +37 -9
  70. package/main/peer/index.type.d.ts +24 -1
  71. package/main/peer/state.d.ts +4 -0
  72. package/main/plugin/audioPCM/audio-processor.worklet.d.ts +1 -0
  73. package/main/plugin/audioPCM/index.d.ts +31 -0
  74. package/main/plugin/audioPCM/index.type.d.ts +29 -0
  75. package/main/plugin/audioPCM/processor.d.ts +68 -0
  76. package/main/plugin/contentPreserver/index.d.ts +30 -0
  77. package/main/plugin/contentPreserver/index.type.d.ts +69 -0
  78. package/main/plugin/contentPreserver/processor.d.ts +127 -0
  79. package/main/plugin/index.d.ts +1 -2
  80. package/main/plugin/index.type.d.ts +21 -0
  81. package/main/quality/index.d.ts +0 -1
  82. package/main/quality/report.d.ts +2 -2
  83. package/main/render/audioManager.d.ts +45 -0
  84. package/main/render/index.d.ts +27 -11
  85. package/main/render/index.type.d.ts +2 -6
  86. package/main/render/videoManager.d.ts +36 -3
  87. package/main/render/videoManager.type.d.ts +10 -0
  88. package/main/roster/index.d.ts +41 -2
  89. package/main/server/index.d.ts +3 -4
  90. package/main/server/index.type.d.ts +2 -0
  91. package/main/signal/index.d.ts +1 -2
  92. package/main/socket/index.d.ts +2 -3
  93. package/main/stream/index.d.ts +9 -9
  94. package/main/track/baseTrack.d.ts +4 -5
  95. package/main/track/contentTrack.d.ts +80 -6
  96. package/main/track/customContentTrack.d.ts +2 -3
  97. package/main/track/customVideoAudioTrack.d.ts +2 -3
  98. package/main/track/helper.d.ts +1 -13
  99. package/main/track/videoAudioCapture.d.ts +1 -2
  100. package/main/track/videoAudioTrack.d.ts +88 -13
  101. package/main/vom/config.d.ts +9 -0
  102. package/main/vom/index.d.ts +5 -2
  103. package/package.json +6 -3
  104. package/tools/analyser/index.d.ts +0 -1
  105. package/tools/analyser/manager.d.ts +1 -2
  106. package/tools/config.d.ts +0 -1
  107. package/tools/log/db.d.ts +0 -1
  108. package/tools/log/logger.d.ts +0 -1
  109. package/tools/log/logger.worker.d.ts +1 -1
  110. package/tools/log/loggerManager.d.ts +1 -2
  111. package/tools/socket/socket.d.ts +2 -3
  112. package/tools/socket/socketManager.d.ts +2 -3
  113. package/tools/utils.d.ts +4 -125
  114. package/type/ability.d.ts +3 -1
  115. package/type/analyser.d.ts +0 -1
  116. package/type/base.d.ts +5 -5
  117. package/type/capture.d.ts +0 -1
  118. package/type/client.d.ts +9 -48
  119. package/type/index.d.ts +1 -0
  120. package/type/layout.d.ts +1 -2
  121. package/type/meeting.d.ts +4 -5
  122. package/type/quality.d.ts +1 -2
  123. package/type/stream.d.ts +11 -4
  124. package/type/subtitle.d.ts +86 -0
  125. package/type/track.d.ts +12 -4
  126. package/xyrtc.js +15952 -14725
  127. package/tools/data/list.d.ts +0 -87
  128. package/tools/data/map.d.ts +0 -17
  129. package/tools/detector/browser.d.ts +0 -114
  130. package/tools/detector/index.d.ts +0 -187
  131. package/tools/detector/index.type.d.ts +0 -51
  132. package/tools/detector/stream.d.ts +0 -77
  133. package/tools/detector/stream.type.d.ts +0 -56
  134. package/tools/emitter.d.ts +0 -42
  135. package/tools/frame/index.d.ts +0 -36
  136. package/tools/frame/index.type.d.ts +0 -1
  137. package/tools/index.d.ts +0 -72
  138. package/tools/pressure/index.d.ts +0 -26
  139. package/tools/pressure/index.type.d.ts +0 -22
  140. package/tools/queue/async.d.ts +0 -45
  141. package/tools/queue/queue.type.d.ts +0 -10
  142. package/tools/queue/sync.d.ts +0 -36
  143. package/tools/resize.d.ts +0 -64
  144. package/tools/snapshot/index.d.ts +0 -23
  145. package/tools/snapshot/index.type.d.ts +0 -38
  146. package/tools/store.d.ts +0 -47
  147. package/tools/verify.d.ts +0 -14
  148. package/tools/window.d.ts +0 -31
@@ -1,5 +1,4 @@
1
1
  import { IInternals, IWorkerVideoReceiver, IVideoReceiverMessage, IQualityConfig } from '../../type/index';
2
-
3
2
  declare class Quality {
4
3
  currentInternals: IInternals;
5
4
  nextInternals: IInternals;
@@ -1,8 +1,8 @@
1
- import { IConfInfo, IInternals, XYBaseModule } from '../../type/index';
2
1
  import { default as Client } from '../client';
3
-
2
+ import { IConfInfo, IInternals, XYBaseModule } from '../../type/index';
4
3
  declare class XYQualityReport implements XYBaseModule {
5
4
  private client;
5
+ private logger;
6
6
  private reportDataTime;
7
7
  private meetingQualityData;
8
8
  private previousInternals;
@@ -0,0 +1,45 @@
1
+ import { default as XYRTCClient } from '../client';
2
+ import { default as Logger } from '../../tools/log/logger';
3
+ import { XYMuteState } from '../../type/index';
4
+ declare class AudioManager {
5
+ private clientInstance;
6
+ private logger;
7
+ private streamId;
8
+ audioElement: HTMLAudioElement | null;
9
+ constructor(clientInstance: XYRTCClient, logger: Logger);
10
+ getAudioElement(): HTMLAudioElement | null;
11
+ /**
12
+ * 设置音频是否静音
13
+ *
14
+ * @param { XYMuteState } state - 视频静音状态
15
+ */
16
+ setMuteState(state: XYMuteState): void;
17
+ /**
18
+ * 播放音频
19
+ */
20
+ play(): Promise<void>;
21
+ /**
22
+ * 设置音频流和音频元素
23
+ *
24
+ * @param { string } streamId - MediaStream流ID
25
+ * @param { HTMLAudioElement } ele - Audio元素
26
+ */
27
+ setStreamAndElement(streamId: string, ele: HTMLAudioElement): void;
28
+ /**
29
+ * 设置当前Audio对应的Audio元素
30
+ */
31
+ setSource(): Promise<void>;
32
+ /**
33
+ * 创建Audio元素
34
+ *
35
+ * @param { string } streamId - MediaStream流ID
36
+ * @param { HTMLAudioElement } ele - Audio元素
37
+ * @returns { HTMLAudioElement }
38
+ */
39
+ private detectCreateAudioElement;
40
+ /**
41
+ * 销毁AudioManager
42
+ */
43
+ destroy(): void;
44
+ }
45
+ export default AudioManager;
@@ -1,16 +1,21 @@
1
- import { IAudioRenders, XYVideoRendererMap, XYBaseModule } from '../../type/index';
2
- import { default as VideoManager } from './videoManager';
3
1
  import { default as XYRTCClient } from '../client';
4
-
2
+ import { default as VideoManager } from './videoManager';
3
+ import { XYVideoRendererMap, XYAudioRendererMap, XYBaseModule } from '../../type/index';
5
4
  export declare class XYRender implements XYBaseModule {
6
5
  private client;
7
6
  private logger;
8
7
  private slaveVideoManagers;
9
- private audioManagers;
10
8
  private videoManagerMap;
9
+ private audioManagerMap;
11
10
  constructor(client: XYRTCClient);
12
11
  getVideoManagerMap(): XYVideoRendererMap;
13
- getAudioManagers(): IAudioRenders;
12
+ /**
13
+ * 获取音频管理器
14
+ */
15
+ getAudioManagerMap(): XYAudioRendererMap;
16
+ /**
17
+ * 销毁资源
18
+ */
14
19
  destroy(): void;
15
20
  /**
16
21
  * 设置画面渲染元素并播放Video画面
@@ -18,20 +23,31 @@ export declare class XYRender implements XYBaseModule {
18
23
  * @param { string } id - 参会者Layout Id
19
24
  * @param { string } wrapEleId - 包裹video组件的容器ID字段
20
25
  */
21
- setVideoRenderer(id: string, wrapEleId: string): void;
26
+ setVideoRenderer(id: string, wrapEleId: string): Promise<void>;
27
+ /**
28
+ * 切换唇音同步通道状态
29
+ * 1、如果有视频通道,则切换使用视频通道,并Mute音频通道
30
+ * 2、如果没有视频通道,则切换使用音频通道播放
31
+ * 方案文档:https://nones.xylink.com/wiki/#/team/AQzvsooq/space/SLqJDsvD/page/13r8uVuq
32
+ *
33
+ * @param { string } id - 参会者Layout Id
34
+ * @param { XYMuteState } videoState - 视频静音状态
35
+ * @param { XYMuteState } audioState - 音频静音状态
36
+ */
37
+ private switchAudioVideoLipSync;
22
38
  /**
23
39
  * 设置画面渲染元素并播放Video画面
24
40
  *
25
41
  * @param { string } layoutId - 参会者Layout Id
26
42
  * @param { string } wrapEleId - 包裹video组件的容器ID字段
27
43
  */
28
- setSlaveVideoRenderer(layoutId: string, wrapEleId: string): import('../../type/index').IReturnResult;
44
+ setSlaveVideoRenderer(layoutId: string, wrapEleId: string): Promise<import('../../type/index').IReturnResult>;
29
45
  /**
30
46
  * videoManagers 移除key对应的元素
31
47
  *
32
48
  * @param { string } id - 参会者Layout Id
33
49
  */
34
- removeVideoRenderer(id: string): void;
50
+ removeVideoRenderer(id: string): Promise<void>;
35
51
  /**
36
52
  * 【副屏渲染】移除副屏渲染信息
37
53
  * 如果layoutId和viewId没有填写,则清空所有的副屏渲染配置数据
@@ -39,7 +55,7 @@ export declare class XYRender implements XYBaseModule {
39
55
  * @param { string } rosterId - 参会者Layout Id
40
56
  * @param { string } viewId 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
41
57
  */
42
- removeSlaveVideoRenderer(layoutId?: string, viewId?: string): void;
58
+ removeSlaveVideoRenderer(layoutId?: string, viewId?: string): Promise<void>;
43
59
  /**
44
60
  * 重新播放Video画面组件
45
61
  *
@@ -64,9 +80,9 @@ export declare class XYRender implements XYBaseModule {
64
80
  /**
65
81
  * 移除对应的AudioRender
66
82
  *
67
- * @param { string } id - MediaStream的Id字段
83
+ * @param { string } streamId - mediaStream流ID
68
84
  */
69
- removeAudioRender(key: string): void;
85
+ removeAudioRenderer(streamId: string): Promise<void>;
70
86
  /**
71
87
  * Video组件状态变更回调事件
72
88
  *
@@ -1,11 +1,7 @@
1
1
  import { default as VideoManager } from './videoManager';
2
-
2
+ import { default as AudioManager } from './audioManager';
3
3
  export type XYVideoRendererMap = Map<string, VideoManager>;
4
- export type IAudioRenders = {
5
- [key: string]: {
6
- ele: any;
7
- };
8
- };
4
+ export type XYAudioRendererMap = Map<string, AudioManager>;
9
5
  /**
10
6
  * 管理所有的Video Managers
11
7
  *
@@ -1,6 +1,5 @@
1
- import { IRotationInfoTotalItem, XYVideoState, XYLayoutState, ILayout, XYLayoutStateResult } from '../../type/index';
2
1
  import { default as Logger } from '../../tools/log/logger';
3
-
2
+ import { IRotationInfoTotalItem, XYVideoState, XYLayoutState, ILayout, XYLayoutStateResult, XYMuteState } from '../../type/index';
4
3
  declare class VideoManager {
5
4
  private logger;
6
5
  private key;
@@ -21,8 +20,36 @@ declare class VideoManager {
21
20
  private videoStateChangeCallBack;
22
21
  private videoPlayErrorCallBack;
23
22
  constructor(logger?: Logger, isContent?: boolean);
23
+ /**
24
+ * 获取当前Layout状态
25
+ *
26
+ * @returns { XYLayoutState } - 当前Layout状态
27
+ */
24
28
  getLayoutState(): XYLayoutState;
29
+ /**
30
+ * 获取是否匹配
31
+ *
32
+ * @returns { boolean } - 是否匹配
33
+ */
25
34
  getIsMatch(): boolean;
35
+ /**
36
+ * 获取当前正在播放的StreamId,异步更新此数据
37
+ *
38
+ * @returns { string } - 当前StreamId
39
+ */
40
+ getStreamId(): string;
41
+ /**
42
+ * 获取当前配置的StreamId
43
+ *
44
+ * @returns { string } - 当前StreamId
45
+ */
46
+ getCurrentStreamId(): string;
47
+ /**
48
+ * 获取当前Video状态
49
+ *
50
+ * @returns { XYVideoState } - 当前Video状态
51
+ */
52
+ getVideoState(): XYVideoState;
26
53
  /**
27
54
  * 切换是否处理当前数据
28
55
  *
@@ -30,6 +57,12 @@ declare class VideoManager {
30
57
  * @returns { boolean } - 结果
31
58
  */
32
59
  setIsMatch(is: boolean): boolean;
60
+ /**
61
+ * 设置视频是否静音
62
+ *
63
+ * @param { XYMuteState } state - 视频静音状态
64
+ */
65
+ setMuteState(state: XYMuteState): void;
33
66
  /**
34
67
  * 设置当前Video对应的MediaStream流
35
68
  *
@@ -180,6 +213,6 @@ declare class VideoManager {
180
213
  *
181
214
  * @param { string } key - 事件Key
182
215
  */
183
- private emmit;
216
+ private emit;
184
217
  }
185
218
  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
  *
@@ -1,12 +1,28 @@
1
- import { IBulkRoster, IRoster, XYBaseModule } from '../../type/index';
2
1
  import { default as Client } from '../client';
3
-
2
+ import { IBulkRoster, IRoster, XYBaseModule } from '../../type/index';
4
3
  declare class RosterManager implements XYBaseModule {
5
4
  private client;
6
5
  private logger;
7
6
  private bulkRosterMap;
7
+ private rosters;
8
+ private hiddenRosters;
8
9
  constructor(client: Client);
9
10
  getBulkRosterMap(): Map<string, IRoster>;
11
+ getAllRosters(): IRoster[];
12
+ getHiddenRosters(): IRoster[];
13
+ getRosters(): IRoster[];
14
+ /**
15
+ * 设置隐藏的roster信息
16
+ *
17
+ * @param { IRoster[] } rosters - 隐藏的roster信息
18
+ */
19
+ setHiddenRosterInfo(rosters: IRoster[]): this;
20
+ /**
21
+ * 设置的roster信息
22
+ *
23
+ * @param { IRoster[] } rosters - roster信息
24
+ */
25
+ setRosterInfo(rosters: IRoster[]): this;
10
26
  destroy(): void;
11
27
  /**
12
28
  * 获取Roster数据
@@ -15,6 +31,15 @@ declare class RosterManager implements XYBaseModule {
15
31
  * @returns { IRoster | null } - Roster数据
16
32
  */
17
33
  getRosterById(id: string): IRoster | null;
34
+ /**
35
+ * 获取匹配的rosterId
36
+ *
37
+ * @param { { participantId: number }[] } params - participantId
38
+ * @returns { string[] } - rosterId
39
+ */
40
+ getRosterIdByEndpointId(params: {
41
+ participantId: number;
42
+ }[]): string[];
18
43
  /**
19
44
  * 订阅Roster变更消息
20
45
  *
@@ -35,5 +60,19 @@ declare class RosterManager implements XYBaseModule {
35
60
  * @param { IRoster[] } addRosterInfo - 新增Roster列表数据
36
61
  */
37
62
  private appendFullRoster;
63
+ /**
64
+ * 合并VEP数字人roster信息
65
+ *
66
+ * @param { IRoster[] } rosterInfo - 会议中的roster信息
67
+ * @param { IRoster[] } hiddenRosterInfo - 隐藏的roster信息
68
+ * @returns { IRoster[] } 合并后的roster信息
69
+ */
70
+ mergeVepRoster(rosterInfo: IRoster[], hiddenRosterInfo: IRoster[]): IRoster[];
71
+ /**
72
+ * 查找VEP数字人roster信息
73
+ *
74
+ * @returns { IRoster | null } VEP数字人roster信息
75
+ */
76
+ findVepRoster(): IRoster | undefined;
38
77
  }
39
78
  export default RosterManager;
@@ -1,8 +1,7 @@
1
- import { ICodeList, IConfMgmtUrl } from '../../type/client';
2
- import { default as Action } from '../../action/index';
3
- import { default as Client } from '../client';
4
1
  import { ClientServerConfig, ServerLinkData, XYServerInfo, XYServerUrlInfo } from './index.type';
5
-
2
+ import { default as Client } from '../client';
3
+ import { default as Action } from '../../action/index';
4
+ import { ICodeList, IConfMgmtUrl } from '../../type/client';
6
5
  declare class ServerManager {
7
6
  private client;
8
7
  private logger;
@@ -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
  * 链接内容
@@ -1,6 +1,5 @@
1
- import { IMonitorReportMessage, XYBaseModule } from '../../type/index';
2
1
  import { default as XYRTCClient } from '../client';
3
-
2
+ import { IMonitorReportMessage, XYBaseModule } from '../../type/index';
4
3
  export declare class XYSignal implements XYBaseModule {
5
4
  private client;
6
5
  private logger;
@@ -1,7 +1,6 @@
1
- import { XYBaseModule } from '../../type/index';
2
- import { Socket } from '../../tools/socket/socket';
3
1
  import { default as XYRTCClient } from '../client';
4
-
2
+ import { Socket } from '../../tools/socket/socket';
3
+ import { XYBaseModule } from '../../type/index';
5
4
  export declare class XYClientSocket implements XYBaseModule {
6
5
  private client;
7
6
  private logger;
@@ -1,12 +1,11 @@
1
- import { AnalyserManager } from '../../tools/analyser/manager';
2
- import { default as ContentTrack } from '../track/contentTrack';
3
- import { default as VideoAudioTrack } from '../track/videoAudioTrack';
4
- import { default as XYRTCClient } from '../client';
5
- import { default as Logger } from '../../tools/log/logger';
6
- import { default as Peer } from '../peer/index';
7
- import { SnapshotParams, SnapshotResult } from '../../tools/index';
8
1
  import { IStreamChangeType, IGetMediaStreams, StreamKind, OperateType, IInitContentStream, DualStreamMsg, AnalyserConfig, XYBaseModule } from '../../type/index';
9
-
2
+ import { SnapshotParams, SnapshotResult } from '@xylink/xy-toolkit';
3
+ import { default as Peer } from '../peer/index';
4
+ import { default as Logger } from '../../tools/log/logger';
5
+ import { default as XYRTCClient } from '../client';
6
+ import { default as VideoAudioTrack } from '../track/videoAudioTrack';
7
+ import { default as ContentTrack } from '../track/contentTrack';
8
+ import { AnalyserManager } from '../../tools/analyser/manager';
10
9
  export default class Stream implements XYBaseModule {
11
10
  logger: Logger;
12
11
  private clientInstance;
@@ -75,6 +74,7 @@ export default class Stream implements XYBaseModule {
75
74
  getPlugin(): {
76
75
  videoPlugin: any[];
77
76
  audioPlugin: any[];
77
+ contentInputPlugin: any[];
78
78
  };
79
79
  getAudioAnalyserManager(): AnalyserManager;
80
80
  /**
@@ -157,7 +157,7 @@ export default class Stream implements XYBaseModule {
157
157
  * @param { AnalyserConfig } config - Analyser分析器构造器配置
158
158
  * @return { AudioAnalyser | null } - 获取到的Stream
159
159
  */
160
- getAudioAnalyser(id?: string, config?: AnalyserConfig): import('../../tools/index').AudioAnalyser | null;
160
+ getAudioAnalyser(id?: string, config?: AnalyserConfig): import('../..').AudioAnalyser | null;
161
161
  /**
162
162
  * 销毁音频分析器,释放资源
163
163
  *
@@ -1,9 +1,8 @@
1
- import { XYEmitter } from '../../tools/emitter';
2
- import { default as Peer } from '../peer/index';
3
- import { CaptureStatus, IEnableStreamConfig, IReturnResult, IStreamChangeType, IStreamConfig, StreamKind, XYDeviceEventKey, XYTrackEventKey } from '../../type/index';
4
- import { default as Logger } from '../../tools/log/logger';
5
1
  import { default as Stream } from '../stream';
6
-
2
+ import { default as Logger } from '../../tools/log/logger';
3
+ import { CaptureStatus, IEnableStreamConfig, IReturnResult, IStreamChangeType, IStreamConfig, StreamKind, XYDeviceEventKey, XYTrackEventKey } from '../../type/index';
4
+ import { default as Peer } from '../peer/index';
5
+ import { XYEmitter } from '@xylink/xy-toolkit';
7
6
  declare class BaseTrack extends XYEmitter<XYDeviceEventKey | XYTrackEventKey | string> {
8
7
  streamInstance: Stream;
9
8
  logger: Logger;
@@ -1,13 +1,17 @@
1
- import { default as Peer } from '../peer/index';
2
- import { default as BaseTrack } from './baseTrack';
1
+ import { ContentTrackConfig, IReturnResult, XYElectronSource, IStreamChangeType, ShareContentStatus, TrackLibType, XYContentTrackIF, IVideoProcessTrack } from '../../type/index';
3
2
  import { default as Stream } from '../stream';
4
- import { ContentTrackConfig, IReturnResult, XYElectronSource, IStreamChangeType, ShareContentStatus, TrackLibType, XYContentTrackIF } from '../../type/index';
5
-
3
+ import { default as BaseTrack } from './baseTrack';
4
+ import { default as Peer } from '../peer/index';
5
+ import { XYProcessorIF } from '../../interface/processor.type';
6
6
  declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
7
7
  private trackType;
8
8
  private baseTrackConfig;
9
9
  private shareContentTimer;
10
10
  shareContentStatus: ShareContentStatus;
11
+ private processorList;
12
+ private mediaStream;
13
+ private processorMediaStream;
14
+ private processorCount;
11
15
  constructor(streamInstance: Stream);
12
16
  getTrackType(): TrackLibType;
13
17
  /**
@@ -18,6 +22,10 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
18
22
  * 是否暂停共享
19
23
  */
20
24
  get isShareContentPaused(): boolean;
25
+ /**
26
+ * 初始化Content内部处理器
27
+ */
28
+ private initContentInternalProcessor;
21
29
  /**
22
30
  * 采集屏幕/应用/网页标签视频流、支持在共享过程中,采集新的视频流
23
31
  * 调用此方法后,SDK开始执行采集桌面屏幕/应用/网页标签流,采集完成后,即可推送到远端;
@@ -26,7 +34,7 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
26
34
  * 使用场景:多人音视频通话时,需要分享共享内容时调用
27
35
  * 调用时机:createContentTrack()完成之后
28
36
  * 相关内容:​​基础功能-内容共享
29
- * 注意事项:此方法是Promise函数,需同步等待执行,不可异步执行;执行过程中,可能需要授权屏幕采集权限,请在系统设置中完成授权;
37
+ * 注意事项:此方法是Promise函数,需异步同步执行;执行过程中,可能需要授权屏幕采集权限,请在系统设置中完成授权;
30
38
  *
31
39
  * @since v4.0.0
32
40
  * @param { ContentTrackConfig } config - 分享内容配置
@@ -71,11 +79,17 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
71
79
  resume(): Promise<IReturnResult>;
72
80
  /**
73
81
  * 根据可用的流配置,采集共享视频流
74
- * 如果失败,则降级采集
75
82
  *
76
83
  * @returns { Promise<MediaStream | IReturnResult> }
77
84
  */
78
85
  private createContentMediaStream;
86
+ /**
87
+ * 创建下一个Content流
88
+ *
89
+ * @param { IVideoProcessTrack } processTrack - 处理后的轨道
90
+ * @returns { MediaStream } - 下一个Content流
91
+ */
92
+ private createNextContentStream;
79
93
  /**
80
94
  * 采集Electron桌面共享视频流
81
95
  *
@@ -156,5 +170,65 @@ declare class ContentTrack extends BaseTrack implements XYContentTrackIF {
156
170
  * @param { Peer } peer Peer模块
157
171
  */
158
172
  handleChangeStream(body: IStreamChangeType, peer: Peer): Promise<void>;
173
+ /**
174
+ * AI插件-连接插件处理器
175
+ * 将插件处理器注入到视频流轨道中,执行视频流的定制处理;
176
+ * 使用场景:多人音视频通话时,需要针对视频流做定制处理,例如接入虚拟背景、美颜、水印、Content快照等功能,可通过注入插件机制处理视频流
177
+ * 调用时机:createContentTrack()完成之后
178
+ * 关联内容:N/A
179
+ *
180
+ * @since 4.0.4
181
+ * @param { XYProcessorIF } processor - 处理器模块,由各个插件实现(例如:ContentSnapshotPlugin、VirtualBackgroundPlugin)
182
+ * @returns { VideoAudioTrack } - 当前实力,支持链式调用,可链接多个流插件处理器
183
+ */
184
+ connect(processor: XYProcessorIF): this;
185
+ /**
186
+ * AI插件-连接最终视频插件处理器
187
+ * 将插件处理器注入到视频流轨道中,执行视频流的定制处理,并返回处理过后的视频流;
188
+ * 使用场景:多人音视频通话时,需要针对视频流做定制处理,例如接入虚拟背景、美颜、水印等功能,可通过注入插件机制处理视频流
189
+ * 调用时机:createContentTrack()完成之后
190
+ * 关联内容:N/A
191
+ *
192
+ * @since 4.0.4
193
+ * @param { Function } processor - 视频处理器
194
+ * @returns { VideoAudioTrack } - current instance, support chain invoke
195
+ */
196
+ connectToVideo(processor: Function): this;
197
+ /**
198
+ * 执行处理器队列任务
199
+ *
200
+ * @param { PluginProcessor } processTrack - 插件处理器
201
+ */
202
+ private executeProcessor;
203
+ /**
204
+ * 获取处理器队列头部任务
205
+ *
206
+ * @returns
207
+ */
208
+ private popProcessor;
209
+ /**
210
+ * 判断处理器队列是否是最后一个
211
+ *
212
+ * @returns { boolean } - true or false
213
+ */
214
+ private isProcessorEnd;
215
+ /**
216
+ * AI插件-视频流轨道处理器链路的最终节点
217
+ *
218
+ * @since 4.0.4
219
+ * @param { IVideoProcessTrack } processTrack - transform track
220
+ * @returns { IVideoProcessTrack } - return IVideoProcessTrack
221
+ */
222
+ processorDestination(processTrack: IVideoProcessTrack): Promise<IVideoProcessTrack>;
223
+ /**
224
+ * 清理基础的采集视频流
225
+ */
226
+ private closeBaseMediaStream;
227
+ /**
228
+ * 切换Content音频流是否开启
229
+ *
230
+ * @param { boolean } enable - 是否开启
231
+ */
232
+ private switchContentAudioTrackEnable;
159
233
  }
160
234
  export default ContentTrack;
@@ -1,7 +1,6 @@
1
- import { default as BaseTrack } from './baseTrack';
2
- import { default as Stream } from '../stream';
3
1
  import { TrackLibType } from '../../type/index';
4
-
2
+ import { default as Stream } from '../stream';
3
+ import { default as BaseTrack } from './baseTrack';
5
4
  declare class CustomContentTrack extends BaseTrack {
6
5
  private trackType;
7
6
  constructor(streamInstance: Stream);
@@ -1,7 +1,6 @@
1
- import { default as BaseTrack } from './baseTrack';
2
- import { default as Stream } from '../stream';
3
1
  import { TrackLibType } from '../../type/index';
4
-
2
+ import { default as Stream } from '../stream';
3
+ import { default as BaseTrack } from './baseTrack';
5
4
  declare class CustomVideoAudioTrack extends BaseTrack {
6
5
  private trackType;
7
6
  constructor(streamInstance: Stream);
@@ -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 : 2024-08-16 17:46:28
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,6 +1,5 @@
1
- import { default as VideoAudioTrack } from './videoAudioTrack';
2
1
  import { CaptureStatus, IEnableStreamConfig, IEnabledCapture, IStreamCurrent } from '../../type/index';
3
-
2
+ import { default as VideoAudioTrack } from './videoAudioTrack';
4
3
  declare class videoAudioCapture {
5
4
  private enabledCapture;
6
5
  private track;