@rongcloud/plugin-rtc 5.4.2 → 5.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/async-task-queue.d.ts +9 -0
- package/dist/core/Invoker.d.ts +46 -0
- package/dist/core/PolarisReporter.d.ts +35 -0
- package/dist/core/RCAudienceClient.d.ts +89 -0
- package/dist/core/RCMediaStreamCapture.d.ts +124 -0
- package/dist/core/RCRTCClient.d.ts +126 -0
- package/dist/core/Store.d.ts +80 -0
- package/dist/core/command/BaseCommand.d.ts +22 -0
- package/dist/core/command/EnabelInnerCDNCommand.d.ts +16 -0
- package/dist/core/command/ExchangeCommand.d.ts +18 -0
- package/dist/core/command/ExchangeWithPushOtherRoomCommand.d.ts +22 -0
- package/dist/core/command/JoinRoomCommand.d.ts +26 -0
- package/dist/core/command/LeaveOtherRoomCommand.d.ts +30 -0
- package/dist/core/command/LocalTrackMuteCommand.d.ts +10 -0
- package/dist/core/command/MCUConfigFlushCommand.d.ts +18 -0
- package/dist/core/command/OnRemoteUserUnpubCommand.d.ts +13 -0
- package/dist/core/command/OnSignalReconnectedCommand.d.ts +38 -0
- package/dist/core/command/ParseRemoteResCommand.d.ts +38 -0
- package/dist/core/command/ParseUserStateCommand.d.ts +57 -0
- package/dist/core/command/PubCommand.d.ts +34 -0
- package/dist/core/command/RTCIdentityChangeCommand.d.ts +17 -0
- package/dist/core/command/RetryExchangeCommand.d.ts +18 -0
- package/dist/core/command/SubCommand.d.ts +21 -0
- package/dist/core/command/UnpubCommand.d.ts +20 -0
- package/dist/core/command/UnpubPrevCommand.d.ts +6 -0
- package/dist/core/command/UnsubCommand.d.ts +20 -0
- package/dist/core/command/UpdateSubListCommand.d.ts +28 -0
- package/dist/core/command/helper.d.ts +20 -0
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/enums/BackgroundPictureFillMode.d.ts +14 -0
- package/dist/core/enums/MixLayoutMode.d.ts +18 -0
- package/dist/core/enums/MixVideoRenderMode.d.ts +14 -0
- package/dist/core/enums/RCBitrate.d.ts +48 -0
- package/dist/core/enums/RCFrameRate.d.ts +7 -0
- package/dist/core/enums/RCInnerCDNBroadcast.d.ts +5 -0
- package/dist/core/enums/RCInnerCDNModel.d.ts +5 -0
- package/dist/core/enums/RCInnerCDNPullIsHttps.d.ts +5 -0
- package/dist/core/enums/RCInnerCDNPullKind.d.ts +6 -0
- package/dist/core/enums/RCInnerCDNPushMode.d.ts +5 -0
- package/dist/core/enums/RCKickType.d.ts +11 -0
- package/dist/core/enums/RCLivingType.d.ts +14 -0
- package/dist/core/enums/RCLoggerTag.d.ts +629 -0
- package/dist/core/enums/RCMediaType.d.ts +18 -0
- package/dist/core/enums/RCMixInputFilterMode.d.ts +35 -0
- package/dist/core/enums/RCRTCCode.d.ts +86 -0
- package/dist/core/enums/RCRTCLiveRole.d.ts +14 -0
- package/dist/core/enums/RCRTCPingResult.d.ts +5 -0
- package/dist/core/enums/RCRTCResolution.d.ts +102 -0
- package/dist/core/enums/RCResolution.d.ts +16 -0
- package/dist/core/enums/inner/PolarisRole.d.ts +14 -0
- package/dist/core/enums/inner/R2Action.d.ts +14 -0
- package/dist/core/enums/inner/R2Status.d.ts +11 -0
- package/dist/core/enums/inner/RCRTCMessageType.d.ts +66 -0
- package/dist/core/enums/inner/RCStreamType.d.ts +14 -0
- package/dist/core/enums/inner/TrackState.d.ts +14 -0
- package/dist/core/interfaces.d.ts +912 -0
- package/dist/core/room/Pinger.d.ts +35 -0
- package/dist/core/room/RCAbstractRoom.d.ts +327 -0
- package/dist/core/room/RCAudienceLivingRoom.d.ts +321 -0
- package/dist/core/room/RCAudioLevelReport.d.ts +16 -0
- package/dist/core/room/RCLivingPKHandler.d.ts +164 -0
- package/dist/core/room/RCLivingRoom.d.ts +108 -0
- package/dist/core/room/RCLocalMediaStream.d.ts +8 -0
- package/dist/core/room/RCMCUConfigBuilder.d.ts +211 -0
- package/dist/core/room/RCRTCRoom.d.ts +15 -0
- package/dist/core/service/RCMediaService.d.ts +96 -0
- package/dist/core/service/helper.d.ts +8 -0
- package/dist/core/service/index.d.ts +6 -0
- package/dist/core/service/interface.d.ts +323 -0
- package/dist/core/service/mcu-interface.d.ts +293 -0
- package/dist/core/tracks/RCLocalTrack.d.ts +121 -0
- package/dist/core/tracks/RCRemoteTrack.d.ts +23 -0
- package/dist/core/tracks/RCTrack.d.ts +91 -0
- package/dist/core/webrtc/RCRTCPeerCManager.d.ts +159 -0
- package/dist/core/webrtc/RCRTCPeerConnection.d.ts +110 -0
- package/dist/core/webrtc/helper.d.ts +26 -0
- package/dist/core/webrtc/sdp/ASdpBuilder.d.ts +98 -0
- package/dist/core/webrtc/sdp/ASdpStrategy.d.ts +48 -0
- package/dist/core/webrtc/sdp/PlanBSdpBuilder.d.ts +20 -0
- package/dist/core/webrtc/sdp/PlanBStrategy.d.ts +26 -0
- package/dist/core/webrtc/sdp/UnifiedPlanSdpBuilder.d.ts +11 -0
- package/dist/core/webrtc/sdp/UnifiedPlanStrategy.d.ts +21 -0
- package/dist/core/webrtc/stat-parser/AbstractStatParser.d.ts +117 -0
- package/dist/core/webrtc/stat-parser/ChromeStatParser.d.ts +14 -0
- package/dist/core/webrtc/stat-parser/FirefoxStatParser.d.ts +14 -0
- package/dist/core/webrtc/stat-parser/IStatParser.d.ts +24 -0
- package/dist/core/webrtc/stat-parser/SafariStatParser.d.ts +14 -0
- package/dist/device.d.ts +6 -0
- package/dist/helper.d.ts +189 -0
- package/dist/index.d.ts +193 -155
- package/dist/index.esm.js +2 -2
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/logger.d.ts +4 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.4.
|
|
3
|
-
* CommitId -
|
|
4
|
-
* Tue
|
|
2
|
+
* RCRTC - v5.4.3
|
|
3
|
+
* CommitId - 14f0acc9bca79c93547703c573d297dbd301594c
|
|
4
|
+
* Tue Aug 02 2022 09:57:21 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, RTCMode, IRuntime, RTCPluginContext, IJoinRTCRoomData, IReceivedMessage, ErrorCode, RTCJoinType, IRTCUserData, KVString, IServerRTCRoomEntry, LogLevel, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
|
|
@@ -88,7 +88,9 @@ declare enum RCRTCCode {
|
|
|
88
88
|
/** 方法在 PK 房间上不可用 */
|
|
89
89
|
THE_FUNCTION_IS_DISABLED_IN_PKROOM = 53030,
|
|
90
90
|
/** 资源没有全部发成功 */
|
|
91
|
-
SOME_TRACKS_PUBLISH_FAILED = 53031
|
|
91
|
+
SOME_TRACKS_PUBLISH_FAILED = 53031,
|
|
92
|
+
/** electron 中 mac 系统暂不支持屏幕共享采集声音 */
|
|
93
|
+
MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO = 53032
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
/**
|
|
@@ -213,7 +215,8 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
213
215
|
*/
|
|
214
216
|
play(element?: HTMLVideoElement, options?: {
|
|
215
217
|
volume?: number;
|
|
216
|
-
audioDeviceId
|
|
218
|
+
audioDeviceId?: string;
|
|
219
|
+
autoplay: boolean;
|
|
217
220
|
}): Promise<{
|
|
218
221
|
code: RCRTCCode;
|
|
219
222
|
}>;
|
|
@@ -230,6 +233,47 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
230
233
|
private __validateVideoNodeName;
|
|
231
234
|
}
|
|
232
235
|
|
|
236
|
+
declare enum RCAudioBitrate {
|
|
237
|
+
/**
|
|
238
|
+
* 标清音质
|
|
239
|
+
*/
|
|
240
|
+
Speech = "Speech",
|
|
241
|
+
/**
|
|
242
|
+
* 音乐音质
|
|
243
|
+
*/
|
|
244
|
+
Music = "Music",
|
|
245
|
+
/**
|
|
246
|
+
* 音乐高清音质
|
|
247
|
+
*/
|
|
248
|
+
MusicHigh = "MusicHigh"
|
|
249
|
+
}
|
|
250
|
+
declare enum RCVideoBitrate {
|
|
251
|
+
/**
|
|
252
|
+
* Bitrate { max: 150, min: 80 }
|
|
253
|
+
*/
|
|
254
|
+
LEVEL0 = "LEVEL0",
|
|
255
|
+
/**
|
|
256
|
+
* Bitrate { max: 280, min: 120 }
|
|
257
|
+
*/
|
|
258
|
+
LEVEL1 = "LEVEL1",
|
|
259
|
+
/**
|
|
260
|
+
* Bitrate { max: 650, min: 150 }
|
|
261
|
+
*/
|
|
262
|
+
LEVEL2 = "LEVEL2",
|
|
263
|
+
/**
|
|
264
|
+
* Bitrate { max: 1000, min: 200 }
|
|
265
|
+
*/
|
|
266
|
+
LEVEL3 = "LEVEL3",
|
|
267
|
+
/**
|
|
268
|
+
* Bitrate { max: 2200, min: 250 }
|
|
269
|
+
*/
|
|
270
|
+
LEVEL4 = "LEVEL4",
|
|
271
|
+
/**
|
|
272
|
+
* Bitrate { max: 4000, min: 400 }
|
|
273
|
+
*/
|
|
274
|
+
LEVEL5 = "LEVEL5"
|
|
275
|
+
}
|
|
276
|
+
|
|
233
277
|
declare abstract class RCLocalTrack extends RCTrack {
|
|
234
278
|
/**
|
|
235
279
|
* 本地流结束事件通知
|
|
@@ -279,17 +323,16 @@ declare abstract class RCLocalTrack extends RCTrack {
|
|
|
279
323
|
declare class RCLocalAudioTrack extends RCLocalTrack {
|
|
280
324
|
constructor(tag: string, userId: string, track: MediaStreamTrack);
|
|
281
325
|
/**
|
|
282
|
-
*
|
|
283
|
-
* @param
|
|
284
|
-
* @param min 最小码率,`0` 表示不限制
|
|
285
|
-
* @param start 起始码率
|
|
326
|
+
* 它设置推荐的音频码率。
|
|
327
|
+
* @param {RCAudioBitrate} audio - RCA音频比特率
|
|
286
328
|
*/
|
|
287
|
-
|
|
329
|
+
setRecommendBitrate(audio: RCAudioBitrate): void;
|
|
288
330
|
/**
|
|
289
|
-
*
|
|
290
|
-
* @
|
|
331
|
+
* 它设置视频的比特率。
|
|
332
|
+
* @param {number} max - 客户端将使用的最大比特率。
|
|
333
|
+
* @param {number[]} args - [分钟,开始]
|
|
291
334
|
*/
|
|
292
|
-
|
|
335
|
+
setBitrate(max: number, ...args: number[]): void;
|
|
293
336
|
}
|
|
294
337
|
declare class RCLocalVideoTrack extends RCLocalTrack {
|
|
295
338
|
private _isTiny;
|
|
@@ -297,6 +340,17 @@ declare class RCLocalVideoTrack extends RCLocalTrack {
|
|
|
297
340
|
__isTiny(): boolean;
|
|
298
341
|
getStreamId(): string;
|
|
299
342
|
getTrackId(): string;
|
|
343
|
+
/**
|
|
344
|
+
* 它设置推荐的音频码率
|
|
345
|
+
* @param {RCVideoBitrate} video - RC视频比特率
|
|
346
|
+
*/
|
|
347
|
+
setRecommendBitrate(video: RCVideoBitrate): void;
|
|
348
|
+
/**
|
|
349
|
+
* 它设置视频的比特率。
|
|
350
|
+
* @param {number} max - 视频可以编码的最大比特率。
|
|
351
|
+
* @param {number[]} args - [最大、最小、开始]
|
|
352
|
+
*/
|
|
353
|
+
setBitrate(max: number, ...args: number[]): void;
|
|
300
354
|
}
|
|
301
355
|
declare abstract class RCLocalFileTrack extends RCLocalTrack {
|
|
302
356
|
/**
|
|
@@ -334,6 +388,8 @@ declare class RCCameraVideoTrack extends RCLocalVideoTrack {
|
|
|
334
388
|
}
|
|
335
389
|
declare class RCScreenVideoTrack extends RCLocalVideoTrack {
|
|
336
390
|
}
|
|
391
|
+
declare class RCScreenAudioTrack extends RCLocalAudioTrack {
|
|
392
|
+
}
|
|
337
393
|
|
|
338
394
|
declare class RCRemoteTrack extends RCTrack {
|
|
339
395
|
constructor(tag: string, userId: string, kind: 'audio' | 'video', roomId?: string);
|
|
@@ -1011,99 +1067,27 @@ interface IMCUOutputConfig {
|
|
|
1011
1067
|
pushurl: string;
|
|
1012
1068
|
}[];
|
|
1013
1069
|
}
|
|
1014
|
-
/**
|
|
1015
|
-
* 时间戳参数,用于水印
|
|
1016
|
-
*/
|
|
1017
|
-
interface ITimestampAttrs {
|
|
1018
|
-
/**
|
|
1019
|
-
* 时区
|
|
1020
|
-
*/
|
|
1021
|
-
timezone: number;
|
|
1022
|
-
/**
|
|
1023
|
-
* 字体像素大小
|
|
1024
|
-
*/
|
|
1025
|
-
fontSize: number;
|
|
1026
|
-
/**
|
|
1027
|
-
* 字体颜色
|
|
1028
|
-
*/
|
|
1029
|
-
color: 'black' | 'white';
|
|
1030
|
-
/**
|
|
1031
|
-
* 透明度,有效值 `0.0` 至 `1.0`
|
|
1032
|
-
*/
|
|
1033
|
-
alpha: number;
|
|
1034
|
-
/**
|
|
1035
|
-
* 相较于整体画布的 x 坐标(百分比),有效值 `0.0` 至 `1.0`
|
|
1036
|
-
*/
|
|
1037
|
-
x: number;
|
|
1038
|
-
/**
|
|
1039
|
-
* 相较于整体画布的 y 坐标(百分比),有效值 `0.0` 至 `1.0`
|
|
1040
|
-
*/
|
|
1041
|
-
y: number;
|
|
1042
|
-
}
|
|
1043
|
-
/**
|
|
1044
|
-
* 文本参数,用于水印
|
|
1045
|
-
*/
|
|
1046
|
-
interface ITextAttrs {
|
|
1047
|
-
/**
|
|
1048
|
-
* 文字内容
|
|
1049
|
-
*/
|
|
1050
|
-
content: string;
|
|
1051
|
-
/**
|
|
1052
|
-
* 文字像素
|
|
1053
|
-
*/
|
|
1054
|
-
fontSize: number;
|
|
1055
|
-
/**
|
|
1056
|
-
* 文字颜色
|
|
1057
|
-
*/
|
|
1058
|
-
color: 'black' | 'white';
|
|
1059
|
-
/**
|
|
1060
|
-
* 透明度,有效值 `0.0` 至 `1.0`
|
|
1061
|
-
*/
|
|
1062
|
-
alpha: number;
|
|
1063
|
-
/**
|
|
1064
|
-
* 相较于整体画布的 x 坐标(百分比),有效值 `0.0` 至 `1.0`
|
|
1065
|
-
*/
|
|
1066
|
-
x: number;
|
|
1067
|
-
/**
|
|
1068
|
-
* 相较于整体画布的 y 坐标(百分比),有效值 `0.0` 至 `1.0`
|
|
1069
|
-
*/
|
|
1070
|
-
y: number;
|
|
1071
|
-
}
|
|
1072
|
-
/**
|
|
1073
|
-
* 屏幕水印配置
|
|
1074
|
-
*/
|
|
1075
|
-
interface IWaterMarkConfig {
|
|
1076
|
-
/**
|
|
1077
|
-
* 时间戳水印配置
|
|
1078
|
-
*/
|
|
1079
|
-
timestamp?: ITimestampAttrs;
|
|
1080
|
-
/**
|
|
1081
|
-
* 图片水印配置
|
|
1082
|
-
*/
|
|
1083
|
-
picture?: IPictureAttrs[];
|
|
1084
|
-
/**
|
|
1085
|
-
* 文字水印配置
|
|
1086
|
-
*/
|
|
1087
|
-
text: ITextAttrs[];
|
|
1088
|
-
}
|
|
1089
1070
|
/**
|
|
1090
1071
|
* 合流前的单一视频流水印配置
|
|
1072
|
+
*【客户端仅提供图片水印设置】
|
|
1091
1073
|
*/
|
|
1092
|
-
interface IMCUSignalScreenWaterMarkConfig
|
|
1074
|
+
interface IMCUSignalScreenWaterMarkConfig {
|
|
1093
1075
|
/**
|
|
1094
1076
|
* 媒体流的 msid
|
|
1095
1077
|
*/
|
|
1096
1078
|
streamId: string;
|
|
1079
|
+
picture: IPictureAttrs[];
|
|
1097
1080
|
}
|
|
1098
1081
|
interface IMCUWaterMarkConfig {
|
|
1082
|
+
enable: 'on' | 'off';
|
|
1099
1083
|
/**
|
|
1100
1084
|
* 合流后的屏幕水印配置
|
|
1085
|
+
*【客户端暂不提供合流水印设置】
|
|
1101
1086
|
*/
|
|
1102
|
-
mixScreen: IWaterMarkConfig;
|
|
1103
1087
|
/**
|
|
1104
1088
|
* 合流前的单人视频流水印配置
|
|
1105
1089
|
*/
|
|
1106
|
-
|
|
1090
|
+
singleScreen: IMCUSignalScreenWaterMarkConfig[];
|
|
1107
1091
|
}
|
|
1108
1092
|
/**
|
|
1109
1093
|
* 发布到服务器的 MCU 配置数据
|
|
@@ -1112,7 +1096,7 @@ interface IMCUConfig {
|
|
|
1112
1096
|
/**
|
|
1113
1097
|
* 为向后兼容,当前为常量 1
|
|
1114
1098
|
*/
|
|
1115
|
-
version:
|
|
1099
|
+
version: 2;
|
|
1116
1100
|
/**
|
|
1117
1101
|
* 布局模式,在只配置推流 CDN 时,该值不存在
|
|
1118
1102
|
*/
|
|
@@ -1771,6 +1755,7 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
1771
1755
|
private _handlePingResult;
|
|
1772
1756
|
/**
|
|
1773
1757
|
* 设置房间上行资源的总码率配置
|
|
1758
|
+
* @deprecated use RCLocalTrack.setBitrate instead of setBitrate
|
|
1774
1759
|
* @description
|
|
1775
1760
|
* * 自 v5.1.0 版本开始,推荐使用 `RCLocalTrack.setBitrate` 对不同流分别指定码率。
|
|
1776
1761
|
* * 该方法仅在 SDP `plan-b` 协议下(Chrome 92 与 Safari 11 之前的版本)有效。
|
|
@@ -2446,6 +2431,10 @@ declare class RCRTCPeerConnection extends EventEmitter {
|
|
|
2446
2431
|
private _onConnectionStateChange;
|
|
2447
2432
|
private _onICEConnectionStateChange;
|
|
2448
2433
|
private _onTrackReady;
|
|
2434
|
+
/**
|
|
2435
|
+
* 它设置对等连接的比特率。
|
|
2436
|
+
* @deprecated use RCLocalTrack.setBitrate instead of setBitrate
|
|
2437
|
+
*/
|
|
2449
2438
|
setBitrate(max: number, min: number, start?: number): Promise<void>;
|
|
2450
2439
|
createOffer(iceRestart: boolean): Promise<IOfferInfo>;
|
|
2451
2440
|
setRemoteAnswer(answer: string): Promise<RCRTCCode>;
|
|
@@ -2577,7 +2566,8 @@ interface IVideoProfile {
|
|
|
2577
2566
|
*/
|
|
2578
2567
|
interface IScreenVideoProfile extends IVideoProfile {
|
|
2579
2568
|
/**
|
|
2580
|
-
* Electron 平台下通过 `desktopCapturer.getSources` 获取到的 sourceId
|
|
2569
|
+
* Electron 平台下通过 `desktopCapturer.getSources` 获取到的 sourceId,
|
|
2570
|
+
* 不传 chromeMediaSourceId 时默认共享桌面,传入时共享指定窗口。
|
|
2581
2571
|
* @see `https://www.electronjs.org/docs/api/desktop-capturer`
|
|
2582
2572
|
*/
|
|
2583
2573
|
chromeMediaSourceId?: string;
|
|
@@ -2830,7 +2820,7 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
2830
2820
|
* 另一种可能是己方 rtcPing 失败次数超出上限
|
|
2831
2821
|
* @param byServer 当值为 `false` 时,说明本端 rtcPing 超时;当值为 `true` 时,说明本端收到被踢出房间通知
|
|
2832
2822
|
*/
|
|
2833
|
-
onKickOff?(byServer: boolean, state?: RCKickReason): void;
|
|
2823
|
+
onKickOff?(byServer: boolean, state?: RCKickReason, kickExtra?: any): void;
|
|
2834
2824
|
/**
|
|
2835
2825
|
* 接收到房间信令时回调,用户可通过房间实例的 sendMessage 接口发送信令
|
|
2836
2826
|
* @param name 信令名
|
|
@@ -3254,6 +3244,19 @@ declare class RCMCUConfigBuilder {
|
|
|
3254
3244
|
* @since v5.3.7
|
|
3255
3245
|
*/
|
|
3256
3246
|
clearCustomizeInputAudio(): RCMCUConfigBuilder;
|
|
3247
|
+
/**
|
|
3248
|
+
* 给单道流添加水印
|
|
3249
|
+
*/
|
|
3250
|
+
addPictureWaterMark(trackId: string, uri: string, x: number, y: number, w: number, h: number): RCMCUConfigBuilder;
|
|
3251
|
+
/**
|
|
3252
|
+
* 删除所有水印
|
|
3253
|
+
*/
|
|
3254
|
+
clearPictureWaterMark(): RCMCUConfigBuilder;
|
|
3255
|
+
/**
|
|
3256
|
+
* 移除对合流后的某个视频流中添加的指定水印图片
|
|
3257
|
+
* @param uri
|
|
3258
|
+
*/
|
|
3259
|
+
removePictureWaterMark(trackId: string, uri: string): RCMCUConfigBuilder;
|
|
3257
3260
|
/**
|
|
3258
3261
|
* 设置 MCU 混流配置
|
|
3259
3262
|
* @param videoList 视频输入混流列表,为 null 代表视频全混流,为空集合代表视频全不混流,否则按照输入列表进行混流
|
|
@@ -3474,68 +3477,19 @@ declare class RCAudienceClient {
|
|
|
3474
3477
|
private _onTrackReady;
|
|
3475
3478
|
}
|
|
3476
3479
|
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
private readonly _context;
|
|
3483
|
-
private readonly _runtime;
|
|
3484
|
-
private readonly _options;
|
|
3485
|
-
private readonly _service;
|
|
3486
|
-
constructor(_context: RTCPluginContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
|
|
3487
|
-
private _handleMessage;
|
|
3488
|
-
/**
|
|
3489
|
-
* 获取加入的连麦房间
|
|
3490
|
-
*/
|
|
3491
|
-
private _getJoinedPKRoomList;
|
|
3492
|
-
/**
|
|
3493
|
-
* 获取当前用户 Id,若 IM 未连接,这返回 `''`
|
|
3494
|
-
* @returns
|
|
3495
|
-
*/
|
|
3496
|
-
getCurrentId(): string;
|
|
3497
|
-
private _crtRoom;
|
|
3498
|
-
/**
|
|
3499
|
-
* 加入普通音视频房间
|
|
3500
|
-
* @param roomId
|
|
3501
|
-
* @param joinType 多端处理方式,公有云暂不支持该字段
|
|
3502
|
-
* @param outerUserDatas 业务层设置人员属性
|
|
3503
|
-
*/
|
|
3504
|
-
joinRTCRoom(roomId: string, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean): Promise<{
|
|
3505
|
-
room?: RCRTCRoom;
|
|
3506
|
-
code: RCRTCCode;
|
|
3507
|
-
userIds?: string[];
|
|
3508
|
-
tracks?: RCRemoteTrack[];
|
|
3509
|
-
}>;
|
|
3510
|
-
/**
|
|
3511
|
-
* 主播加入直播房间或观众上麦场景调用,观众上麦之前需先取消已订阅的直播间资源
|
|
3512
|
-
* @param roomId 房间 Id
|
|
3513
|
-
* @param livingType 直播间类型,`RCLivingType.AUDIO` 为音频直播,`RCLivingType.VIDEO` 为音视频直播
|
|
3514
|
-
* @param joinType 多端处理方式,公有云暂不支持该字段
|
|
3515
|
-
* @param outerUserDatas 业务层设置人员属性
|
|
3516
|
-
*/
|
|
3517
|
-
joinLivingRoom(roomId: string, livingType: RCLivingType, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean): Promise<{
|
|
3518
|
-
room?: RCLivingRoom;
|
|
3519
|
-
code: RCRTCCode;
|
|
3520
|
-
userIds?: string[];
|
|
3521
|
-
tracks?: RCRemoteTrack[];
|
|
3522
|
-
CDNEnable?: boolean;
|
|
3523
|
-
}>;
|
|
3524
|
-
private _audience;
|
|
3525
|
-
/**
|
|
3526
|
-
* 获取直播观众客户端
|
|
3527
|
-
*/
|
|
3528
|
-
getAudienceClient(useMutilPeerC?: boolean): RCAudienceClient;
|
|
3529
|
-
private _onIMStatusChange;
|
|
3530
|
-
private _onIMDisconnect;
|
|
3531
|
-
private _onIMUninit;
|
|
3480
|
+
declare class RCMediaStreamCapture {
|
|
3481
|
+
protected readonly _context: RTCPluginContext;
|
|
3482
|
+
constructor(_context: RTCPluginContext);
|
|
3483
|
+
private _isElectron;
|
|
3484
|
+
private _getMediaStream;
|
|
3532
3485
|
/**
|
|
3533
|
-
*
|
|
3486
|
+
* 如果用户设置了音频约束为true,那么我们将音频约束设置为一个空对象,
|
|
3487
|
+
* 然后我们将检查浏览器是否支持noiseSuppression、autoGainControl和echoCancellation约束,
|
|
3488
|
+
* 如果支持,那么我们将设置音频约束为真
|
|
3489
|
+
* @param {any} constraints - 约束参数与 getUserMedia 方法中的约束参数相同。
|
|
3490
|
+
* @returns 返回值是约束对象。
|
|
3534
3491
|
*/
|
|
3535
|
-
|
|
3536
|
-
code: RCRTCCode;
|
|
3537
|
-
}>;
|
|
3538
|
-
private _getMediaStream;
|
|
3492
|
+
private setConstraintsConfig;
|
|
3539
3493
|
/**
|
|
3540
3494
|
* 从麦克风中捕获音轨数据
|
|
3541
3495
|
* @param tag
|
|
@@ -3581,6 +3535,18 @@ declare class RCRTCClient {
|
|
|
3581
3535
|
code: RCRTCCode;
|
|
3582
3536
|
track?: RCScreenVideoTrack;
|
|
3583
3537
|
}>;
|
|
3538
|
+
/**
|
|
3539
|
+
* 创建带音频的屏幕共享资源
|
|
3540
|
+
* @param tag 屏幕共享视轨数据标识
|
|
3541
|
+
* @param options
|
|
3542
|
+
* @description electron 中 mac 系统暂不支持屏幕共享采集声音
|
|
3543
|
+
* @returns 在可以取到音频的情况下,tracks 中包含音轨和视轨;取不到音视频时 tracks 仅返回视轨
|
|
3544
|
+
*/
|
|
3545
|
+
createScreenWithAudioTracks(tag?: string, options?: IScreenVideoProfile): Promise<{
|
|
3546
|
+
code: RCRTCCode;
|
|
3547
|
+
tracks?: (RCScreenVideoTrack | RCScreenAudioTrack)[];
|
|
3548
|
+
}>;
|
|
3549
|
+
private _createScreenTracks;
|
|
3584
3550
|
/**
|
|
3585
3551
|
* 创建 RCLocalAudioTrack 实例
|
|
3586
3552
|
* @param tag
|
|
@@ -3622,6 +3588,78 @@ declare class RCRTCClient {
|
|
|
3622
3588
|
code: RCRTCCode;
|
|
3623
3589
|
tracks: RCLocalTrack[];
|
|
3624
3590
|
}>;
|
|
3591
|
+
/**
|
|
3592
|
+
* 它接受一个 MediaStream 和一个可选的选项对象并返回一个 MediaStreamTracks 数组
|
|
3593
|
+
* @param {MediaStream} stream - MediaStream - 从中获取曲目的流。
|
|
3594
|
+
* @param {ICreateLocalTrackOptions} [options] - ICreateLocalTrackOptions
|
|
3595
|
+
* @returns 一组 MediaStreamTrack 对象。
|
|
3596
|
+
*/
|
|
3597
|
+
static getTracksWithOptions(stream: MediaStream, options?: ICreateLocalTrackOptions): Array<MediaStreamTrack | undefined>;
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
/**
|
|
3601
|
+
* RTC 业务客户端
|
|
3602
|
+
* @public
|
|
3603
|
+
*/
|
|
3604
|
+
declare class RCRTCClient extends RCMediaStreamCapture {
|
|
3605
|
+
protected readonly _context: RTCPluginContext;
|
|
3606
|
+
private readonly _runtime;
|
|
3607
|
+
private readonly _options;
|
|
3608
|
+
private readonly _service;
|
|
3609
|
+
constructor(_context: RTCPluginContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
|
|
3610
|
+
private _handleMessage;
|
|
3611
|
+
/**
|
|
3612
|
+
* 获取加入的连麦房间
|
|
3613
|
+
*/
|
|
3614
|
+
private _getJoinedPKRoomList;
|
|
3615
|
+
/**
|
|
3616
|
+
* 获取当前用户 Id,若 IM 未连接,这返回 `''`
|
|
3617
|
+
* @returns
|
|
3618
|
+
*/
|
|
3619
|
+
getCurrentId(): string;
|
|
3620
|
+
private _crtRoom;
|
|
3621
|
+
/**
|
|
3622
|
+
* 加入普通音视频房间
|
|
3623
|
+
* @param roomId
|
|
3624
|
+
* @param joinType 多端处理方式
|
|
3625
|
+
* @param outerUserDatas 业务层设置人员属性
|
|
3626
|
+
* @param useMutilPeerC 是否使用多 peerConnection 发布资源
|
|
3627
|
+
* @param roomType 加入房间的类型 默认参数 RTCMode.RTC
|
|
3628
|
+
*/
|
|
3629
|
+
joinRTCRoom(roomId: string, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean, roomType?: RTCMode): Promise<{
|
|
3630
|
+
room?: RCRTCRoom;
|
|
3631
|
+
code: RCRTCCode;
|
|
3632
|
+
userIds?: string[];
|
|
3633
|
+
tracks?: RCRemoteTrack[];
|
|
3634
|
+
}>;
|
|
3635
|
+
/**
|
|
3636
|
+
* 主播加入直播房间或观众上麦场景调用,观众上麦之前需先取消已订阅的直播间资源
|
|
3637
|
+
* @param roomId 房间 Id
|
|
3638
|
+
* @param livingType 直播间类型,`RCLivingType.AUDIO` 为音频直播,`RCLivingType.VIDEO` 为音视频直播
|
|
3639
|
+
* @param joinType 多端处理方式,公有云暂不支持该字段
|
|
3640
|
+
* @param outerUserDatas 业务层设置人员属性
|
|
3641
|
+
*/
|
|
3642
|
+
joinLivingRoom(roomId: string, livingType: RCLivingType, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean): Promise<{
|
|
3643
|
+
room?: RCLivingRoom;
|
|
3644
|
+
code: RCRTCCode;
|
|
3645
|
+
userIds?: string[];
|
|
3646
|
+
tracks?: RCRemoteTrack[];
|
|
3647
|
+
CDNEnable?: boolean;
|
|
3648
|
+
}>;
|
|
3649
|
+
private _audience;
|
|
3650
|
+
/**
|
|
3651
|
+
* 获取直播观众客户端
|
|
3652
|
+
*/
|
|
3653
|
+
getAudienceClient(useMutilPeerC?: boolean): RCAudienceClient;
|
|
3654
|
+
private _onIMStatusChange;
|
|
3655
|
+
private _onIMDisconnect;
|
|
3656
|
+
private _onIMUninit;
|
|
3657
|
+
/**
|
|
3658
|
+
* 退出并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
3659
|
+
*/
|
|
3660
|
+
leaveRoom(room: RCAbstractRoom): Promise<{
|
|
3661
|
+
code: RCRTCCode;
|
|
3662
|
+
}>;
|
|
3625
3663
|
private _crtAudienceLivingRoom;
|
|
3626
3664
|
/**
|
|
3627
3665
|
* 观众加入直播房间
|
|
@@ -3721,4 +3759,4 @@ declare const helper: {
|
|
|
3721
3759
|
ifSupportScreenShare: typeof ifSupportScreenShare;
|
|
3722
3760
|
};
|
|
3723
3761
|
|
|
3724
|
-
export { BackgroundPictureFillMode, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCCameraVideoTrack, RCFrameRate, RCInnerCDNPullIsHttps, RCInnerCDNPullKind, RCKickReason, RCLivingRoom, RCLivingType, RCLocalAudioTrack, RCLocalFileAudioTrack, RCLocalFileTrack, RCLocalFileVideoTrack, RCLocalTrack, RCLocalVideoTrack, RCMCUConfigBuilder, RCMediaType, RCMicphoneAudioTrack, RCRTCClient, RCRTCCode, RCRTCLiveRole, RCRTCPingResult, RCRTCRoom, RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack, RCResolution, RCScreenVideoTrack, RCTag, RCTrack, device, helper, installer };
|
|
3762
|
+
export { BackgroundPictureFillMode, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPubSuccessRes, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCAudioBitrate, RCCameraVideoTrack, RCFrameRate, RCInnerCDNPullIsHttps, RCInnerCDNPullKind, RCKickReason, RCLivingRoom, RCLivingType, RCLocalAudioTrack, RCLocalFileAudioTrack, RCLocalFileTrack, RCLocalFileVideoTrack, RCLocalTrack, RCLocalVideoTrack, RCMCUConfigBuilder, RCMediaStreamCapture, RCMediaType, RCMicphoneAudioTrack, RCRTCClient, RCRTCCode, RCRTCLiveRole, RCRTCPingResult, RCRTCRoom, RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack, RCResolution, RCScreenAudioTrack, RCScreenVideoTrack, RCTag, RCTrack, RCVideoBitrate, device, helper, installer };
|