@xylink/xy-rtc-sdk 3.10.0-beta.4 → 4.0.1

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 (118) hide show
  1. package/README.MD +36 -13
  2. package/lib/action/index.d.ts +61 -45
  3. package/lib/enum/analyser.d.ts +7 -0
  4. package/lib/enum/client.d.ts +8 -2
  5. package/lib/enum/constraints.d.ts +11 -16
  6. package/lib/enum/device.d.ts +0 -6
  7. package/lib/enum/errorCode.d.ts +5 -2
  8. package/lib/enum/index.d.ts +45 -7
  9. package/lib/enum/polling.d.ts +2 -0
  10. package/lib/feature/customMessage/index.d.ts +29 -0
  11. package/lib/feature/edu/index.d.ts +34 -0
  12. package/lib/feature/edu/index.type.d.ts +29 -0
  13. package/lib/feature/index.d.ts +3 -1
  14. package/lib/feature/{speaker.d.ts → speaker/index.d.ts} +29 -9
  15. package/lib/feature/speaker/index.type.d.ts +17 -0
  16. package/lib/index.d.ts +82 -28
  17. package/lib/interface/baseModule.type.d.ts +9 -0
  18. package/lib/interface/clientInterface.type.d.ts +128 -0
  19. package/lib/interface/contentTrackInterface.type.d.ts +15 -0
  20. package/lib/interface/event.type.d.ts +444 -0
  21. package/lib/interface/videoAudioTrackInterface.type.d.ts +17 -0
  22. package/lib/main/ability/const.d.ts +4 -1
  23. package/lib/main/ability/index.d.ts +7 -1
  24. package/lib/main/{auth.d.ts → auth/index.d.ts} +29 -19
  25. package/lib/main/client.d.ts +594 -633
  26. package/lib/main/clientBase.d.ts +40 -0
  27. package/lib/main/clientState.d.ts +56 -0
  28. package/lib/main/{deviceManager.d.ts → device/index.d.ts} +45 -13
  29. package/lib/{type/device.d.ts → main/device/index.type.d.ts} +65 -16
  30. package/lib/main/helper/index.d.ts +118 -0
  31. package/lib/main/helper/index.type.d.ts +12 -0
  32. package/lib/main/layout/index.d.ts +118 -105
  33. package/lib/main/layout/index.type.d.ts +282 -0
  34. package/lib/main/layout/polling.d.ts +212 -0
  35. package/lib/main/layout/state.d.ts +163 -0
  36. package/lib/main/layout/template.d.ts +15 -7
  37. package/lib/main/media/index.d.ts +177 -0
  38. package/lib/main/media/index.type.d.ts +29 -0
  39. package/lib/main/meeting/control.d.ts +107 -0
  40. package/lib/main/meeting/control.type.d.ts +24 -0
  41. package/lib/main/{meeting.d.ts → meeting/index.d.ts} +51 -7
  42. package/lib/main/meeting/verify.d.ts +70 -0
  43. package/lib/main/meeting/verify.type.d.ts +12 -0
  44. package/lib/main/peer.d.ts +120 -41
  45. package/lib/main/plugin/index.d.ts +28 -0
  46. package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
  47. package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
  48. package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
  49. package/lib/main/render/index.d.ts +116 -0
  50. package/lib/main/render/index.type.d.ts +36 -0
  51. package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
  52. package/lib/main/render/videoManager.type.d.ts +66 -0
  53. package/lib/main/roster/index.d.ts +39 -0
  54. package/lib/main/server/index.d.ts +79 -0
  55. package/lib/main/server/index.type.d.ts +21 -0
  56. package/lib/main/signal/index.d.ts +15 -0
  57. package/lib/main/socket/index.d.ts +95 -0
  58. package/lib/main/stream/index.d.ts +182 -0
  59. package/lib/main/track/baseTrack.d.ts +178 -0
  60. package/lib/main/track/contentTrack.d.ts +168 -0
  61. package/lib/main/track/customContentTrack.d.ts +18 -0
  62. package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
  63. package/lib/main/track/helper.d.ts +65 -0
  64. package/lib/main/track/videoAudioCapture.d.ts +90 -0
  65. package/lib/main/track/videoAudioTrack.d.ts +273 -0
  66. package/lib/main/vom/index.d.ts +44 -0
  67. package/lib/main/vom/index.type.d.ts +1 -0
  68. package/lib/tools/analyser.d.ts +30 -7
  69. package/lib/tools/analyserManager.d.ts +55 -0
  70. package/lib/tools/dbManager.d.ts +12 -1
  71. package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
  72. package/lib/tools/detectStream/index.d.ts +84 -0
  73. package/lib/tools/detectStream/index.type.d.ts +56 -0
  74. package/lib/tools/detectTool/index.d.ts +191 -0
  75. package/lib/tools/detectTool/index.type.d.ts +51 -0
  76. package/lib/tools/emitter.d.ts +27 -6
  77. package/lib/tools/enum.d.ts +1 -1
  78. package/lib/tools/httpClient.d.ts +5 -1
  79. package/lib/tools/i18n.d.ts +1 -1
  80. package/lib/tools/index.d.ts +1 -8
  81. package/lib/tools/log/logger.d.ts +44 -24
  82. package/lib/tools/log/logger.worker.d.ts +1 -1
  83. package/lib/tools/log/loggerManager.d.ts +3 -2
  84. package/lib/tools/pressure/index.d.ts +33 -0
  85. package/lib/tools/pressure/index.type.d.ts +22 -0
  86. package/lib/tools/promiseQueue.d.ts +6 -0
  87. package/lib/tools/regex.d.ts +4 -0
  88. package/lib/tools/resize.d.ts +3 -0
  89. package/lib/tools/snapshot.d.ts +1 -1
  90. package/lib/tools/socket.d.ts +12 -2
  91. package/lib/tools/template/index.d.ts +11 -88
  92. package/lib/tools/template/mobile.d.ts +1 -1
  93. package/lib/tools/template/polling.d.ts +8 -0
  94. package/lib/tools/utils.d.ts +25 -16
  95. package/lib/tools/verify.d.ts +7 -0
  96. package/lib/type/ability.d.ts +1 -1
  97. package/lib/type/analyser.d.ts +26 -1
  98. package/lib/type/auth.d.ts +22 -22
  99. package/lib/type/base.d.ts +36 -32
  100. package/lib/type/capture.d.ts +9 -0
  101. package/lib/type/client.d.ts +379 -498
  102. package/lib/type/index.d.ts +25 -2
  103. package/lib/type/layout.d.ts +84 -47
  104. package/lib/type/logger.d.ts +19 -12
  105. package/lib/type/meeting.d.ts +89 -68
  106. package/lib/type/peer.d.ts +65 -1
  107. package/lib/type/polling.d.ts +194 -0
  108. package/lib/type/quality.d.ts +16 -6
  109. package/lib/type/socket.d.ts +0 -18
  110. package/lib/type/stream.d.ts +138 -108
  111. package/lib/type/track.d.ts +139 -0
  112. package/lib/xyrtc.cjs.js +1 -1
  113. package/lib/xyrtc.umd.js +1 -1
  114. package/package.json +13 -10
  115. package/lib/main/clientImplements.d.ts +0 -99
  116. package/lib/main/helper.d.ts +0 -104
  117. package/lib/main/stream.d.ts +0 -418
  118. package/lib/tools/detect.d.ts +0 -44
@@ -0,0 +1,17 @@
1
+ import { AnalyserNode } from '../../type/index';
2
+ /**
3
+ * 实时讲话人内部数据
4
+ */
5
+ export interface SpeakerMapItem {
6
+ stream: MediaStream | null;
7
+ analyserNode: AnalyserNode | null;
8
+ timestamp: number;
9
+ mediaTrackId: string;
10
+ }
11
+ /**
12
+ * 音频分析器Map
13
+ *
14
+ * @param { string } rosterId - RosterId
15
+ * @param { SpeakerMapItem } value - 基于LayoutId封装的数据结构
16
+ */
17
+ export type XYAnalyserMap = Map<string, SpeakerMapItem>;
package/lib/index.d.ts CHANGED
@@ -1,40 +1,94 @@
1
1
  /**
2
2
  * XYLink WebRTC SDK Lib
3
3
  *
4
- * 主入口文件,提供 createClient、createStream、版本等基本信息和方法;
5
- *
6
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
7
5
  * @date 2019-10-14 18:20:28
8
6
  */
9
- import { IClientConfig, TLocale, ICheckSystemRequirements } from './type';
10
- import DeviceManager from './main/deviceManager';
7
+ import XYRTCClient from './main/client';
11
8
  import Logger from './tools/log/logger';
12
- import Client from './main/client';
13
- import Stream from './main/stream';
14
- import { getVideoInfoByRotation, getSendSupportedCodec, getLayoutRotateInfo, getLayoutItemState, detectLocator } from './main/helper';
15
- import BrowserDetector from './tools/browser';
16
9
  import LogManager from './tools/log/loggerManager';
10
+ import ContentTrack from './main/track/contentTrack';
11
+ import VideoAudioTrack from './main/track/videoAudioTrack';
12
+ import { IClientConfig, TLocale } from './type/index';
13
+ import { ICheckSystemRequirements } from './tools/detectTool/index.type';
14
+ import { XYDetector } from './tools/detectTool';
15
+ export { AudioAnalyser } from './tools/analyser';
16
+ export { XYStreamDetector } from './tools/detectStream';
17
+ export * from './main/helper/index';
17
18
  /**
18
- * XYLink WebRTC SDK 操作入口
19
+ * XYLink WebRTC SDK 入口
19
20
  */
20
- interface XYLinkRTC {
21
- version: string;
22
- client: Client | null;
23
- logger: Logger;
24
- create: (config: IClientConfig, logger?: Logger) => {
25
- client: Client;
26
- stream: Stream;
27
- };
28
- checkSupportWebRTC: () => Promise<ICheckSystemRequirements>;
29
- checkSupportMobileWebRTC: () => Promise<ICheckSystemRequirements>;
30
- checkSupportShareContent: () => boolean;
31
- setLocale: (language: TLocale) => void;
32
- setOutputAudioDevice: (element: HTMLMediaElement, outputValue: string) => Promise<void>;
33
- render: void;
21
+ export default class XYRTC {
22
+ /**
23
+ * 小鱼易连Web SDK的版本和构建时间
24
+ */
25
+ static version: string;
26
+ /**
27
+ * SDK内部的日志模块
28
+ */
29
+ static logger: Logger;
30
+ /**
31
+ * 日志管理器,可以同时获取多个日志实例内容
32
+ */
33
+ static logManager: LogManager;
34
+ /**
35
+ * 创建会议客户端XYRTCClient模,提供实时音视频通话框架能力,一次会议创建一次即可
36
+ * 使用场景:1、创建多人会议客户端;2、实现会中和会外设备设置、会前预览画面等功能
37
+ * 调用时机:初始化SDK时
38
+ *
39
+ * @since 1.0.0
40
+ * @param { IClientConfig } config - XYRTCClient配置参数
41
+ * @param { Logger? } logger - 可选配置 | Logger模块,默认内部会创建,如果是多实例,需要外部通过createLogger创建Logger并传递给XYRTC
42
+ * @returns { XYRTCClient } - 返回 XYRTCClient 实例 XYClient模块
43
+ */
44
+ static createClient(config: IClientConfig, logger?: Logger): XYRTCClient;
45
+ /**
46
+ * 创建自定义日志Logger实例
47
+ * 使用场景:1、SDK内部日志模块;2、会前设置功能、会前预览功能等写入独立日志
48
+ * 调用时机:初始化SDK之前
49
+ * 关联内容:Logger模块
50
+ *
51
+ * @since 4.0.0
52
+ * @param { ILoggerConfig } config - 日志模块配置
53
+ * @returns { Logger } - 日志库
54
+ */
55
+ static createLogger: (config: import("./type/index").ILoggerConfig) => Logger;
56
+ /**
57
+ * 设置Web SDK国际化语言
58
+ * 使用场景:如果项目支持国际化,可在语言变化时,调用此方法
59
+ * 调用时机:任意时刻
60
+ *
61
+ * @param { TLocale } language - 国际化语言
62
+ */
63
+ static setLocale(language: TLocale): void;
64
+ /**
65
+ * 检测浏览器是否支持WebRTC能力
66
+ * 使用场景:会前检查浏览器是否支持WebRTC能力,针对不支持的浏览器限制入会操作
67
+ * 调用时机:初始化SDK之前
68
+ * 关联内容:​​浏览器平台支持
69
+ *
70
+ * @returns { Promise<ICheckSystemRequirements> } - 检测结果
71
+ */
72
+ static checkSupportWebRTC(): Promise<ICheckSystemRequirements>;
73
+ /**
74
+ * 检测浏览器是否支持共享内容能力
75
+ * 使用场景:检查浏览器是否支持共享内容,针对不支持的浏览器限制共享内容操作
76
+ * 调用时机:初始化SDK之前或共享操作之前
77
+ *
78
+ * @returns { boolean } - 是否支持
79
+ */
80
+ static checkSupportShareContent(): Promise<boolean>;
81
+ static render: void;
34
82
  }
35
- declare const XYRTC: XYLinkRTC;
36
- export default XYRTC;
37
- export { Client, Stream, Logger, LogManager, DeviceManager, getLayoutItemState, getVideoInfoByRotation, getLayoutRotateInfo, getSendSupportedCodec, detectLocator };
38
- export * from './type';
83
+ /**
84
+ * 导出 MODULES
85
+ */
86
+ export { XYRTCClient, VideoAudioTrack, ContentTrack, Logger, LogManager, XYDetector };
87
+ /**
88
+ * 导出 TYPE 类型定义
89
+ */
90
+ export * from './type/index';
91
+ /**
92
+ * 导出错误码
93
+ */
39
94
  export { ERROR_CODE } from './enum/errorCode';
40
- export { BrowserDetector };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * XYLink WebRTC SDK Base Lib Interface
3
+ *
4
+ * Created at : 2024-04-22 16:01:57
5
+ * Last modified : 2024-06-20 16:31:51
6
+ */
7
+ export interface XYBaseModule {
8
+ destroy(): void;
9
+ }
@@ -0,0 +1,128 @@
1
+ /**
2
+ * XYLink WebRTC SDK Interface
3
+ *
4
+ * Created at : 2024-04-22 16:01:57
5
+ * Last modified : 2024-07-10 11:34:03
6
+ */
7
+ import VideoAudioTrack from '../main/track/videoAudioTrack';
8
+ import ContentTrack from '../main/track/contentTrack';
9
+ import { AnalyserConfig, IConference, IConfMgmtUrl, ICustomMessageConfig, IFeatureConfig, IFeatureConfigKey, IFeatureConfigValue, IGetConferenceParams, ILoginExtAccount, ILoginWidthAuthCode, IMakeCall, IMode, InviteInfo, IReqInfo, IReturnResult, IRoster, IVideoAudioType, IVideoControlResult, IVideoProfile, Key, LayoutConfig, LayoutOrientationType, LocalViewParams, LoginExtTokenParams, LoginTokenInfo, LoginXYAccountParams, MEETING_DIRECTION, SnapshotParams, SnapshotResult, TCommand, TLocalLanguage, XYCheckNumberParams, XYClientEventKey, XYServerInfo } from '../type/index';
10
+ import { AudioAnalyser } from '../tools/analyser';
11
+ export interface XYClientIF {
12
+ /**
13
+ * 初始化
14
+ */
15
+ on(key: XYClientEventKey | string, listener: Function, total?: number): void;
16
+ setFeatureConfig(config: IFeatureConfig): Promise<IReturnResult>;
17
+ /**
18
+ * 登录
19
+ */
20
+ loginXYlinkAccount(userName: string, password: string): Promise<IReturnResult>;
21
+ loginExternalAccount(params: ILoginExtAccount): Promise<IReturnResult>;
22
+ loginXYAccount(params: LoginXYAccountParams): Promise<IReturnResult>;
23
+ loginExtToken(params: LoginExtTokenParams): Promise<IReturnResult>;
24
+ loginWithAuthCode(params: ILoginWidthAuthCode): Promise<IReturnResult>;
25
+ setLoginTokenInfo(info: LoginTokenInfo): Promise<IReturnResult>;
26
+ /**
27
+ * 呼叫
28
+ */
29
+ makeCall(params: IMakeCall): Promise<IReturnResult>;
30
+ /**
31
+ * 轨道管理
32
+ */
33
+ createVideoAudioTrack(): Promise<VideoAudioTrack>;
34
+ createContentTrack(): Promise<ContentTrack>;
35
+ /**
36
+ * 媒体管理
37
+ */
38
+ getAudioStream(rosterId?: string): MediaStream | null;
39
+ getAudioAnalyser(id?: string, config?: AnalyserConfig): IReturnResult | AudioAnalyser | null;
40
+ getVideoStream(rosterId?: string): MediaStream | null;
41
+ getSnapshot(params: SnapshotParams): Promise<SnapshotResult>;
42
+ muteAudio(): Promise<IVideoAudioType>;
43
+ muteVideo(): Promise<IVideoAudioType>;
44
+ unmuteAudio(): Promise<IVideoAudioType>;
45
+ unmuteVideo(): Promise<IVideoAudioType>;
46
+ publish(track: VideoAudioTrack | ContentTrack): void;
47
+ removeAudioAnalyser(id?: string): void | IReturnResult;
48
+ setTranslationLanguage(language: TLocalLanguage): Promise<IReturnResult>;
49
+ setVideoProfile(direction: MEETING_DIRECTION, profile: IVideoProfile): Promise<void>;
50
+ startTranslation(): Promise<IReturnResult>;
51
+ stopTranslation(): Promise<IReturnResult>;
52
+ subscribeBulkRoster(): Promise<IReturnResult>;
53
+ /**
54
+ * 拉流/布局
55
+ */
56
+ forceFullScreen(id?: string): Promise<string>;
57
+ playAudio(): Promise<void>;
58
+ playLocalVideo(): Promise<void>;
59
+ playVideo(idList?: string[]): Promise<void>;
60
+ requestNewLayout(reqList: IReqInfo[], maxViewCountPerPage: number, pageIndex: number, extReqList?: IReqInfo[], extParams?: {}): Promise<boolean>;
61
+ requestAutoPollingLayout(command: TCommand, interval: number | undefined, reqList: IReqInfo[]): Promise<boolean>;
62
+ removeAudioRender(key: string): void;
63
+ removeVideoRenderer(id: string): void;
64
+ removeSlaveVideoRenderer(rosterId?: string, viewId?: string): void;
65
+ setFocusView(id: string): Promise<string>;
66
+ setPageInfo(currentPage?: number): Promise<IReturnResult>;
67
+ setVideoRenderer(id: string, wrapEleId: string): void;
68
+ setLocalViewParams(params: LocalViewParams): Promise<IReturnResult>;
69
+ setSlaveVideoRenderer(id: string, wrapEleId: string): void;
70
+ setAudioRenderer(streamId: string, ele: HTMLAudioElement): Promise<void>;
71
+ switchLayout(templateMode?: IMode): Promise<IMode>;
72
+ setLayoutConfig(config: LayoutConfig): void;
73
+ setLayoutOrientation(orientation: LayoutOrientationType): Promise<IReturnResult>;
74
+ setHideLocalView(state: boolean): Promise<{
75
+ status: boolean;
76
+ }>;
77
+ updateLayoutSize(): void;
78
+ /**
79
+ * 会议操作/获取信息
80
+ */
81
+ checkMeetingNumber(params: XYCheckNumberParams): Promise<IReturnResult>;
82
+ checkMeetingPassword(params: XYCheckNumberParams): Promise<IReturnResult>;
83
+ getMeetingInviteInfo(): Promise<InviteInfo>;
84
+ getSelfRoster(): IRoster;
85
+ toggleHideId(hideId: number | string): Promise<string>;
86
+ /**
87
+ * 调度
88
+ */
89
+ bindTrackGroup(trackType: 'audio' | 'video', mediagroupId: number): true | IReturnResult;
90
+ getConference(params: IGetConferenceParams): Promise<IConference>;
91
+ setPollingAudioStatus(type: 'mute' | 'unmute', callUriList: string | string[]): Promise<any>;
92
+ startMonitor(uriList?: string[]): void;
93
+ startMonitorGroup(mediagroupIds: Key[]): IReturnResult;
94
+ stopMonitor(uriList?: string[]): void;
95
+ stopMonitorGroup(mediagroupIds: Key[]): IReturnResult;
96
+ /**
97
+ * 录制
98
+ */
99
+ startCloudRecord(): Promise<IReturnResult>;
100
+ stopCloudRecord(): Promise<IReturnResult>;
101
+ /**
102
+ * 会控操作
103
+ */
104
+ endAllMeeting(): Promise<IReturnResult>;
105
+ getConfMgmtUrl(): Promise<IConfMgmtUrl | null>;
106
+ nextPollingPage(): void;
107
+ onHandDown(): Promise<boolean>;
108
+ onHandUp(): Promise<boolean>;
109
+ onMute(): Promise<boolean>;
110
+ rename(newName: string): Promise<IReturnResult | undefined>;
111
+ sendVideoControlResult(type: 'muteVideo' | 'unMuteVideo', data: IVideoControlResult): Promise<IReturnResult>;
112
+ signIn(questionnaireId: string): Promise<IReturnResult>;
113
+ startMeetingFocusView(id: string): Promise<IReturnResult>;
114
+ stopMeetingFocusView(id: string): Promise<IReturnResult>;
115
+ verifyControlPassword(pwd: string): Promise<IReturnResult>;
116
+ /**
117
+ * 挂断会议
118
+ */
119
+ destroy(reason?: string, blockSendSocket?: boolean): Promise<boolean>;
120
+ off(key: string): void;
121
+ /**
122
+ * 其他
123
+ */
124
+ sendCustomMessage(config: ICustomMessageConfig): IReturnResult;
125
+ setServerAddress(serverInfo: XYServerInfo): void;
126
+ switchDebug(status: boolean): Promise<boolean>;
127
+ switchFeatureConfig(key: IFeatureConfigKey, value: IFeatureConfigValue<IFeatureConfigKey>): Promise<IReturnResult>;
128
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * XYLink WebRTC SDK Custom Track Interface
3
+ *
4
+ * Created at : 2024-04-22 16:01:57
5
+ * Last modified : 2024-06-20 16:31:52
6
+ */
7
+ import { ContentTrackConfig, IReturnResult, XYElectronSource } from '../type/index';
8
+ export interface XYContentTrackIF {
9
+ capture(config?: ContentTrackConfig): Promise<IReturnResult>;
10
+ close(): void;
11
+ createElectronContentStream(selectedSourceId: string): Promise<IReturnResult>;
12
+ getElectronContentSources(desktopCapturer: any, types?: any): Promise<XYElectronSource[] | any>;
13
+ pause(): Promise<IReturnResult>;
14
+ resume(): Promise<IReturnResult>;
15
+ }