@rongcloud/plugin-rtc 5.4.2 → 5.4.4-alpha.2
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 +88 -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 +29 -0
- package/dist/core/tracks/RCTrack.d.ts +90 -0
- package/dist/core/webrtc/RCRTCPeerCManager.d.ts +159 -0
- package/dist/core/webrtc/RCRTCPeerConnection.d.ts +112 -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 +205 -158
- package/dist/index.esm.js +18244 -15
- package/dist/index.js +18276 -15
- package/dist/index.umd.js +18280 -15
- 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.2
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.4.4-alpha.2
|
|
3
|
+
* CommitId - d4522cc8f360c18bd7c52c4ee73731d9845ffb89
|
|
4
|
+
* Wed Aug 03 2022 17:46:00 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';
|
|
@@ -50,7 +50,7 @@ declare enum RCRTCCode {
|
|
|
50
50
|
/** 获取屏幕共享流失败 */
|
|
51
51
|
GET_DISPLAY_MEDIA_FAILED = 53011,
|
|
52
52
|
/** 权限问题导致获取媒体流被拒绝 */
|
|
53
|
-
|
|
53
|
+
BROWSER_PERMISSION_DENIED = 53012,
|
|
54
54
|
/** 创建自定义流失败 */
|
|
55
55
|
CREATE_CUSTOM_TRACK_FAILED = 53013,
|
|
56
56
|
/** 无效的 TAG 定义 */
|
|
@@ -88,7 +88,11 @@ 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,
|
|
94
|
+
/** 获取媒体资源时,无系统权限 */
|
|
95
|
+
SYSTEM_PERMISSION_DENIED = 53033
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
/**
|
|
@@ -213,7 +217,7 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
213
217
|
*/
|
|
214
218
|
play(element?: HTMLVideoElement, options?: {
|
|
215
219
|
volume?: number;
|
|
216
|
-
audioDeviceId
|
|
220
|
+
audioDeviceId?: string;
|
|
217
221
|
}): Promise<{
|
|
218
222
|
code: RCRTCCode;
|
|
219
223
|
}>;
|
|
@@ -230,6 +234,47 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
230
234
|
private __validateVideoNodeName;
|
|
231
235
|
}
|
|
232
236
|
|
|
237
|
+
declare enum RCAudioBitrate {
|
|
238
|
+
/**
|
|
239
|
+
* 标清音质
|
|
240
|
+
*/
|
|
241
|
+
Speech = "Speech",
|
|
242
|
+
/**
|
|
243
|
+
* 音乐音质
|
|
244
|
+
*/
|
|
245
|
+
Music = "Music",
|
|
246
|
+
/**
|
|
247
|
+
* 音乐高清音质
|
|
248
|
+
*/
|
|
249
|
+
MusicHigh = "MusicHigh"
|
|
250
|
+
}
|
|
251
|
+
declare enum RCVideoBitrate {
|
|
252
|
+
/**
|
|
253
|
+
* Bitrate { max: 150, min: 80 }
|
|
254
|
+
*/
|
|
255
|
+
LEVEL0 = "LEVEL0",
|
|
256
|
+
/**
|
|
257
|
+
* Bitrate { max: 280, min: 120 }
|
|
258
|
+
*/
|
|
259
|
+
LEVEL1 = "LEVEL1",
|
|
260
|
+
/**
|
|
261
|
+
* Bitrate { max: 650, min: 150 }
|
|
262
|
+
*/
|
|
263
|
+
LEVEL2 = "LEVEL2",
|
|
264
|
+
/**
|
|
265
|
+
* Bitrate { max: 1000, min: 200 }
|
|
266
|
+
*/
|
|
267
|
+
LEVEL3 = "LEVEL3",
|
|
268
|
+
/**
|
|
269
|
+
* Bitrate { max: 2200, min: 250 }
|
|
270
|
+
*/
|
|
271
|
+
LEVEL4 = "LEVEL4",
|
|
272
|
+
/**
|
|
273
|
+
* Bitrate { max: 4000, min: 400 }
|
|
274
|
+
*/
|
|
275
|
+
LEVEL5 = "LEVEL5"
|
|
276
|
+
}
|
|
277
|
+
|
|
233
278
|
declare abstract class RCLocalTrack extends RCTrack {
|
|
234
279
|
/**
|
|
235
280
|
* 本地流结束事件通知
|
|
@@ -279,17 +324,16 @@ declare abstract class RCLocalTrack extends RCTrack {
|
|
|
279
324
|
declare class RCLocalAudioTrack extends RCLocalTrack {
|
|
280
325
|
constructor(tag: string, userId: string, track: MediaStreamTrack);
|
|
281
326
|
/**
|
|
282
|
-
*
|
|
283
|
-
* @param
|
|
284
|
-
* @param min 最小码率,`0` 表示不限制
|
|
285
|
-
* @param start 起始码率
|
|
327
|
+
* 它设置推荐的音频码率。
|
|
328
|
+
* @param {RCAudioBitrate} audio - RCA音频比特率
|
|
286
329
|
*/
|
|
287
|
-
|
|
330
|
+
setRecommendBitrate(audio: RCAudioBitrate): void;
|
|
288
331
|
/**
|
|
289
|
-
*
|
|
290
|
-
* @
|
|
332
|
+
* 它设置视频的比特率。
|
|
333
|
+
* @param {number} max - 客户端将使用的最大比特率。
|
|
334
|
+
* @param {number[]} args - [分钟,开始]
|
|
291
335
|
*/
|
|
292
|
-
|
|
336
|
+
setBitrate(max: number, ...args: number[]): void;
|
|
293
337
|
}
|
|
294
338
|
declare class RCLocalVideoTrack extends RCLocalTrack {
|
|
295
339
|
private _isTiny;
|
|
@@ -297,6 +341,17 @@ declare class RCLocalVideoTrack extends RCLocalTrack {
|
|
|
297
341
|
__isTiny(): boolean;
|
|
298
342
|
getStreamId(): string;
|
|
299
343
|
getTrackId(): string;
|
|
344
|
+
/**
|
|
345
|
+
* 它设置推荐的音频码率
|
|
346
|
+
* @param {RCVideoBitrate} video - RC视频比特率
|
|
347
|
+
*/
|
|
348
|
+
setRecommendBitrate(video: RCVideoBitrate): void;
|
|
349
|
+
/**
|
|
350
|
+
* 它设置视频的比特率。
|
|
351
|
+
* @param {number} max - 视频可以编码的最大比特率。
|
|
352
|
+
* @param {number[]} args - [最大、最小、开始]
|
|
353
|
+
*/
|
|
354
|
+
setBitrate(max: number, ...args: number[]): void;
|
|
300
355
|
}
|
|
301
356
|
declare abstract class RCLocalFileTrack extends RCLocalTrack {
|
|
302
357
|
/**
|
|
@@ -334,6 +389,8 @@ declare class RCCameraVideoTrack extends RCLocalVideoTrack {
|
|
|
334
389
|
}
|
|
335
390
|
declare class RCScreenVideoTrack extends RCLocalVideoTrack {
|
|
336
391
|
}
|
|
392
|
+
declare class RCScreenAudioTrack extends RCLocalAudioTrack {
|
|
393
|
+
}
|
|
337
394
|
|
|
338
395
|
declare class RCRemoteTrack extends RCTrack {
|
|
339
396
|
constructor(tag: string, userId: string, kind: 'audio' | 'video', roomId?: string);
|
|
@@ -355,6 +412,12 @@ declare class RCRemoteAudioTrack extends RCRemoteTrack {
|
|
|
355
412
|
}
|
|
356
413
|
declare class RCRemoteVideoTrack extends RCRemoteTrack {
|
|
357
414
|
constructor(tag: string, userId: string, roomId?: string);
|
|
415
|
+
private _isSubTiny;
|
|
416
|
+
__innerSetIsTinyTrack(bool: boolean): void;
|
|
417
|
+
/**
|
|
418
|
+
* 是否订阅的小流
|
|
419
|
+
*/
|
|
420
|
+
isSubTiny(): boolean;
|
|
358
421
|
}
|
|
359
422
|
|
|
360
423
|
/**
|
|
@@ -1011,99 +1074,27 @@ interface IMCUOutputConfig {
|
|
|
1011
1074
|
pushurl: string;
|
|
1012
1075
|
}[];
|
|
1013
1076
|
}
|
|
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
1077
|
/**
|
|
1090
1078
|
* 合流前的单一视频流水印配置
|
|
1079
|
+
*【客户端仅提供图片水印设置】
|
|
1091
1080
|
*/
|
|
1092
|
-
interface IMCUSignalScreenWaterMarkConfig
|
|
1081
|
+
interface IMCUSignalScreenWaterMarkConfig {
|
|
1093
1082
|
/**
|
|
1094
1083
|
* 媒体流的 msid
|
|
1095
1084
|
*/
|
|
1096
1085
|
streamId: string;
|
|
1086
|
+
picture: IPictureAttrs[];
|
|
1097
1087
|
}
|
|
1098
1088
|
interface IMCUWaterMarkConfig {
|
|
1089
|
+
enable: 'on' | 'off';
|
|
1099
1090
|
/**
|
|
1100
1091
|
* 合流后的屏幕水印配置
|
|
1092
|
+
*【客户端暂不提供合流水印设置】
|
|
1101
1093
|
*/
|
|
1102
|
-
mixScreen: IWaterMarkConfig;
|
|
1103
1094
|
/**
|
|
1104
1095
|
* 合流前的单人视频流水印配置
|
|
1105
1096
|
*/
|
|
1106
|
-
|
|
1097
|
+
singleScreen: IMCUSignalScreenWaterMarkConfig[];
|
|
1107
1098
|
}
|
|
1108
1099
|
/**
|
|
1109
1100
|
* 发布到服务器的 MCU 配置数据
|
|
@@ -1112,7 +1103,7 @@ interface IMCUConfig {
|
|
|
1112
1103
|
/**
|
|
1113
1104
|
* 为向后兼容,当前为常量 1
|
|
1114
1105
|
*/
|
|
1115
|
-
version:
|
|
1106
|
+
version: 2;
|
|
1116
1107
|
/**
|
|
1117
1108
|
* 布局模式,在只配置推流 CDN 时,该值不存在
|
|
1118
1109
|
*/
|
|
@@ -1438,7 +1429,7 @@ declare abstract class ReadableStore {
|
|
|
1438
1429
|
* 远端 track
|
|
1439
1430
|
*/
|
|
1440
1431
|
protected _remoteTracks: {
|
|
1441
|
-
[trackId: string]:
|
|
1432
|
+
[trackId: string]: RCRemoteAudioTrack | RCRemoteVideoTrack;
|
|
1442
1433
|
};
|
|
1443
1434
|
/**
|
|
1444
1435
|
* 已订阅参数
|
|
@@ -1464,7 +1455,7 @@ declare abstract class ReadableStore {
|
|
|
1464
1455
|
getRemoteTrack(trackId: string): RCRemoteTrack | undefined;
|
|
1465
1456
|
getRemoteTracksByUserId(userId: string): RCRemoteTrack[];
|
|
1466
1457
|
getRemoteTracks(): {
|
|
1467
|
-
[trackId: string]:
|
|
1458
|
+
[trackId: string]: RCRemoteAudioTrack | RCRemoteVideoTrack;
|
|
1468
1459
|
};
|
|
1469
1460
|
getSessionId(): string;
|
|
1470
1461
|
getAllUserIds(): string[];
|
|
@@ -1771,6 +1762,7 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
1771
1762
|
private _handlePingResult;
|
|
1772
1763
|
/**
|
|
1773
1764
|
* 设置房间上行资源的总码率配置
|
|
1765
|
+
* @deprecated use RCLocalTrack.setBitrate instead of setBitrate
|
|
1774
1766
|
* @description
|
|
1775
1767
|
* * 自 v5.1.0 版本开始,推荐使用 `RCLocalTrack.setBitrate` 对不同流分别指定码率。
|
|
1776
1768
|
* * 该方法仅在 SDP `plan-b` 协议下(Chrome 92 与 Safari 11 之前的版本)有效。
|
|
@@ -2424,6 +2416,7 @@ declare class RCRTCPeerConnection extends EventEmitter {
|
|
|
2424
2416
|
private _reTryExchangeTimer;
|
|
2425
2417
|
private _reportStatsTimer;
|
|
2426
2418
|
private _reportR3R4ToPolarisTimer;
|
|
2419
|
+
private _isDestroyed;
|
|
2427
2420
|
constructor(
|
|
2428
2421
|
/**
|
|
2429
2422
|
* peerConnection 对应名称
|
|
@@ -2446,6 +2439,10 @@ declare class RCRTCPeerConnection extends EventEmitter {
|
|
|
2446
2439
|
private _onConnectionStateChange;
|
|
2447
2440
|
private _onICEConnectionStateChange;
|
|
2448
2441
|
private _onTrackReady;
|
|
2442
|
+
/**
|
|
2443
|
+
* 它设置对等连接的比特率。
|
|
2444
|
+
* @deprecated use RCLocalTrack.setBitrate instead of setBitrate
|
|
2445
|
+
*/
|
|
2449
2446
|
setBitrate(max: number, min: number, start?: number): Promise<void>;
|
|
2450
2447
|
createOffer(iceRestart: boolean): Promise<IOfferInfo>;
|
|
2451
2448
|
setRemoteAnswer(answer: string): Promise<RCRTCCode>;
|
|
@@ -2494,6 +2491,7 @@ declare class RCRTCPeerConnection extends EventEmitter {
|
|
|
2494
2491
|
getRTCPeerConn(): RTCPeerConnection;
|
|
2495
2492
|
destroy(): void;
|
|
2496
2493
|
clearReTryExchangeTimer(): void;
|
|
2494
|
+
isDestroyed(): boolean;
|
|
2497
2495
|
}
|
|
2498
2496
|
|
|
2499
2497
|
interface IRCTrackBitrate {
|
|
@@ -2577,7 +2575,8 @@ interface IVideoProfile {
|
|
|
2577
2575
|
*/
|
|
2578
2576
|
interface IScreenVideoProfile extends IVideoProfile {
|
|
2579
2577
|
/**
|
|
2580
|
-
* Electron 平台下通过 `desktopCapturer.getSources` 获取到的 sourceId
|
|
2578
|
+
* Electron 平台下通过 `desktopCapturer.getSources` 获取到的 sourceId,
|
|
2579
|
+
* 不传 chromeMediaSourceId 时默认共享桌面,传入时共享指定窗口。
|
|
2581
2580
|
* @see `https://www.electronjs.org/docs/api/desktop-capturer`
|
|
2582
2581
|
*/
|
|
2583
2582
|
chromeMediaSourceId?: string;
|
|
@@ -2830,7 +2829,7 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
2830
2829
|
* 另一种可能是己方 rtcPing 失败次数超出上限
|
|
2831
2830
|
* @param byServer 当值为 `false` 时,说明本端 rtcPing 超时;当值为 `true` 时,说明本端收到被踢出房间通知
|
|
2832
2831
|
*/
|
|
2833
|
-
onKickOff?(byServer: boolean, state?: RCKickReason): void;
|
|
2832
|
+
onKickOff?(byServer: boolean, state?: RCKickReason, kickExtra?: any): void;
|
|
2834
2833
|
/**
|
|
2835
2834
|
* 接收到房间信令时回调,用户可通过房间实例的 sendMessage 接口发送信令
|
|
2836
2835
|
* @param name 信令名
|
|
@@ -3254,6 +3253,19 @@ declare class RCMCUConfigBuilder {
|
|
|
3254
3253
|
* @since v5.3.7
|
|
3255
3254
|
*/
|
|
3256
3255
|
clearCustomizeInputAudio(): RCMCUConfigBuilder;
|
|
3256
|
+
/**
|
|
3257
|
+
* 给单道流添加水印
|
|
3258
|
+
*/
|
|
3259
|
+
addPictureWaterMark(trackId: string, uri: string, x: number, y: number, w: number, h: number): RCMCUConfigBuilder;
|
|
3260
|
+
/**
|
|
3261
|
+
* 删除所有水印
|
|
3262
|
+
*/
|
|
3263
|
+
clearPictureWaterMark(): RCMCUConfigBuilder;
|
|
3264
|
+
/**
|
|
3265
|
+
* 移除对合流后的某个视频流中添加的指定水印图片
|
|
3266
|
+
* @param uri
|
|
3267
|
+
*/
|
|
3268
|
+
removePictureWaterMark(trackId: string, uri: string): RCMCUConfigBuilder;
|
|
3257
3269
|
/**
|
|
3258
3270
|
* 设置 MCU 混流配置
|
|
3259
3271
|
* @param videoList 视频输入混流列表,为 null 代表视频全混流,为空集合代表视频全不混流,否则按照输入列表进行混流
|
|
@@ -3474,68 +3486,19 @@ declare class RCAudienceClient {
|
|
|
3474
3486
|
private _onTrackReady;
|
|
3475
3487
|
}
|
|
3476
3488
|
|
|
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;
|
|
3489
|
+
declare class RCMediaStreamCapture {
|
|
3490
|
+
protected readonly _context: RTCPluginContext;
|
|
3491
|
+
constructor(_context: RTCPluginContext);
|
|
3492
|
+
private _isElectron;
|
|
3493
|
+
private _getMediaStream;
|
|
3532
3494
|
/**
|
|
3533
|
-
*
|
|
3495
|
+
* 如果用户设置了音频约束为true,那么我们将音频约束设置为一个空对象,
|
|
3496
|
+
* 然后我们将检查浏览器是否支持noiseSuppression、autoGainControl和echoCancellation约束,
|
|
3497
|
+
* 如果支持,那么我们将设置音频约束为真
|
|
3498
|
+
* @param {any} constraints - 约束参数与 getUserMedia 方法中的约束参数相同。
|
|
3499
|
+
* @returns 返回值是约束对象。
|
|
3534
3500
|
*/
|
|
3535
|
-
|
|
3536
|
-
code: RCRTCCode;
|
|
3537
|
-
}>;
|
|
3538
|
-
private _getMediaStream;
|
|
3501
|
+
private setConstraintsConfig;
|
|
3539
3502
|
/**
|
|
3540
3503
|
* 从麦克风中捕获音轨数据
|
|
3541
3504
|
* @param tag
|
|
@@ -3581,6 +3544,18 @@ declare class RCRTCClient {
|
|
|
3581
3544
|
code: RCRTCCode;
|
|
3582
3545
|
track?: RCScreenVideoTrack;
|
|
3583
3546
|
}>;
|
|
3547
|
+
/**
|
|
3548
|
+
* 创建带音频的屏幕共享资源
|
|
3549
|
+
* @param tag 屏幕共享视轨数据标识
|
|
3550
|
+
* @param options
|
|
3551
|
+
* @description electron 中 mac 系统暂不支持屏幕共享采集声音
|
|
3552
|
+
* @returns 在可以取到音频的情况下,tracks 中包含音轨和视轨;取不到音视频时 tracks 仅返回视轨
|
|
3553
|
+
*/
|
|
3554
|
+
createScreenWithAudioTracks(tag?: string, options?: IScreenVideoProfile): Promise<{
|
|
3555
|
+
code: RCRTCCode;
|
|
3556
|
+
tracks?: (RCScreenVideoTrack | RCScreenAudioTrack)[];
|
|
3557
|
+
}>;
|
|
3558
|
+
private _createScreenTracks;
|
|
3584
3559
|
/**
|
|
3585
3560
|
* 创建 RCLocalAudioTrack 实例
|
|
3586
3561
|
* @param tag
|
|
@@ -3622,6 +3597,78 @@ declare class RCRTCClient {
|
|
|
3622
3597
|
code: RCRTCCode;
|
|
3623
3598
|
tracks: RCLocalTrack[];
|
|
3624
3599
|
}>;
|
|
3600
|
+
/**
|
|
3601
|
+
* 它接受一个 MediaStream 和一个可选的选项对象并返回一个 MediaStreamTracks 数组
|
|
3602
|
+
* @param {MediaStream} stream - MediaStream - 从中获取曲目的流。
|
|
3603
|
+
* @param {ICreateLocalTrackOptions} [options] - ICreateLocalTrackOptions
|
|
3604
|
+
* @returns 一组 MediaStreamTrack 对象。
|
|
3605
|
+
*/
|
|
3606
|
+
static getTracksWithOptions(stream: MediaStream, options?: ICreateLocalTrackOptions): Array<MediaStreamTrack | undefined>;
|
|
3607
|
+
}
|
|
3608
|
+
|
|
3609
|
+
/**
|
|
3610
|
+
* RTC 业务客户端
|
|
3611
|
+
* @public
|
|
3612
|
+
*/
|
|
3613
|
+
declare class RCRTCClient extends RCMediaStreamCapture {
|
|
3614
|
+
protected readonly _context: RTCPluginContext;
|
|
3615
|
+
private readonly _runtime;
|
|
3616
|
+
private readonly _options;
|
|
3617
|
+
private readonly _service;
|
|
3618
|
+
constructor(_context: RTCPluginContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
|
|
3619
|
+
private _handleMessage;
|
|
3620
|
+
/**
|
|
3621
|
+
* 获取加入的连麦房间
|
|
3622
|
+
*/
|
|
3623
|
+
private _getJoinedPKRoomList;
|
|
3624
|
+
/**
|
|
3625
|
+
* 获取当前用户 Id,若 IM 未连接,这返回 `''`
|
|
3626
|
+
* @returns
|
|
3627
|
+
*/
|
|
3628
|
+
getCurrentId(): string;
|
|
3629
|
+
private _crtRoom;
|
|
3630
|
+
/**
|
|
3631
|
+
* 加入普通音视频房间
|
|
3632
|
+
* @param roomId
|
|
3633
|
+
* @param joinType 多端处理方式
|
|
3634
|
+
* @param outerUserDatas 业务层设置人员属性
|
|
3635
|
+
* @param useMutilPeerC 是否使用多 peerConnection 发布资源
|
|
3636
|
+
* @param roomType 加入房间的类型 默认参数 RTCMode.RTC
|
|
3637
|
+
*/
|
|
3638
|
+
joinRTCRoom(roomId: string, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean, roomType?: RTCMode): Promise<{
|
|
3639
|
+
room?: RCRTCRoom;
|
|
3640
|
+
code: RCRTCCode;
|
|
3641
|
+
userIds?: string[];
|
|
3642
|
+
tracks?: RCRemoteTrack[];
|
|
3643
|
+
}>;
|
|
3644
|
+
/**
|
|
3645
|
+
* 主播加入直播房间或观众上麦场景调用,观众上麦之前需先取消已订阅的直播间资源
|
|
3646
|
+
* @param roomId 房间 Id
|
|
3647
|
+
* @param livingType 直播间类型,`RCLivingType.AUDIO` 为音频直播,`RCLivingType.VIDEO` 为音视频直播
|
|
3648
|
+
* @param joinType 多端处理方式,公有云暂不支持该字段
|
|
3649
|
+
* @param outerUserDatas 业务层设置人员属性
|
|
3650
|
+
*/
|
|
3651
|
+
joinLivingRoom(roomId: string, livingType: RCLivingType, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean): Promise<{
|
|
3652
|
+
room?: RCLivingRoom;
|
|
3653
|
+
code: RCRTCCode;
|
|
3654
|
+
userIds?: string[];
|
|
3655
|
+
tracks?: RCRemoteTrack[];
|
|
3656
|
+
CDNEnable?: boolean;
|
|
3657
|
+
}>;
|
|
3658
|
+
private _audience;
|
|
3659
|
+
/**
|
|
3660
|
+
* 获取直播观众客户端
|
|
3661
|
+
*/
|
|
3662
|
+
getAudienceClient(useMutilPeerC?: boolean): RCAudienceClient;
|
|
3663
|
+
private _onIMStatusChange;
|
|
3664
|
+
private _onIMDisconnect;
|
|
3665
|
+
private _onIMUninit;
|
|
3666
|
+
/**
|
|
3667
|
+
* 退出并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
3668
|
+
*/
|
|
3669
|
+
leaveRoom(room: RCAbstractRoom): Promise<{
|
|
3670
|
+
code: RCRTCCode;
|
|
3671
|
+
}>;
|
|
3625
3672
|
private _crtAudienceLivingRoom;
|
|
3626
3673
|
/**
|
|
3627
3674
|
* 观众加入直播房间
|
|
@@ -3721,4 +3768,4 @@ declare const helper: {
|
|
|
3721
3768
|
ifSupportScreenShare: typeof ifSupportScreenShare;
|
|
3722
3769
|
};
|
|
3723
3770
|
|
|
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 };
|
|
3771
|
+
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 };
|