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

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 (115) hide show
  1. package/README.MD +30 -12
  2. package/lib/action/index.d.ts +57 -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 +43 -5
  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 +65 -28
  17. package/lib/interface/baseModule.type.d.ts +9 -0
  18. package/lib/interface/clientInterface.type.d.ts +83 -0
  19. package/lib/interface/contentTrackInterface.type.d.ts +15 -0
  20. package/lib/interface/event.type.d.ts +316 -0
  21. package/lib/interface/peopleTrackInterface.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 +365 -595
  26. package/lib/main/clientBase.d.ts +38 -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 +120 -0
  31. package/lib/main/layout/index.d.ts +118 -105
  32. package/lib/main/layout/index.type.d.ts +270 -0
  33. package/lib/main/layout/polling.d.ts +212 -0
  34. package/lib/main/layout/state.d.ts +163 -0
  35. package/lib/main/layout/template.d.ts +15 -7
  36. package/lib/main/media/index.d.ts +177 -0
  37. package/lib/main/media/index.type.d.ts +9 -0
  38. package/lib/main/meeting/control.d.ts +107 -0
  39. package/lib/main/meeting/control.type.d.ts +24 -0
  40. package/lib/main/{meeting.d.ts → meeting/index.d.ts} +46 -7
  41. package/lib/main/meeting/verify.d.ts +69 -0
  42. package/lib/main/peer.d.ts +120 -41
  43. package/lib/main/plugin/index.d.ts +28 -0
  44. package/lib/{tools/quality.d.ts → main/quality/index.d.ts} +2 -2
  45. package/lib/{tools → main/quality}/quality.worker.d.ts +1 -1
  46. package/lib/main/{qualityManager.d.ts → quality/report.d.ts} +11 -5
  47. package/lib/main/render/index.d.ts +116 -0
  48. package/lib/main/render/index.type.d.ts +24 -0
  49. package/lib/main/{videoManager.d.ts → render/videoManager.d.ts} +78 -28
  50. package/lib/main/render/videoManager.type.d.ts +66 -0
  51. package/lib/main/roster/index.d.ts +39 -0
  52. package/lib/main/server/index.d.ts +79 -0
  53. package/lib/main/server/index.type.d.ts +21 -0
  54. package/lib/main/signal/index.d.ts +15 -0
  55. package/lib/main/socket/index.d.ts +95 -0
  56. package/lib/main/stream/index.d.ts +182 -0
  57. package/lib/main/track/baseTrack.d.ts +178 -0
  58. package/lib/main/track/contentTrack.d.ts +161 -0
  59. package/lib/main/track/customContentTrack.d.ts +18 -0
  60. package/lib/main/track/customVideoAudioTrack.d.ts +18 -0
  61. package/lib/main/track/helper.d.ts +53 -0
  62. package/lib/main/track/videoAudioCapture.d.ts +90 -0
  63. package/lib/main/track/videoAudioTrack.d.ts +243 -0
  64. package/lib/main/vom/index.d.ts +44 -0
  65. package/lib/main/vom/index.type.d.ts +1 -0
  66. package/lib/tools/analyser.d.ts +30 -7
  67. package/lib/tools/analyserManager.d.ts +55 -0
  68. package/lib/tools/dbManager.d.ts +12 -1
  69. package/lib/tools/{browser.d.ts → detectBrowser/index.d.ts} +53 -5
  70. package/lib/tools/detectStream/index.d.ts +84 -0
  71. package/lib/tools/detectStream/index.type.d.ts +56 -0
  72. package/lib/tools/detectTool/index.d.ts +191 -0
  73. package/lib/tools/detectTool/index.type.d.ts +62 -0
  74. package/lib/tools/emitter.d.ts +27 -6
  75. package/lib/tools/enum.d.ts +1 -1
  76. package/lib/tools/httpClient.d.ts +5 -1
  77. package/lib/tools/i18n.d.ts +1 -1
  78. package/lib/tools/index.d.ts +1 -8
  79. package/lib/tools/log/logger.d.ts +41 -21
  80. package/lib/tools/log/logger.worker.d.ts +1 -1
  81. package/lib/tools/log/loggerManager.d.ts +2 -2
  82. package/lib/tools/pressure/index.d.ts +33 -0
  83. package/lib/tools/pressure/index.type.d.ts +22 -0
  84. package/lib/tools/promiseQueue.d.ts +6 -0
  85. package/lib/tools/regex.d.ts +4 -0
  86. package/lib/tools/snapshot.d.ts +1 -1
  87. package/lib/tools/socket.d.ts +12 -2
  88. package/lib/tools/template/index.d.ts +11 -88
  89. package/lib/tools/template/mobile.d.ts +1 -1
  90. package/lib/tools/template/polling.d.ts +8 -0
  91. package/lib/tools/utils.d.ts +25 -16
  92. package/lib/tools/verify.d.ts +7 -0
  93. package/lib/type/ability.d.ts +1 -1
  94. package/lib/type/analyser.d.ts +26 -1
  95. package/lib/type/auth.d.ts +19 -19
  96. package/lib/type/base.d.ts +27 -31
  97. package/lib/type/capture.d.ts +9 -0
  98. package/lib/type/client.d.ts +178 -333
  99. package/lib/type/index.d.ts +22 -2
  100. package/lib/type/layout.d.ts +81 -45
  101. package/lib/type/logger.d.ts +19 -12
  102. package/lib/type/meeting.d.ts +101 -56
  103. package/lib/type/peer.d.ts +65 -1
  104. package/lib/type/polling.d.ts +194 -0
  105. package/lib/type/quality.d.ts +12 -2
  106. package/lib/type/socket.d.ts +0 -18
  107. package/lib/type/stream.d.ts +42 -24
  108. package/lib/type/track.d.ts +131 -0
  109. package/lib/xyrtc.cjs.js +1 -1
  110. package/lib/xyrtc.umd.js +1 -1
  111. package/package.json +32 -52
  112. package/lib/main/clientImplements.d.ts +0 -99
  113. package/lib/main/helper.d.ts +0 -104
  114. package/lib/main/stream.d.ts +0 -418
  115. package/lib/tools/detect.d.ts +0 -44
@@ -4,145 +4,144 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-23 12:04:44
6
6
  */
7
- import { IClientConfig, ICall, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternals, IVideoAudioType, ShareContentStatus, IStreamConfig, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, ContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage, IFeatureConfig, IConfMgmtUrl, IVideoControlResult, ICustomMessageConfig, OperateType, PushType, FacingMode, IFacingMode, ILoginWidthAuthCode, LoginXYAccountParams, LoginExtTokenParams, IReturnResult, InviteInfo, LayoutOrientationType, AnalyserConfig, IRotationInfoTotalItem, SnapshotParams, IFeatureConfigValue, IFeatureConfigKey, LocalViewParams, SwitchDeviceConfig, AbilityResult, IExportUserInfo, LoginTokenInfo } from '../type';
8
- import Emitter from '../tools/emitter';
9
- import Socket from '../tools/socket';
7
+ import { IClientConfig, ICall, IMackCall, IInvite, IRoster, ILoginExtAccount, IVideoAudioType, IPushType, IMode, IReqInfo, TCommand, ContentMode, Key, IRecordPermission, TLocalLanguage, IFeatureConfig, IConfMgmtUrl, IVideoControlResult, ICustomMessageConfig, OperateType, PushType, FacingMode, ILoginWidthAuthCode, LoginXYAccountParams, LoginExtTokenParams, IReturnResult, InviteInfo, LayoutOrientationType, AnalyserConfig, SnapshotParams, IFeatureConfigValue, IFeatureConfigKey, MEETING_DIRECTION, LocalViewParams, AbilityResult, IExportUserInfo, IVideoProfile, ReconnectEntry, LoginTokenInfo, LayoutConfig, IStateParams, IScreenInfo, IInternals, XYClientIF, IGetConferenceParams } from '../type/index';
8
+ import Peer from './peer';
10
9
  import Stream from './stream';
11
10
  import Logger from '../tools/log/logger';
12
- import DeviceManager from './deviceManager';
13
11
  import LayoutManager from './layout';
14
- import { Speaker } from '../feature/index';
15
- import Action from '../action';
16
- import Auth from './auth';
17
- export default class Client extends Emitter {
12
+ import Meeting from './meeting';
13
+ import VideoAudioTrack from './track/videoAudioTrack';
14
+ import ContentTrack from './track/contentTrack';
15
+ import Action from '../action/index';
16
+ import Auth from './auth/index';
17
+ import { XYRTCClientBase } from './clientBase';
18
+ import XYClientState from './clientState';
19
+ import { VOM } from './vom';
20
+ import { XYPlugin } from './plugin';
21
+ import { XYMeetingControl } from './meeting/control';
22
+ import { XYRender } from './render';
23
+ import { XYSocketManager } from './socket';
24
+ import { XYMediaManager } from './media';
25
+ import { XYSignal } from './signal';
26
+ import ServerManager from './server';
27
+ import { XYServerInfo } from './server/index.type';
28
+ import { XYEDU } from '../feature/edu';
29
+ import RosterManager from './roster';
30
+ import { XYDevicePressure } from '../tools/pressure';
31
+ export default class XYRTCClient extends XYRTCClientBase implements XYClientIF {
18
32
  logger: Logger;
19
- action: Action;
20
- auth: Auth;
21
- socketTask: Socket | undefined;
33
+ private action;
34
+ private layoutManager;
35
+ private rosterManager;
36
+ private serverManager;
37
+ private auth;
38
+ private stream;
39
+ protected clientState: XYClientState;
40
+ private meeting;
41
+ private verify;
22
42
  invite: IInvite;
23
- rosters: IRoster[];
24
- layoutRosters: {
25
- content: ILayoutRoster[];
26
- people: ILayoutRoster[];
27
- total: ILayoutRoster[];
28
- };
29
43
  disconnected: boolean;
30
- activeSpeaker: ISpeakerInfo;
31
- layoutManager: LayoutManager | null;
32
44
  pushType: IPushType;
33
- isAutoBandwidth: boolean;
34
45
  debug: boolean;
35
- shareContentStatus: ShareContentStatus;
36
- deviceManager: DeviceManager | null;
37
46
  config: IClientConfig;
38
- speaker: Speaker | null;
39
47
  private autoMode;
40
- private token;
41
48
  private peer;
42
49
  private callInfo;
43
- private stream;
44
- private videoTrackList;
45
- private audioTrackList;
46
- private cacheMeetingControlMessage;
47
- private rotationInfo;
48
50
  private clientStatus;
49
51
  private peerConnectionStatus;
50
- private customLayoutSeq;
51
- private contentSenderPid;
52
- private shareContentTimer;
53
- private streamChange;
54
- private streamChangeList;
55
- private seq;
56
- private onhold;
57
- private autoSwitchDevice;
58
- private audioManagers;
59
- private errorcode;
60
- private i18nCode;
61
- private clientErrorState;
62
- private customLayoutCacheList;
63
52
  private contentMode;
64
- private contentOnholdInfo;
65
53
  private isSubscribeBulkRoster;
66
- private recordState;
67
- private qualityManager;
68
- private isShareContent;
54
+ private qualityReport;
69
55
  private isSubscribeTranslation;
70
- private handStatus;
71
56
  private featureConfig;
72
- private meeting;
73
57
  private operateQueue;
74
58
  private facingMode;
75
- private wsReConnectCount;
76
- private clientImplements;
77
59
  private audioStatus;
78
60
  private videoStatus;
79
61
  private ability;
80
62
  private makeCallParams;
63
+ private resize;
64
+ private reconnectEntry;
65
+ protected vom: VOM;
66
+ protected plugin: XYPlugin | null;
67
+ protected render: XYRender;
68
+ protected meetingControl: XYMeetingControl;
69
+ protected socketManager: XYSocketManager;
70
+ protected mediaManager: XYMediaManager;
71
+ protected edu: XYEDU;
72
+ protected signal: XYSignal;
73
+ protected devicePressure?: XYDevicePressure;
81
74
  private onDocumentChange;
82
75
  constructor(config: IClientConfig, logger: Logger);
83
- static instance: Client;
84
- static getClientInstance(config: IClientConfig, logger: Logger): Client;
85
- static getCustomLayoutItem(item: ILayout, resolution: number, quality: number): {
86
- pid: number;
87
- resolution: number;
88
- quality: number;
89
- mediagroupid: number;
90
- };
91
- getLoginInfo(): import("../type").ILoginInfo;
76
+ static instance: XYRTCClient;
77
+ static getClientInstance(config: IClientConfig, logger: Logger): XYRTCClient;
78
+ getLoginInfo(): import("../type/index").ILoginInfo;
92
79
  getFeatureConfig(): IFeatureConfig;
93
80
  getCallInfo(): ICall;
94
81
  getClientConfig(): IClientConfig;
95
82
  getAutoMode(): boolean;
96
- getVideoManagers(): import("../type").IVideoRenders | undefined;
97
- getPreviewStreams(): import("../type").IGetMediaStreams | {
98
- previewStreams: never[];
99
- };
100
- getAudioStreamConfig(): IStreamConfig | undefined;
101
- getStreamInstance(): Stream | null;
102
- getVideoTrackList(): ICustomStreamTrack[];
103
- getLayoutRosters(): {
104
- content: ILayoutRoster[];
105
- people: ILayoutRoster[];
106
- total: ILayoutRoster[];
107
- };
108
- getOriginRosters(): IRoster[];
83
+ getVideoManagerMap(): import("../type/index").XYVideoRendererMap;
84
+ getAudioManagers(): import("../type/index").IAudioRenders;
85
+ getPreviewStreams(): import("../type/index").IGetMediaStreams;
86
+ getAudioStreamConfig(): import("../type/index").IStreamConfig | undefined;
87
+ getStreamInstance(): Stream;
109
88
  getInviteInfo(): IInvite;
110
- getContentSenderPid(): number;
111
- getActiveSpeaker(): ISpeakerInfo;
112
89
  getLocalHide(): boolean | undefined;
113
- getRotationInfo(): IRotationInfoTotalItem[];
114
90
  getPeerConnectionStatus(): boolean;
115
- getOnHold(): boolean;
116
- getAudioTrackList(): ICustomStreamTrack[];
117
91
  getAudioStatus(): OperateType;
118
- getDeviceManager(): DeviceManager | null;
92
+ getVideoStatus(): OperateType;
119
93
  getMakeCallParams(): IMackCall;
94
+ getLayoutManager(): LayoutManager;
95
+ getRosterManager(): RosterManager;
96
+ getAnalyserManager(): import("../tools/analyserManager").default;
120
97
  getUserInfo(): IExportUserInfo | null;
98
+ getVOM(): VOM;
99
+ getErrorCode(): import("../type/index").ICodeList;
100
+ getI18nCode(): import("../type/index").ICodeList;
101
+ getAuthManager(): Auth;
102
+ getAction(): Action;
103
+ getRender(): XYRender;
104
+ getServerManager(): ServerManager;
105
+ getDisconnected(): boolean;
106
+ getClientStatus(): boolean;
107
+ getSocketManager(): XYSocketManager;
108
+ getMediaManager(): XYMediaManager;
109
+ getMeeting(): Meeting;
110
+ getPeer(): Peer | null;
111
+ getClientState(): XYClientState;
112
+ getMeetingControl(): XYMeetingControl;
121
113
  /**
122
- * 将Stream实例绑定到Client模块上,方便互相调用
114
+ * 获取缓存的媒体网关下发speakers消息内容
123
115
  *
124
- * @param { Stream } stream - Stream实例模块
116
+ * @returns { SpeakersInfoObj[] } - speakers消息内容
125
117
  */
126
- bindStreamInstance(stream: Stream): void;
118
+ getRemoteSpeakerList(): import("../type/index").SpeakersInfoItem[];
127
119
  /**
128
120
  * 获取缓存的媒体网关下发speakers消息内容
129
121
  *
130
122
  * @returns { SpeakersInfoObj[] } - speakers消息内容
131
123
  */
132
- getRemoteSpeakerList(): import("../type").SpeakersInfoObj[];
124
+ getRemoteSpeakerMap(): {
125
+ [key: string]: import("../type/index").SpeakersInfoItem;
126
+ };
133
127
  getLayoutMap(): Map<any, any>;
134
128
  /**
135
129
  * 获取Local roster信息
136
130
  *
137
131
  * @returns { IRoster}
138
132
  */
139
- getSelfRoster(): IRoster | undefined;
133
+ getSelfRoster(): IRoster;
140
134
  /**
141
135
  * 获取本地是否在分享content
142
136
  *
143
137
  * @returns { boolean }
144
138
  */
145
- getLocalShareContent(): boolean;
139
+ getLocalShareContent(): boolean | undefined;
140
+ /**
141
+ * 获取摄像头方向
142
+ *
143
+ * @returns { FacingMode } - 摄像头方向
144
+ */
146
145
  getFacingMode(): FacingMode;
147
146
  /**
148
147
  * 获取ws重连次数
@@ -151,36 +150,79 @@ export default class Client extends Emitter {
151
150
  /**
152
151
  * 获取Layout头像配置类型
153
152
  */
154
- getLayoutAvatarType(): import("../type").LayoutAvatarType;
153
+ getLayoutAvatarType(): import("../type/index").LayoutAvatarType;
155
154
  /**
156
155
  * 企业媒体相关配置信息
157
156
  *
158
157
  * @returns { IMediaConfig }
159
158
  */
160
- getEnterpriseMediaConfig(): import("../type").IMediaConfig;
159
+ getEnterpriseMediaConfig(): import("../type/index").IMediaConfig;
160
+ /**
161
+ * 会控消息
162
+ */
163
+ getMeetingControlInfo(): import("../type/index").IMeetingControl | null;
164
+ /**
165
+ * 设置呼叫的会议室信息
166
+ *
167
+ * @param { ICall } callInfo - 呼叫的会议信息
168
+ */
169
+ setCallInfo(callInfo: ICall): void;
170
+ /**
171
+ * 获取所有已注册的插件
172
+ */
173
+ getPlugin(): any[];
174
+ /**
175
+ * 设置服务器地址
176
+ *
177
+ * @param { XYServerInfo } serverInfo - 服务器地址配置,格式:IP/域名 + 端口(可选),如: cloudapi.xylink.com
178
+ * @property { string } httpServer - 可选,rest服务器地址
179
+ * @property { string } wssServer - 可选,websocket服务器地址
180
+ * @property { string } logServer - 可选,日志服务器地址
181
+ */
182
+ setServerAddress(serverInfo: XYServerInfo): void;
183
+ /**
184
+ * 创建摄像头和麦克风Track模块
185
+ */
186
+ createVideoAudioTrack(): Promise<VideoAudioTrack>;
187
+ /**
188
+ * 创建分享内容Track模块
189
+ */
190
+ createContentTrack(): Promise<ContentTrack>;
161
191
  /**
162
192
  * 获取视频的Stream数据
163
193
  *
164
194
  * @param { string } rosterId - 用户id,通过layout事件列表获取,没有则获取自己的视频流
165
195
  * @return { MediaStream || null } - 获取到的Stream
166
196
  */
167
- getVideoStream(rosterId?: string): MediaStream | IReturnResult | null;
197
+ getVideoStream(rosterId?: string): MediaStream | null;
168
198
  /**
169
199
  * 获取音频的Stream数据
170
200
  *
171
201
  * @param { string } rosterId - 用户id,通过layout事件列表获取,没有则获取自己的音频流
172
202
  * @return { MediaStream || null } - 获取到的Stream
173
203
  */
174
- getAudioStream(rosterId?: string): MediaStream | IReturnResult | null;
204
+ getAudioStream(rosterId?: string): MediaStream | null;
175
205
  /**
176
206
  * 获取音频分析器,用于获取音频的音量大小
207
+ * 获取到分析器后,可以调用 getAudioLevel() 方法获取实时音量大小
177
208
  *
178
- * @public
179
- * @param { string } rosterId - 用户id,通过layout事件列表获取
209
+ * @param { string } id - 参会者Layout Id或rosterKey,通过layout或roster相关事件列表获取
180
210
  * @param { AnalyserConfig } config - Analyser分析器构造器配置
181
211
  * @return { AudioAnalyser || null } - Analyser分析器
182
212
  */
183
- getAudioAnalyser(rosterId?: string, config?: AnalyserConfig): IReturnResult | import("../tools/analyser").AudioAnalyser | null;
213
+ getAudioAnalyser(id?: string, config?: AnalyserConfig): IReturnResult | import("..").AudioAnalyser | null;
214
+ /**
215
+ * 销毁音频分析器,释放资源
216
+ *
217
+ * @param { string } id - 参会者Layout Id或rosterKey,通过layout或roster相关事件列表获取
218
+ */
219
+ removeAudioAnalyser(id?: string): void | IReturnResult;
220
+ /**
221
+ * 注册Web AI插件
222
+ *
223
+ * @param { Array } plugins - 插件列表
224
+ */
225
+ registerPlugins(plugins: any[]): IReturnResult | Promise<IReturnResult>;
184
226
  /**
185
227
  * 切换布局方向
186
228
  *
@@ -189,108 +231,110 @@ export default class Client extends Emitter {
189
231
  */
190
232
  setLayoutOrientation(orientation: LayoutOrientationType): Promise<IReturnResult>;
191
233
  /**
192
- * 设置本地是否在等候室
193
- *
194
- * @param { boolean } onhold
195
- */
196
- setOnHold(onhold: boolean): void;
197
- /**
198
- * 小鱼账号初始登录,获取token方法
234
+ * 小鱼易连账号登录
199
235
  *
200
236
  * @deprecated 已废弃 但不影响老客户调用,建议使用新登录方式:loginXYAccount
201
- * @public
202
- * @param { string } userName 小鱼用户账号
203
- * @param { string } password 小鱼用户账号密码
204
- * @returns { Promise<IReturnResult> } 登录结果
237
+ * @param { string } userName - 必填,小鱼用户账号
238
+ * @param { string } password - 必填,小鱼用户账号密码
239
+ * @returns { Promise<IReturnResult> } - 登录结果
205
240
  */
206
241
  loginXYlinkAccount(userName: string, password: string): Promise<IReturnResult>;
207
242
  /**
208
243
  * 第三方账号登录
209
244
  *
210
- * @public
211
- * @param { ILoginExtAccount } params 参数
212
- * @param { string } params.displayName 用户名称
213
- * @param { string } params.extId 企业ID
214
- * @param { string } params.extUserId 三方用户ID
215
- * @param { string } params.authCode 授权码 v3.8.2新增
216
- * @param { string } params.tempUser 是否是临时账号 v3.8.2新增
217
- * @return { Promise<IReturnResult> } 登录结果
245
+ * @param { ILoginExtAccount } params - 参数
246
+ * @param { string } params.displayName - 必填,用户名称
247
+ * @param { string } params.extId - 必填,企业ID
248
+ * @param { string } params.extUserId - 可选,三方用户ID
249
+ * @param { string } params.authCode - 可选,授权码 v3.8.2新增
250
+ * @param { string } params.tempUser - 可选,是否是临时账号 v3.8.2新增
251
+ * @return { Promise<IReturnResult> } - 登录结果
218
252
  */
219
253
  loginExternalAccount(params: ILoginExtAccount): Promise<IReturnResult>;
220
254
  /**
221
255
  * 三方账号统一认证登录 - 小鱼账号登录
222
256
  *
223
257
  * @param { LoginXYAccountParams } params 参数
224
- * @param { string } params.account 用户账号
225
- * @param { string } params.password 用户密码
226
- * @param { string } params.countryCode 国家码:默认+86
227
- * @param { string } params.extId 企业ID
258
+ * @param { string } params.account - 必填,用户账号
259
+ * @param { string } params.password - 必填,用户密码
260
+ * @param { string } params.extId - 必填,企业ID
261
+ * @param { string } params.countryCode - 可选,国家码:默认+86
228
262
  * @return { Promise<IReturnResult> } 登录结果
229
263
  */
230
264
  loginXYAccount(params: LoginXYAccountParams): Promise<IReturnResult>;
231
265
  /**
232
- * 三方账号统一认证登录 - token登录
266
+ * 三方账号统一认证登录 - Token登录
233
267
  *
234
- * @param { LoginExtTokenParams } params 参数
235
- * @param { string } params.authCode 登录码
236
- * @param { string? } params.extId 企业ID
237
- * @return { Promise<IReturnResult> } 登录结果
268
+ * @param { LoginExtTokenParams } params - 参数
269
+ * @param { string } params.authCode - 必填,登录码
270
+ * @param { string? } params.extId - 必填,企业ID
271
+ * @return { Promise<IReturnResult> } - 登录结果
238
272
  */
239
273
  loginExtToken(params: LoginExtTokenParams): Promise<IReturnResult>;
240
274
  /**
241
- * 建行授权码登录
275
+ * 授权码登录
242
276
  *
243
- * @public
244
277
  * @param { ILoginWidthAuthCode } params 参数
245
- * @param { string } params.extId 企业id
246
- * @param { string } params.extUserId 用户id
247
- * @param { string } params.displayName 用户名称
248
- * @param { string } params.oauthCode 授权码
249
- * @param { boolean } params.isTempUser 是否临时账户
250
- * @param { string } params.channelId 渠道id
278
+ * @param { string } params.extId - 必填,企业id
279
+ * @param { string } params.extUserId - 必填,用户id
280
+ * @param { string } params.displayName - 必填,用户名称
281
+ * @param { string } params.oauthCode - 必填,授权码
282
+ * @param { string } params.channelId - 必填,渠道id
283
+ * @param { boolean } params.isTempUser - 可选,是否临时账户
251
284
  * @return { Promise<IReturnResult> } 登录结果
252
285
  */
253
286
  loginWithAuthCode(params: ILoginWidthAuthCode): Promise<IReturnResult>;
254
287
  /**
255
288
  * 退会时 重置初始化参数
256
- *
257
289
  */
258
290
  resetInitParameter(): void;
291
+ /**
292
+ * 设置分享content类型
293
+ *
294
+ * @param { ContentMode } mode - 分享content类型
295
+ */
259
296
  setContentMode(mode: ContentMode): void;
260
297
  /**
261
298
  * SDK功能控制开关,支持增量设置
262
299
  *
263
- * @public
264
- * @param { IFeatureConfig } config 功能配置项
265
- * @property { boolean } config.enableMeetingShout 是否启用会控喊话场景,会控喊话场景需要指定mediaGroupId分组通道信息才可以正常接收远端声音;
266
- * @property { boolean } config.enableV2States 是否启用小鱼数据上报功能,默认启用,设置为true,支持会中动态切换;
267
- * @property { boolean } config.enableCheckRecordPermission 是否启用录制权限查询功能,默认不启用,设置为false;
268
- * @property { boolean } config.enableBandwidthSetting 是否启用管理平台带宽控制(双向),默认不启用,设置为false;
269
- * @property { boolean } config.enableMeetingInvite 是否启用查询小鱼会议邀请链接信息,默认不启用,设置为false;
270
- * @property { boolean } config.enableMeetingOwner 是否启用查询会议Owner信息,默认不启用,设置为false;
271
- * @property { boolean } config.enableAutoResizeLayout 是否启用自动布局下,当屏幕大小变化后计算最新的Layout数据,默认启用,设置为true;
272
- * @property { boolean } config.enableLowResolution 是否启用低性能模式,降低发送和接收端的分辨率和质量,默认不启用,设置为false,支持会中动态切换;
273
- * @property { boolean } config.enableSpeakerInfo 是否启用推送实时讲话人信息,每秒2条消息推送,默认不启用,设置为false;
274
- * @property { boolean } config.enableLayoutAvatar 是否启用获取参会者头像,默认不启用,设置为false;
275
- * @property { boolean } config.enableMobileNotAuth 是否启用移动端无授权入会,默认不启用,设置为false;此配置已经废弃,移动端已支持动态授权功能;
276
- * @property { boolean } config.enableWatermarkContent 是否启用获取content水印内容, 默认启用, 设置为true
277
- * @property { boolean } config.enableHideLocalView 是否启用隐藏本地画面模式,默认不启用,设置为false
300
+ * @param { IFeatureConfig } config - 功能配置项
301
+ * @property { boolean } config.enableMeetingShout - 是否启用会控喊话场景,会控喊话场景需要指定mediaGroupId分组通道信息才可以正常接收远端声音;
302
+ * @property { boolean } config.enableV2States - 是否启用小鱼数据上报功能,默认启用,设置为true,支持会中动态切换;
303
+ * @property { boolean } config.enableCheckRecordPermission - 是否启用录制权限查询功能,默认不启用,设置为false;
304
+ * @property { boolean } config.enableBandwidthSetting - 是否启用管理平台带宽控制(双向),默认不启用,设置为false;
305
+ * @property { boolean } config.enableMeetingInvite - 是否启用查询小鱼会议邀请链接信息,默认不启用,设置为false;
306
+ * @property { boolean } config.enableMeetingOwner - 是否启用查询会议Owner信息,默认不启用,设置为false;
307
+ * @property { boolean } config.enableAutoResizeLayout - 是否启用自动布局下,当屏幕大小变化后计算最新的Layout数据,默认启用,设置为true;
308
+ * @property { boolean } config.enableLowResolution - 是否启用低性能模式,降低发送和接收端的分辨率和质量,默认不启用,设置为false,支持会中动态切换;
309
+ * @property { boolean } config.enableSpeakerInfo - 是否启用推送实时讲话人信息,每秒2条消息推送,默认不启用,设置为false;
310
+ * @property { boolean } config.enableLayoutAvatar - 是否启用获取参会者头像,默认不启用,设置为false;
311
+ * @property { boolean } config.enableMobileNotAuth - 是否启用移动端无授权入会,默认不启用,设置为false;此配置已经废弃,移动端已支持动态授权功能;
312
+ * @property { boolean } config.enableWatermarkContent - 是否启用获取content水印内容, 默认启用, 设置为true
313
+ * @property { boolean } config.enableHideLocalView - 是否启用隐藏本地画面模式,默认不启用,设置为false
278
314
  * @returns { IReturnResult }
279
315
  */
280
- setFeatureConfig(config: IFeatureConfig): Promise<IReturnResult | undefined>;
316
+ setFeatureConfig(config: IFeatureConfig): Promise<IReturnResult>;
281
317
  /**
282
318
  * 动态切换功能开关
283
319
  *
284
320
  * @param { IFeatureConfigKey } key - 功能的Key值
285
321
  * @param { IFeatureConfigValue<IFeatureConfigKey> } value - 设置的值
286
322
  */
287
- switchFeatureConfig(key: IFeatureConfigKey, value: IFeatureConfigValue<IFeatureConfigKey>): Promise<IReturnResult | undefined>;
323
+ switchFeatureConfig(key: IFeatureConfigKey, value: IFeatureConfigValue<IFeatureConfigKey>): Promise<IReturnResult>;
288
324
  /**
289
325
  * Feature变动后,统一处理逻辑
290
326
  *
291
327
  * @param { IFeatureConfigKey } key - Feature Config Key
292
328
  */
293
329
  private processFeatureConfig;
330
+ /**
331
+ * 设置视频的分辨率和帧率
332
+ *
333
+ * @param { MEETING_DIRECTION } direction - 会议方向
334
+ * @param { IVideoProfile } profile - 视频配置
335
+ * @returns { Promise<void> }
336
+ */
337
+ setVideoProfile(direction: MEETING_DIRECTION, profile: IVideoProfile): Promise<void>;
294
338
  /**
295
339
  * 动态切换上行模式的低性能功能
296
340
  */
@@ -300,7 +344,20 @@ export default class Client extends Emitter {
300
344
  */
301
345
  processDownlinkLowPerformance(): void;
302
346
  /**
303
- * 获取会控地址
347
+ * 处理wss返回的数据
348
+ *
349
+ * @param { any } data - Socket消息数据结构
350
+ * @param { any } resolve - MakeCall Resolve函数
351
+ */
352
+ handleSocketMessage(data: any, resolve: any): void;
353
+ /**
354
+ * 处理媒体消息
355
+ *
356
+ * @param { object } data - 媒体消息
357
+ */
358
+ private onPassThroughMessage;
359
+ /**
360
+ * 获取当前会议会控地址
304
361
  */
305
362
  getConfMgmtUrl(): Promise<IConfMgmtUrl | null>;
306
363
  /**
@@ -313,35 +370,26 @@ export default class Client extends Emitter {
313
370
  status: boolean;
314
371
  }>;
315
372
  /**
316
- * 隐身入会, 可调用此方法进行互动
373
+ * 设置画面渲染元素并播放Video画面
317
374
  *
318
- * @param { string | number } hideId - 隐身ID
319
- * @returns { Promise<boolean> } 是否隐身
320
- */
321
- toggleHideId(hideId: number | string): Promise<string>;
322
- /**
323
- * 绑定streamId和video ele元素,内部维护状态
324
- *
325
- * @public
326
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
327
- * @param { string } viewId 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
375
+ * @param { string } id - 参会者Layout Id
376
+ * @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
328
377
  */
329
- setVideoRenderer(rosterId: string, viewId: string): void;
378
+ setVideoRenderer(id: string, wrapEleId: string): void;
330
379
  /**
331
380
  * 指定Element渲染Video,支持多次渲染画面
332
381
  * 注意:当key所对应的状态发生变化后,需要重新调用此方法重新播放画面
333
382
  *
334
- * @public
335
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
336
- * @param { string } viewId 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
383
+ * @param { string } id - 参会者Layout Id
384
+ * @param { string } wrapEleId 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
337
385
  */
338
- setSlaveVideoRenderer(rosterId: string, viewId: string): void;
386
+ setSlaveVideoRenderer(id: string, wrapEleId: string): void;
339
387
  /**
340
388
  * 移除绑定的streamId
341
389
  *
342
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
390
+ * @param { string } id - 参会者Layout Id
343
391
  */
344
- removeVideoRender(rosterId: string): void;
392
+ removeVideoRenderer(id: string): void;
345
393
  /**
346
394
  * 移除绑定副屏Video渲染
347
395
  * 如果rosterId和viewId没有填写,则清空所有的Slave配置数据
@@ -351,73 +399,67 @@ export default class Client extends Emitter {
351
399
  */
352
400
  removeSlaveVideoRenderer(rosterId?: string, viewId?: string): void;
353
401
  /**
354
- * 重新播放视频
355
- *
356
- * @public
357
- * @param { string[] ? } rosterIdList - 指定重新播放的参会者ID,由roster中的id得到
402
+ * 播放本地视频
358
403
  */
359
- playVideo(rosterIdList?: string[]): Promise<boolean>;
404
+ playLocalVideo(): Promise<void>;
360
405
  /**
361
- * 重新播放音频
406
+ * 重新播放Video画面组件
407
+ *
408
+ * @param { string[]? } idList - Layout Id 列表
362
409
  */
363
- playAudio(): Promise<boolean>;
410
+ playVideo(idList?: string[]): Promise<void>;
364
411
  /**
365
- * 设置相机方向
366
- *
367
- * @param { IFacingMode } position 相机方向
368
- * @returns { Promise<IFacingMode> } 最终切换的相机方向
412
+ * 重新播放音频
369
413
  */
370
- switchCamera(facingMode?: IFacingMode): Promise<IFacingMode>;
414
+ playAudio(): Promise<void>;
371
415
  /**
372
416
  * 提供Audio元素信息,用于播放音频流
373
417
  *
374
- * @public
375
418
  * @param { string } streamId - mediaStream流ID
376
419
  * @param { HTMLAudioElement } ele - audio元素
377
420
  */
378
421
  setAudioRenderer(streamId: string, ele: HTMLAudioElement): Promise<void>;
379
422
  /**
380
- * 是否执行自动切换设备操作
423
+ * 移除对应的AudioRender
381
424
  *
382
- * @public
383
- * @param { boolean } status - 是否自动切换设备
425
+ * @param { string } id - MediaStream的Id字段
384
426
  */
385
- switchAutoDevice(status?: boolean): Promise<boolean>;
427
+ removeAudioRender(key: string): void;
386
428
  /**
387
429
  * 指定画面屏幕截图
388
430
  *
389
431
  * @param { SnapshotParams } params - 参数
390
- * @property { string } params.rosterId - 用户id,通过layout事件列表获取
432
+ * @property { string } params.id - 参会者Layout Id,通过layout事件列表获取
391
433
  * @property { string } params.imageType - 图片格式, 默认'image/png'
392
434
  * @property { number } params.compressLevel - 图片质量,0-1
393
435
  *
394
436
  * @returns { Promise<SnapshotResult> } - 截图信息
395
437
  */
396
- getSnapshot(params: SnapshotParams): Promise<import("../type").SnapshotResult>;
438
+ getSnapshot(params: SnapshotParams): Promise<import("../type/index").SnapshotResult>;
397
439
  /**
398
440
  * 设置本地视频渲染参数
399
441
  *
400
442
  * @param { LocalViewParams } params - 本地视频渲染参数
401
443
  * @property { boolean } params.isMirror - 是否镜像展示
402
444
  */
403
- setLocalViewParams(params: LocalViewParams): Promise<IReturnResult | undefined>;
404
- /**
405
- * 获取Server配置地址
406
- */
407
- private getServerInfo;
445
+ setLocalViewParams(params: LocalViewParams): Promise<IReturnResult>;
408
446
  /**
409
- * 设置action信息
447
+ * 设置布局相关配置
448
+ *
449
+ * @param { LayoutConfig } config - 配置参数
450
+ * @property { boolean? } config.isForceSharedLayout - 本地共享布局是否强制宫格布局,默认强制,设置为true;
451
+ * @property { number? } config.localSharedMaxViewCount - 本地共享时显示的最大画面数量,默认4画面,最大8画面
410
452
  */
411
- private setActionInfo;
453
+ setLayoutConfig(config: LayoutConfig): void;
412
454
  /**
413
455
  * 功能操作上报记录
414
456
  *
415
- * @private
416
- * @param { TCategory } category - 事件类别
417
- * @param { TEventName } eventName - 事件名称
418
- * @param { Objet } params - 事件详细数据
457
+ * @param { IStateParams | IStateParams[] } states
458
+ * @property { TCategory } category - 事件类别
459
+ * @property { TEventName } eventName - 事件名称
460
+ * @property { Objet } params - 事件详细数据
419
461
  */
420
- private sendV2States;
462
+ sendV2States(states: IStateParams | IStateParams[]): void;
421
463
  /**
422
464
  * 切换布局
423
465
  *
@@ -426,49 +468,46 @@ export default class Client extends Emitter {
426
468
  */
427
469
  switchLayout(templateMode?: IMode): Promise<IMode>;
428
470
  /**
429
- * 切换主画面
471
+ * 设置焦点画面
430
472
  *
431
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
432
- * @returns { Promise<string> } - rosterId
473
+ * @param { string } id - 指定切换到焦点画面的Layout Id
474
+ * @returns { Promise<IReturnResult> } - 结果
433
475
  */
434
- setFocusView(rosterId: string): Promise<string>;
476
+ startMeetingFocusView(id: string): Promise<IReturnResult>;
435
477
  /**
436
- * AUTO布局 分页
478
+ * 取消焦点画面
437
479
  *
438
- * @public
439
- * @param { number } currentPage 请求某一页数据
480
+ * @param { string } id - 取消指定终端为焦点画面的Layout Id
481
+ * @returns { Promise<IReturnResult> } - 结果
440
482
  */
441
- setPageInfo(currentPage?: number): Promise<never> | undefined;
483
+ stopMeetingFocusView(id: string): Promise<IReturnResult>;
442
484
  /**
443
- * 检查并获取会议室录制权限
485
+ * 本地切换主画面
444
486
  *
445
- * @public
446
- * @return { IRecordPermission } 录制权限
487
+ * @param { string } id - 主画面的Layout Id
488
+ * @returns { Promise<string> } - Roster Id
447
489
  */
448
- checkPermissionWithMeetingNumber(): Promise<IRecordPermission>;
490
+ setFocusView(id: string): Promise<string>;
449
491
  /**
450
- * 录制存储空间检查
451
- * 默认情况下业务层不需要主动调用,信令层面会下发可用空间,通过监听:recording-state-changed 获取
492
+ * AUTO布局 分页
452
493
  *
453
- * @param { string } recordingUrl
454
- * @return { IRecordPermission } 录制权限
494
+ * @param { number } currentPage - 请求某一页数据
455
495
  */
456
- checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<IRecordPermission>;
496
+ setPageInfo(currentPage?: number): Promise<IReturnResult>;
457
497
  /**
458
- * 处理wss返回的数据
498
+ * 检查并获取会议室录制权限
459
499
  *
460
- * @public
461
- * @param { any } data
462
- * @param { any } resolve
500
+ * @return { IRecordPermission } - 录制权限
463
501
  */
464
- handleSocketMessage(data: any, resolve: any): void;
502
+ checkPermissionWithMeetingNumber(): Promise<IRecordPermission>;
465
503
  /**
466
- * 处理会控上报开启/关闭摄像头事件
504
+ * 录制存储空间检查
505
+ * 默认情况下业务层不需要主动调用,信令层面会下发可用空间,通过监听:recording-state-changed 获取
467
506
  *
468
- * @private
469
- * @param { Object } data 远端数据
507
+ * @param { string } recordingUrl - 录制地址
508
+ * @return { IRecordPermission } - 录制权限
470
509
  */
471
- private onEPMessage;
510
+ checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<IRecordPermission>;
472
511
  /**
473
512
  * 通知会控打开/关闭摄像头结果
474
513
  *
@@ -477,27 +516,6 @@ export default class Client extends Emitter {
477
516
  * @returns { Promise<IReturnResult | null> }
478
517
  */
479
518
  sendVideoControlResult(type: 'muteVideo' | 'unMuteVideo', data: IVideoControlResult): Promise<IReturnResult>;
480
- /**
481
- * 处理远端录制状态上报
482
- *
483
- * @private
484
- * @param { IRecordStatusNotification } data
485
- */
486
- private onRecordStatusNotifyMessage;
487
- /**
488
- * 处理本地录制结果上报Message
489
- *
490
- * @private
491
- * @param { IRecordingStateChanged } data
492
- */
493
- private onRecordingStateChangedMessage;
494
- /**
495
- * 处理Content状态控制消息
496
- *
497
- * @private
498
- * @param { Object } data
499
- */
500
- private onDualStreamMessage;
501
519
  /**
502
520
  * 处理呼叫异常消息
503
521
  *
@@ -513,11 +531,11 @@ export default class Client extends Emitter {
513
531
  */
514
532
  private onDisConnectedMessage;
515
533
  /**
516
- * 处理媒体迁会消息
534
+ * 重新连接PeerConnection连接
517
535
  *
518
- * @private
536
+ * 重连场景:媒体迁会 | Peer连接异常
519
537
  */
520
- private onMediaChangedMessage;
538
+ onMediaChangedMessage(entry?: ReconnectEntry): void;
521
539
  /**
522
540
  * 处理CallIndex消息
523
541
  *
@@ -537,334 +555,200 @@ export default class Client extends Emitter {
537
555
  * @private
538
556
  */
539
557
  private setLocalRosterStatus;
540
- /**
541
- * 处理调度状态消息,解析错误码并返回
542
- *
543
- * @private
544
- * @param { IMonitorReportMessage } data 媒体调度消息
545
- */
546
- private onMonitorReportMessage;
547
558
  /**
548
559
  * 无登录模式调用,需要在调用makeCall前配置,用于网关签名计算和接口安全校验
549
560
  *
561
+ * @since 4.0.0
550
562
  * @param { LoginTokenInfo } info - 登录token、clientId等相关信息
551
563
  */
552
- setLoginTokenInfo(info: LoginTokenInfo): void;
564
+ setLoginTokenInfo(info: LoginTokenInfo): Promise<IReturnResult>;
553
565
  /**
554
- * 发起会议呼叫,如果返回 true ,代表是否可以继续呼叫;
566
+ * 校验会议室号
555
567
  *
556
- * @public
557
- * @param { IMackCall } params 呼叫参数
568
+ * @since v4.0.0
569
+ * @param { ICall } params - 参数
570
+ * @property { string } confNumber - 会议号
571
+ * @property { string } password - 会议密码
572
+ * @returns { Promise<IReturnResult> } - 结果
558
573
  */
559
- makeCall(params: IMackCall): Promise<any>;
574
+ checkMeetingNumber(params: ICall): Promise<IReturnResult>;
560
575
  /**
561
- * 开始会议,发送start call消息,通知后台服务
576
+ * 校验会议室密码
562
577
  *
563
- * @private
578
+ * @since v4.0.0
579
+ * @param { string } confNumber - 会议号
580
+ * @param { string } password - 会议密码
581
+ * @returns { Promise<IReturnResult> } - 结果
564
582
  */
565
- private startCall;
583
+ checkMeetingPassword(confNumber: string, password: string): Promise<IReturnResult>;
566
584
  /**
567
- * 结束会议,发送stop call消息,通知后台服务
585
+ * 发起会议呼叫
568
586
  *
569
- * @private
587
+ * @param { IMackCall } params - 呼叫参数
570
588
  */
571
- private stopCall;
589
+ makeCall(params: IMackCall): Promise<IReturnResult>;
572
590
  /**
573
591
  * 建会准备工作完成,通过publish开始多人会议
574
592
  *
575
- * @public
576
- * @param { Stream } stream 本地Stream
577
- * @param { IPublishParams } params 推送的stream类型
578
- * @param { boolean } params.isShareContent 是否推送共享屏幕流,默认是false,不推送,当需要屏幕共享时,请配置为true;
579
- * @param { boolean } params.isSharePeople 是否推送本地数据流,默认是false,初始入会需要设置为true
580
- * @param { boolean } params.isShareFile 是否推送文件,默认是false,此功能暂时未实现
581
- * @param { boolean } params.isShareWhiteBoard 是否推送白板,默认是false, 此功能暂时未实现
593
+ * @param { VideoAudioTrack | ContentTrack } track - 创建的Track模块
582
594
  */
583
- publish(stream: Stream, params?: IPublishParams): void;
595
+ publish(track: VideoAudioTrack | ContentTrack): void;
584
596
  /**
585
- * 通知媒体content能力
586
- *
587
- * @public
588
- * @param { Stream } stream 本地contentStream
589
- */
590
- sendContentCapability(): void;
591
- /**
592
- * 分享content
593
- *
594
- * @public
597
+ * 开始分享Content内容
595
598
  */
596
599
  applyShareContent(): Promise<void>;
597
600
  /**
598
- * 停止分享content
601
+ * 执行结束分享Content内容,重置状态
599
602
  *
600
- * @public
601
- * @returns { Promise<Boolean> } 停止分享content是否成功
602
- */
603
- stopShareContent(): Promise<Boolean>;
604
- /**
605
- * 监听 video/audio track
606
603
  */
607
- private initTrackEvent;
604
+ applyStopShareContent(): void;
608
605
  /**
609
- * content onhold时,处理content audio
610
- *
611
- * @private
612
- * @param { ITrackInfo } rest
606
+ * 发送结束Content的消息
613
607
  */
614
- private handleContentOnholdAudio;
608
+ sendStopShareContentMsg(): void;
615
609
  /**
616
- * 合并tTrack
610
+ * 获取随机云会议室
611
+ * 使用场景:目前用于教育
617
612
  *
618
- * @param { RTCTrackEvent } e
619
- */
620
- private mergeTrackList;
621
- /**
622
- * 挂断会议,销毁资源
623
- */
624
- destroy(): Promise<boolean>;
625
- close(reason?: string): void;
626
- /**
627
- * 获取随机云会议室 - 目前用于教育
628
- *
629
- * @public
630
- * @param { string } id userProfileId
631
- * @param { string } sk
632
- * @param { IToken } token
633
- * @param { AutoMute } autoMute 是否静音,0:智能静音 1:全部静音 2:不静音 3:强制静音
613
+ * @param { IGetConferenceParams } param - 会议室参数
634
614
  * @returns { Promise<IConference> } 云会议室信息
635
615
  */
636
- getConference(id: number | undefined, sk: string | undefined, token: IToken, params?: {
637
- autoMute: AutoMute;
638
- }): Promise<IConference>;
616
+ getConference(params: IGetConferenceParams): Promise<import("../type/index").IConference>;
639
617
  /**
640
618
  * 获取错误码/i18n等json链接
641
- *
642
- * @private
643
- * @returns
644
619
  */
645
620
  private getServerConfig;
646
- /**
647
- * 获取链接内容
648
- *
649
- * @param { string } configName 'errorcode' | 'i18n'
650
- * @param data
651
- * @returns
652
- */
653
- private getCodeByJson;
654
621
  /**
655
622
  * 添加音视频开启/关闭 同步任务
656
623
  *
657
- * @private
658
624
  * @param { OperateType } type 操作类型
659
625
  * @param { boolean } isSendWs 是否向信令发送对应消息,默认:发送(true); 信令下发的音频mute/unmute,不再向信令发送此消息
660
- * @returns Promise
626
+ * @returns { Promise<IVideoAudioType> } - 操作结果
661
627
  */
662
628
  private addOperateVideoAudioTask;
663
629
  /**
664
630
  * 音视频开启/关闭操作
665
631
  *
666
- * @private
667
632
  * @param { OperateType } type 操作类型
668
633
  * @param { boolean } isSendWs 是否向信令发送对应消息,默认:发送(true); 信令下发的音频mute/unmute,不再向信令发送此消息
669
- * @returns Promise<IVideoAudioType> 类型
634
+ * @returns { Promise<IVideoAudioType> } - 操作结果
670
635
  */
671
636
  private operateVideoAudio;
672
- /**
673
- * 操作Stream中的音视频流
674
- *
675
- * @param { OperateType } type - 操作类型
676
- */
677
- private operateStreamStatus;
678
637
  /**
679
638
  * 推流到PeerConnection上
680
639
  *
681
640
  * @param { PushType } pushType - 推送类型,用来区分Content和People画面流
682
641
  */
683
- peerPublish(pushType: PushType): void;
642
+ peerPublish(track: VideoAudioTrack, pushType: PushType): void;
684
643
  /**
685
644
  * 关闭麦克风
686
645
  *
687
- * @public
688
646
  * @returns { Promise<IVideoAudioType> } 操作类型
689
647
  */
690
648
  muteAudio(): Promise<IVideoAudioType>;
691
649
  /**
692
650
  * 关闭摄像头
693
651
  *
694
- * @public
695
652
  * @returns { Promise<IVideoAudioType> } 操作类型
696
653
  */
697
654
  muteVideo(): Promise<IVideoAudioType>;
698
655
  /**
699
656
  * 开启麦克风
700
657
  *
701
- * @public
702
658
  * @returns { Promise<IVideoAudioType> } 操作类型
703
659
  */
704
660
  unmuteAudio(): Promise<IVideoAudioType>;
705
661
  /**
706
662
  * 开启摄像头
707
663
  *
708
- * @public
709
664
  * @returns { Promise<IVideoAudioType> } 操作类型
710
665
  */
711
666
  unmuteVideo(): Promise<IVideoAudioType>;
712
667
  /**
713
668
  * 更新设备的声音状态
714
- * @scene 教育平台-巡课
715
- * @param type mute: 静音;unmute: 取消静音;
716
- * @param callUriList 操作的设备的 callUri 或者 callUri 列表
717
- * @returns [hasError, data]
669
+ * 使用场景:教育平台-巡课
670
+ *
671
+ * @param { 'mute' | 'unmute' } type - mute: 静音;unmute: 取消静音;
672
+ * @param { string | string[] } callUriList - 操作的设备的 callUri 或者 callUri 列表
673
+ * @returns { IReturnResult } - 操作结果
718
674
  */
719
675
  setPollingAudioStatus(type: 'mute' | 'unmute', callUriList: string | string[]): Promise<any>;
720
676
  /**
721
- * 举手发言 操作
677
+ * 举手发言
722
678
  *
723
- * @public
724
679
  * @returns { Promise<boolean> } 是否举手
725
680
  */
726
681
  onHandUp(): Promise<boolean>;
727
682
  /**
728
- * 取消举手 操作
683
+ * 取消举手
729
684
  *
730
- * @public
731
685
  * @returns { Promise<boolean> } 是否举手
732
686
  */
733
687
  onHandDown(): Promise<boolean>;
734
688
  /**
735
689
  * 结束发言 操作
736
690
  *
737
- * @public
738
691
  * @returns { Promise<boolean> } 是否举手
739
692
  */
740
693
  onMute(): Promise<boolean>;
741
- /**
742
- * 本地举手、结束发言等操作
743
- *
744
- * @private
745
- * @param { 'handup' | 'handdown' | 'mute' } type 操作类型
746
- * @param { boolean } handStatus 是否举手
747
- * @returns { Promise<boolean> } 举手状态
748
- */
749
- private onHand;
750
- /**
751
- * 告知媒体是否开启出入会通知
752
- *
753
- * @private
754
- */
755
- private sendConfParam;
756
- /**
757
- * 获取可支持的编解码
758
- *
759
- * @public
760
- * @returns { Promise<Object> }
761
- */
762
- getSendSupportedCodec(): Promise<Object>;
763
694
  /**
764
695
  * peerConnection 创建成功后,从缓存中读取会控消息开始处理
765
696
  * 状态码:950518
766
697
  *
767
- * @public
768
698
  * @param { boolean } status peer连接状态
769
699
  */
770
700
  setPeerConnectionStatus(status: boolean): void;
771
- /**
772
- * 发送带宽配置
773
- */
774
- private sendWebRxBandwidth;
775
701
  /**
776
702
  * 处理会议室静音状态
777
703
  *
778
704
  * @param { string } automute - "" | "mute" | "forcemute" 会议室静音属性
779
705
  */
780
- private handleAutoMute;
781
- /**
782
- * 处理会控消息,如音频、主会场、content等
783
- *
784
- * @private
785
- * @param { IMeetingControl } data 会控消息
786
- */
787
- private onMeetingControlMessage;
788
- /**
789
- * 处理字幕、点名消息
790
- *
791
- * @private
792
- * @param { ISubTitle } data 字幕、点名消息
793
- */
794
- private onSubTitle;
706
+ handleAutoMute(automute: string): void;
795
707
  /**
796
708
  * 发送自定义消息
797
709
  *
798
- * @public
799
710
  * @param { object } config - 配置参数
800
711
  * @param { number } config.toPid - 消息的接收方pid,0表示广播消息、非0表示单点消息;
801
712
  * @param { string } config.data - 消息内容,JSON字符串;因业务数据可能会传输图片,需要对二进制数据进行base64编码,消息长度限制最大:1030KB
802
- * @return { { code: string, message: string, data: null | object } } 返回结果
713
+ * @return { IReturnResult } - 返回结果
803
714
  */
804
715
  sendCustomMessage(config: ICustomMessageConfig): IReturnResult;
805
716
  /**
806
- * 处理媒体消息
807
- *
808
- * @private
809
- * @param { * } data - 媒体消息
717
+ * 轮询切换到下一页
810
718
  */
811
- private onPassThroughMessage;
812
- /**
813
- * 处理contentOnhold
814
- *
815
- * @private
816
- * @param { IConfProperty } info
817
- */
818
- private handleContentOnhold;
819
- /**
820
- * 处理等候室状态
821
- *
822
- * @param { IWaitingState } data
823
- */
824
- private handleWaitingState;
719
+ nextPollingPage(): void;
825
720
  /**
826
721
  * 是否开启自动调整带宽
827
722
  *
828
- * @public
829
723
  * @returns { boolean } 是否开启带宽调整
830
724
  */
831
725
  switchAutoBandwidth(): boolean;
832
- /**
833
- * 当websocket error,挂断会议
834
- *
835
- * @private
836
- * @param { string } errorCode 错误码
837
- * @param { TErrorReason } detail 详情
838
- */
839
- private disconnectInWssError;
840
726
  /**
841
727
  * 切换debug模式,控制推送发送&接收路所有流的状态数据(包括帧率,码率,带宽,抖动,分辨率等会议详细信息),开启后,通过监听 meeting-stats 事件获取数据
842
728
  *
843
- * @public
844
- * @param status 是否开启debug模式
845
- * @returns { Promise<boolean> } 是否开启了debug模式
729
+ * @param { boolean } status - 是否开启debug模式
730
+ * @returns { Promise<boolean> } - 是否开启了debug模式
846
731
  */
847
732
  switchDebug(status: boolean): Promise<boolean>;
848
733
  /**
849
734
  * 【newLayout】请求参会者成员的信息、视频数据等
850
735
  *
851
- * @public
852
- * @param { ICustomLayout[] } reqList 计算得到的custom layout list数据
853
- * @param { number } maxViewCountPerPage 每页最多请求画面数量,最大为9
854
- * @param { number } pageIndex 请求第几页数据
855
- * @param { IReqInfo[] } extReqList 需要固定的画面数据列表
856
- * @param { object? } extParams 其他参数
857
- * @returns { Promise<boolean> } 是否请求成功
736
+ * @param { ICustomLayout[] } reqList - 计算得到的custom layout list数据
737
+ * @param { number } maxViewCountPerPage - 每页最多请求画面数量,最大为9
738
+ * @param { number } pageIndex - 请求第几页数据
739
+ * @param { IReqInfo[] } extReqList - 需要固定的画面数据列表
740
+ * @param { object? } extParams - 其他参数
741
+ * @returns { Promise<boolean> } - 是否请求成功
858
742
  */
859
743
  requestNewLayout(reqList: IReqInfo[], maxViewCountPerPage: number, pageIndex: number, extReqList?: IReqInfo[], extParams?: {}): Promise<boolean>;
860
744
  /**
861
745
  * 开始轮询请求 Layout 画面数据
746
+ * 使用场景:教育平台
862
747
  *
863
- * @public
864
- * @param { TCommand } command 轮询状态,0-开始 1-停止 2-暂停 3-恢复
865
- * @param { number } interval 轮询间隔时长,单位秒
866
- * @param { IReqInfo[] } reqList 请求 Layout 画面流内容
867
- * @returns { Promise<boolean> } 是否请求成功
748
+ * @param { TCommand } command - 轮询状态,0-开始 1-停止 2-暂停 3-恢复
749
+ * @param { number } interval - 轮询间隔时长,单位毫秒
750
+ * @param { IReqInfo[] } reqList - 请求 Layout 画面流内容,轮询几画面,就配置几个数据,例如每次显示2画面,那么此处配置两个reqObj数据
751
+ * @returns { Promise<boolean> } - 是否请求成功
868
752
  */
869
753
  requestAutoPollingLayout(command: TCommand, interval: number | undefined, reqList: IReqInfo[]): Promise<boolean>;
870
754
  /**
@@ -880,209 +764,116 @@ export default class Client extends Emitter {
880
764
  */
881
765
  emitVideoStatus(type: OperateType): void;
882
766
  /**
883
- * 发布 自动布局/自定义布局 layout布局信息(参会人最新的布局列表数据)
884
- *
885
- * @public
886
- * @params { boolean } isDealAvatar 是否处理layout头像, 启用相关配置后,默认处理
887
- */
888
- sendLayoutMessage(isDealAvatar?: boolean): void;
889
- /**
890
- * 发布最新的已经排序过的的roster信息
767
+ * 入会成功后,再上报焦点画面
891
768
  *
892
- * @private
893
- */
894
- private sendOriginOrderedRosterMessage;
895
- /**
896
- * 对媒体下发的roster信息进行排序,发布
897
- *
898
- * @private
769
+ * @param { IRoster | null } focusRoster - 焦点画面
899
770
  */
900
- private sendsOriginOrderRosterMessage;
771
+ emitFocusView(focusRoster: IRoster | null): void;
901
772
  /**
902
773
  * 发布Layout Container的容器信息
903
774
  *
904
- * @public
905
- * @param { IScreenInfo } screenInfo Layout Container的容器信息
775
+ * @param { IScreenInfo } screenInfo - Layout Container的容器信息
906
776
  */
907
777
  sendScreenInfoMessage(screenInfo: IScreenInfo): void;
908
778
  /**
909
779
  * 发布当前正在分享 content 的用户详细信息
910
780
  *
911
- * @public
912
- * @param { IRoster | null } next content详细信息
781
+ * @param { IRoster | null } next - content详细信息
913
782
  */
914
783
  sendContentRosterMessage(next: IRoster | null): void;
915
784
  /**
916
785
  * 发布AUTO布局当前布局模式
917
786
  *
918
- * @public
919
- * @param { IMode } templateMode 布局模式
787
+ * @param { IMode } templateMode - 布局模式
920
788
  */
921
789
  sendTemplateMode(templateMode: IMode): void;
922
- /**
923
- * 处理旋转信息
924
- *
925
- * @private
926
- */
927
- private updateRotationInfo;
928
- /**
929
- * 【仅支持2.0.2以前的版本】发送customLayout请求流的消息
930
- *
931
- * @public
932
- * @param { ICustomLayout[] } customLayout 计算得到的customLayout List数据
933
- */
934
- sendCustomLayout(customLayout?: ICustomLayout[]): void;
935
790
  /**
936
791
  * 上报会议质量数据
937
792
  *
938
- * @public
939
- * @param { IInternals } internals Internals统计数据
793
+ * @param { IInternals } internals - Internals统计数据
940
794
  */
941
795
  reportQualityData(internals: IInternals): void;
942
- /**
943
- * Internals统计数据-期望带宽
944
- *
945
- * @param internals
946
- * @returns
947
- */
948
- private getNewInternals;
949
796
  /**
950
797
  * 上报给业务层Internals统计数据
951
798
  *
952
- * @public
953
- * @param { IInternals } internals Internals统计数据
799
+ * @param { IInternals } internals - Internals统计数据
954
800
  */
955
801
  sendInternals(internals: IInternals): void;
956
802
  /**
957
803
  * 取消监听事件
958
804
  *
959
- * @public
960
- * @param { string } key 监听器key值
805
+ * @param { string } key - 监听器key值
961
806
  */
962
807
  off(key: string): void;
963
808
  /**
964
809
  * 屏幕 Resize
965
- *
966
- * @private
967
810
  */
968
811
  private onScreenChangeEvent;
969
812
  /**
970
813
  * 注册resize事件
971
- *
972
- * @private
973
814
  */
974
815
  private initWindowResizeEvent;
975
816
  /**
976
817
  * 移除resize事件
977
- *
978
- * @private
979
818
  */
980
819
  private removeWindowResizeEvent;
981
- /**
982
- * 通知本地采集能力,用于vom进行分配
983
- *
984
- * @public
985
- */
986
- sendPeopleCapability(): void;
987
820
  /**
988
821
  * 全屏请流
989
822
  *
990
- * @param { string } id rosterId
991
- * @returns Promise<string> rosterId
823
+ * @param { string } id - 需要强制全屏的Layout Id
824
+ * @returns { Promise<string> } - Roster Id
992
825
  */
993
826
  forceFullScreen(id?: string): Promise<string>;
994
827
  /**
995
- * 发送websocket消息方法
828
+ * 获取用户、会议室基本信息、上报终端能力
996
829
  *
997
- * @public
998
- * @param { any } data 消息
999
- * @param { boolean } isAutoAdd 序列号是否自动增加
1000
- * @param { boolean } isLog 是否写入日志
1001
- */
1002
- sendSocketMessage(data: any, isAutoAdd?: boolean, isLog?: boolean): void;
1003
- /**
1004
- * 获取用户、会议室基本信息
1005
- *
1006
- * @param { ICall } params
1007
- * @returns
830
+ * @param { ICall } params - 呼叫参数
831
+ * @param { string } token - 登录token
1008
832
  */
1009
833
  private getBasicInfo;
1010
- /**
1011
- * 校验会议室号
1012
- *
1013
- * @private
1014
- * @param { ICall } params
1015
- * @returns { Promise<{success: boolean; data: any;}> } 是否通过校验
1016
- */
1017
- private verifyMeeting;
1018
834
  /**
1019
835
  * 刷新Token
1020
836
  */
1021
837
  refreshToken(refresh_token: string): Promise<any>;
1022
- /**
1023
- * 设置扬声器
1024
- *
1025
- * @public
1026
- * @param { string } deviceId 设备ID
1027
- */
1028
- setAudioOutputDevice(deviceId: string, config?: SwitchDeviceConfig): Promise<void>;
1029
- /**
1030
- * 移除对应的AudioRenderer
1031
- *
1032
- * @param { string } rosterId - 参会者唯一ID,由roster中的id得到
1033
- */
1034
- removeAudioRender(rosterId: string): void;
1035
838
  /**
1036
839
  * 开始巡课
1037
840
  *
1038
- * @public
1039
- * @param { string[] } uriList 需要巡课的终端ID(callUri)
841
+ * @param { string[] } uriList - 需要巡课的终端ID(callUri)
1040
842
  */
1041
843
  startMonitor(uriList?: string[]): void;
1042
844
  /**
1043
845
  * 停止巡课
1044
846
  *
1045
- * @public
1046
- * @param { string[] } uriList 需要停止巡课的终端ID(callUri)
847
+ * @param { string[] } uriList - 需要停止巡课的终端ID(callUri)
1047
848
  */
1048
849
  stopMonitor(uriList?: string[]): void;
1049
850
  /**
1050
851
  * 订阅参会者信息
1051
- *
1052
- * @public
1053
852
  */
1054
- subscribeBulkRoster(): Promise<unknown>;
853
+ subscribeBulkRoster(): Promise<IReturnResult>;
1055
854
  /**
1056
- * 开启同传字幕消息
1057
- *
1058
- * @public
855
+ * 开启通话字幕
1059
856
  */
1060
- startTranslation(): Promise<unknown>;
857
+ startTranslation(): Promise<IReturnResult>;
1061
858
  /**
1062
- * 停止同传字幕消息
1063
- *
1064
- * @public
859
+ * 停止通话字幕
1065
860
  */
1066
- stopTranslation(): Promise<unknown>;
861
+ stopTranslation(): Promise<IReturnResult>;
1067
862
  /**
1068
- * 同传字幕: 设置本地说话的语言
863
+ * 通话字幕: 设置本地说话的语言
1069
864
  *
1070
865
  * @param { TLocalLanguage } language
1071
866
  * @returns
1072
867
  */
1073
- setTranslationLanguage(language: TLocalLanguage): Promise<unknown>;
868
+ setTranslationLanguage(language: TLocalLanguage): Promise<IReturnResult>;
1074
869
  /**
1075
870
  * 开启云端录制
1076
- *
1077
- * @public
1078
871
  */
1079
- startCloudRecord(): Promise<undefined>;
872
+ startCloudRecord(): Promise<IReturnResult>;
1080
873
  /**
1081
- * 停止录制
1082
- *
1083
- * @public
874
+ * 停止云端录制
1084
875
  */
1085
- stopCloudRecord(): Promise<undefined>;
876
+ stopCloudRecord(): Promise<IReturnResult>;
1086
877
  /**
1087
878
  * 重新计算Layout布局数据
1088
879
  *
@@ -1098,34 +889,37 @@ export default class Client extends Emitter {
1098
889
  * 并标记meidagroupId为-1,代表本地初始入会时,不再向其他通道转发声音数据;
1099
890
  * 增加时间:2022-10-21
1100
891
  *
1101
- * @public
1102
- * @param { 'audio' | 'video' } trackType 控制发送通道类型,audio控制音频通道,video控制视频通道,暂时只支持audio通道
1103
- * @param { number } mediagroupId 分组id,也称sessionId或者mediaGroupId,代表只向此分组通道发送音频数据
892
+ * @param { 'audio' | 'video' } trackType - 控制发送通道类型,audio控制音频通道,video控制视频通道,暂时只支持audio通道
893
+ * @param { number } mediagroupId - 分组id,也称sessionId或者mediaGroupId,代表只向此分组通道发送音频数据
1104
894
  * @returns { boolean }
1105
895
  */
1106
896
  bindTrackGroup(trackType: 'audio' | 'video', mediagroupId: number): true | IReturnResult;
1107
897
  /**
1108
- * 启用多分组通道,接收多分组通道数据
898
+ * 启用多分组通道,进行多分组请流和资源创建
1109
899
  *
1110
- * @public
1111
- * @param { Key[] } mediagrpIds 多分组sessionId,可以配置多个或一个值
900
+ * @param { Key[] } mediagroupIds - 多分组sessionId,可以配置多个或一个值
1112
901
  * @returns { boolean }
1113
902
  */
1114
- startMonitorGroup(mediagrpIds: Key[]): true | IReturnResult;
903
+ startMonitorGroup(mediagroupIds: Key[]): IReturnResult;
1115
904
  /**
1116
905
  * 停止多分组通道,销毁资源
1117
906
  *
1118
- * @public
1119
- * @param { Key[] } mediagrpIds 多分组sessionId,可以配置多个或一个值
907
+ * @param { Key[] } mediagroupIds - 多分组sessionId,可以配置多个或一个值
1120
908
  * @returns { boolean }
1121
909
  */
1122
- stopMonitorGroup(mediagrpIds: Key[]): true | IReturnResult;
910
+ stopMonitorGroup(mediagroupIds: Key[]): IReturnResult;
1123
911
  /**
1124
912
  * 获取会议分享详情信息
1125
913
  *
1126
914
  * @returns {Promise<InviteInfo>}
1127
915
  */
1128
916
  getMeetingInviteInfo(): Promise<InviteInfo>;
917
+ /**
918
+ * 修改参会者名称,暂只支持修改Local名称
919
+ *
920
+ * @param { string } newName - 新名称
921
+ */
922
+ rename(newName: string): Promise<IReturnResult | undefined>;
1129
923
  /**
1130
924
  * 签到
1131
925
  *
@@ -1149,44 +943,20 @@ export default class Client extends Emitter {
1149
943
  /**
1150
944
  * 结束全体会议
1151
945
  */
1152
- endAllMeeting(): Promise<IReturnResult | undefined>;
1153
- /**
1154
- * 设置多分组通道,通用方法
1155
- *
1156
- * @private
1157
- * @param { 'start' | 'stop' } type 启用或者停止多分组通道能力
1158
- * @param { Key[] } mediagrpIds 多分组sessionId,可以配置多个或一个值
1159
- * @returns { boolean }
1160
- */
1161
- private setMonitorGroup;
946
+ endAllMeeting(): Promise<IReturnResult>;
1162
947
  /**
1163
948
  * 校验clientId/clientSecret
1164
- *
1165
- * @returns
1166
949
  */
1167
950
  private verifyParameter;
1168
951
  /**
1169
- * 初始化DeviceManager事件
1170
- *
1171
- * @private
1172
- */
1173
- private initDeviceManagerEvent;
1174
- /**
1175
- * 请求ConfChangeInfo消息
1176
- */
1177
- private reqConfChangeInfo;
1178
- /**
1179
- * 获取WebSocket URL地址
952
+ * 推送错误消息
1180
953
  *
1181
- * @returns { string } - 返回WebSocket地址
954
+ * @param { IReturnResult } msg - 错误消息
1182
955
  */
1183
- private getWssUrl;
956
+ emitError(msg: IReturnResult): void;
1184
957
  /**
1185
- * init websocket connection
1186
- *
1187
- * @private
1188
- * @param { Promise.resolve } resolve 响应回调
1189
- * @param { Promise.reject } reject 拒绝回调
958
+ * 挂断会议,销毁资源
1190
959
  */
1191
- private initWss;
960
+ destroy(reason?: string, blockSendSocket?: boolean): Promise<boolean>;
961
+ close(reason?: string, blockSendSocket?: boolean): Promise<boolean>;
1192
962
  }