@rongcloud/plugin-rtc 5.36.0 → 5.36.1-nctest-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -1
- package/dist/index.d.ts +36 -95
- package/dist/index.esm.js +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EventEmitter,
|
|
1
|
+
import { LogL, EnableLogL, IPluginGenerator } from '@nexconn/engine';
|
|
2
|
+
import { EventEmitter, IPromiseResult, IRuntime, IAsyncRes, RTCMode as RTCMode$1 } from 'common-utils';
|
|
3
|
+
import * as _base_imlib_wrapper from '@base/imlib-wrapper';
|
|
4
|
+
import { BasicLogger, IRTCPluginContext, ErrorCode, IRTCNaviInfo, ConversationType, ISendMsgOptions, IReceivedMessage, RCConnectionStatus } from '@base/imlib-wrapper';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* 错误码,与移动端对齐
|
|
@@ -916,11 +918,6 @@ interface ICDNUris {
|
|
|
916
918
|
'pull_safe': boolean;
|
|
917
919
|
}
|
|
918
920
|
|
|
919
|
-
declare enum RCRTCAISwitchType {
|
|
920
|
-
OPEN = 1,
|
|
921
|
-
CLOSE = 0
|
|
922
|
-
}
|
|
923
|
-
|
|
924
921
|
/**
|
|
925
922
|
* 设置 RTC 人员 inner、outer 数据
|
|
926
923
|
*/
|
|
@@ -1092,28 +1089,6 @@ interface IEndRoomPKOptions {
|
|
|
1092
1089
|
*/
|
|
1093
1090
|
keys: string[];
|
|
1094
1091
|
}
|
|
1095
|
-
interface IRTCNaviInfo extends INaviInfo {
|
|
1096
|
-
/**
|
|
1097
|
-
* jwt token
|
|
1098
|
-
*/
|
|
1099
|
-
jwt?: string;
|
|
1100
|
-
/**
|
|
1101
|
-
* http3 上报域名
|
|
1102
|
-
*/
|
|
1103
|
-
logServer?: string;
|
|
1104
|
-
/**
|
|
1105
|
-
* 数据中心
|
|
1106
|
-
*/
|
|
1107
|
-
dc?: string;
|
|
1108
|
-
/**
|
|
1109
|
-
* openGzip 开启标识,默认是false,开启使用true
|
|
1110
|
-
*/
|
|
1111
|
-
openGzip?: boolean;
|
|
1112
|
-
/**
|
|
1113
|
-
* AI 开关是否打开,1: 打开,0: 关闭
|
|
1114
|
-
*/
|
|
1115
|
-
rtcAISwitch?: RCRTCAISwitchType;
|
|
1116
|
-
}
|
|
1117
1092
|
|
|
1118
1093
|
declare enum RCRTCOperateSummarizationType {
|
|
1119
1094
|
OPEN = "2",
|
|
@@ -1282,52 +1257,10 @@ declare enum RTCApiType {
|
|
|
1282
1257
|
}
|
|
1283
1258
|
|
|
1284
1259
|
declare enum RTCIdentityChangeType {
|
|
1285
|
-
AnchorToViewer = 1
|
|
1260
|
+
AnchorToViewer = 1,// 主播变观众
|
|
1286
1261
|
ViewerToAnchor = 2
|
|
1287
1262
|
}
|
|
1288
1263
|
|
|
1289
|
-
declare const keymaps: {
|
|
1290
|
-
readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas", "supportNtf"];
|
|
1291
|
-
readonly RtcOutput: readonly ["version"];
|
|
1292
|
-
readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo", "version"];
|
|
1293
|
-
readonly SetUserStatusInput: readonly ["status"];
|
|
1294
|
-
readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
|
|
1295
|
-
readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
|
|
1296
|
-
readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
|
|
1297
|
-
readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
|
|
1298
|
-
readonly MCFollowInput: readonly ["state"];
|
|
1299
|
-
readonly RtcTokenOutput: readonly ["rtcToken"];
|
|
1300
|
-
readonly RtcQryOutput: readonly ["outInfo"];
|
|
1301
|
-
readonly RtcQryUserOutDataInput: readonly ["userId"];
|
|
1302
|
-
readonly RtcUserOutDataOutput: readonly ["user"];
|
|
1303
|
-
readonly RtcQueryListInput: readonly ["order"];
|
|
1304
|
-
readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
|
|
1305
|
-
readonly RtcValueInfo: readonly ["key", "value"];
|
|
1306
|
-
readonly RtcKeyDeleteInput: readonly ["key"];
|
|
1307
|
-
readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
|
|
1308
|
-
readonly RtcPullKV: readonly ["timestamp", "roomId"];
|
|
1309
|
-
readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
|
|
1310
|
-
readonly RtcQueryUserJoinedInput: readonly ["userId"];
|
|
1311
|
-
readonly RtcQueryUserJoinedOutput: readonly ["info"];
|
|
1312
|
-
readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
1313
|
-
readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
1314
|
-
readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
|
|
1315
|
-
readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
|
|
1316
|
-
readonly RtcRoomStatusInput: readonly ["version"];
|
|
1317
|
-
readonly RtcRoomStatusOutput: readonly ["bFullStatus", "version", "usersData", "roomStatus"];
|
|
1318
|
-
readonly RtcReportSDKInput: readonly ["sdkInfo"];
|
|
1319
|
-
readonly RCRTCPBPolaris: readonly ["type", "appKey", "sessionId", "roomId", "roomCreateTime", "userId", "userRole", "joinTime", "signalDataCenter", "r1Info", "r2Info", "r3Info", "r4Info"];
|
|
1320
|
-
readonly RCRTCPBR1Info: readonly ["joinTime", "rtcVersion", "imVersion", "platform", "device", "os", "browserName", "browserVersion"];
|
|
1321
|
-
readonly RCRTCPBR2Info: readonly ["joinTime", "sendTime", "rtcActionType", "rtcActionStatus", "trackId"];
|
|
1322
|
-
readonly RCRTCPBR3Info: readonly ["info"];
|
|
1323
|
-
readonly RCRTCPBR4Info: readonly ["info"];
|
|
1324
|
-
readonly RCRTCPBStatusInfo: readonly ["joinTime", "receiveTime", "totalBitRate", "appCPUUsage", "systemCPUUsage", "systemCPUFrequency", "networkStatus", "googleRTTNetwork", "ipAddress", "useReceiveBroadBand", "useSendBroadBand", "packetLossCount", "streams"];
|
|
1325
|
-
readonly RCRTCPBStreamInfo: readonly ["trackId", "codeName", "volume", "samplingRate", "bitRate", "packetLossRate", "frameRate", "resolution", "blockTime", "jitterData", "nAckCount", "pliCount", "googleRTTTotalTime", "isReceiveFirstFrameRate", "codeType", "isEnabled"];
|
|
1326
|
-
readonly AsrTextMsg: readonly ["bms", "t", "isEnd", "msgId", "lang"];
|
|
1327
|
-
readonly AsrResTextMsg: readonly ["type", "uid", "asr"];
|
|
1328
|
-
};
|
|
1329
|
-
declare type RTCKeyMaps = typeof keymaps;
|
|
1330
|
-
|
|
1331
1264
|
/**
|
|
1332
1265
|
* 自定义上报北极星数据响应 code
|
|
1333
1266
|
*/
|
|
@@ -1340,11 +1273,11 @@ declare enum RCSendCode {
|
|
|
1340
1273
|
|
|
1341
1274
|
declare class RTCContext {
|
|
1342
1275
|
private context;
|
|
1343
|
-
logger: BasicLogger;
|
|
1344
|
-
private codec;
|
|
1345
1276
|
roomCreateTime: number | undefined;
|
|
1346
1277
|
userJoinTime: number | undefined;
|
|
1347
|
-
|
|
1278
|
+
private codec;
|
|
1279
|
+
constructor(context: IRTCPluginContext);
|
|
1280
|
+
get logger(): _base_imlib_wrapper.BasicLogger;
|
|
1348
1281
|
joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData, supportNtf?: boolean): IPromiseResult<IJoinRTCRoomData>;
|
|
1349
1282
|
quitRTCRoom(roomId: string): Promise<ErrorCode>;
|
|
1350
1283
|
getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
|
|
@@ -1370,7 +1303,9 @@ declare class RTCContext {
|
|
|
1370
1303
|
content: string;
|
|
1371
1304
|
}[], valueInfo: string, objectName: string, mcuValInfo?: string, cdnValInfo?: string): Promise<ErrorCode>;
|
|
1372
1305
|
setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
|
|
1373
|
-
getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<
|
|
1306
|
+
getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<{
|
|
1307
|
+
[key: string]: string;
|
|
1308
|
+
}>;
|
|
1374
1309
|
removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
|
|
1375
1310
|
name: string;
|
|
1376
1311
|
content: string;
|
|
@@ -1412,7 +1347,7 @@ declare class RTCContext {
|
|
|
1412
1347
|
};
|
|
1413
1348
|
getCurrentId(): string;
|
|
1414
1349
|
getNaviInfo(): IRTCNaviInfo | null;
|
|
1415
|
-
getConnectionStatus():
|
|
1350
|
+
getConnectionStatus(): number;
|
|
1416
1351
|
getAppkey(): string;
|
|
1417
1352
|
/** web 端发 rtcPing */
|
|
1418
1353
|
webRtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<{
|
|
@@ -1425,12 +1360,10 @@ declare class RTCContext {
|
|
|
1425
1360
|
* 协议栈 rtcping 依赖 imlib 编解码数据
|
|
1426
1361
|
* web 单独走 imlib 提供的 rtcSignaling 方法,减少对 imlib 的依赖
|
|
1427
1362
|
*/
|
|
1428
|
-
rtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<
|
|
1429
|
-
code:
|
|
1430
|
-
data?:
|
|
1431
|
-
|
|
1432
|
-
} | undefined;
|
|
1433
|
-
}>;
|
|
1363
|
+
rtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<{
|
|
1364
|
+
code: number;
|
|
1365
|
+
data?: _base_imlib_wrapper.IRtcPingData | undefined;
|
|
1366
|
+
}> | undefined;
|
|
1434
1367
|
sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
1435
1368
|
registerRTCSignalListener(listener?: ((buffer: Uint8Array) => void) | undefined): void;
|
|
1436
1369
|
registerConnectionStateChangeListener(listener: (status: RCConnectionStatus, code: ErrorCode) => void): void;
|
|
@@ -1438,20 +1371,20 @@ declare class RTCContext {
|
|
|
1438
1371
|
registerDestroyListener(listener: () => void): void;
|
|
1439
1372
|
registerMessageListener(listener: (message: IReceivedMessage) => boolean): void;
|
|
1440
1373
|
getCoreVersion(): string;
|
|
1441
|
-
getPluginContext():
|
|
1374
|
+
getPluginContext(): IRTCPluginContext;
|
|
1442
1375
|
reportSDKInfo(versionInfo: {
|
|
1443
1376
|
[name: string]: string;
|
|
1444
1377
|
}): void;
|
|
1445
1378
|
decodeAsrText(buffer: Uint8Array, seiData: number[]): (RCRTCASRContent | RCRTCRealtimeTranslationContent)[];
|
|
1446
1379
|
}
|
|
1447
1380
|
|
|
1448
|
-
|
|
1381
|
+
type ISdpSemantics = 'plan-b' | 'unified-plan';
|
|
1449
1382
|
interface IOfferInfo {
|
|
1450
1383
|
type: 'offer';
|
|
1451
1384
|
sdp: string;
|
|
1452
1385
|
semantics: ISdpSemantics;
|
|
1453
1386
|
}
|
|
1454
|
-
|
|
1387
|
+
type OutboundVideoInfo = {
|
|
1455
1388
|
trackId: string;
|
|
1456
1389
|
simulcast: RCStreamType;
|
|
1457
1390
|
resolution: string;
|
|
@@ -1532,7 +1465,7 @@ declare enum PullRoomStatusEvent {
|
|
|
1532
1465
|
RESOURCECHANGE = 3
|
|
1533
1466
|
}
|
|
1534
1467
|
|
|
1535
|
-
|
|
1468
|
+
type RCEncryptFunction = (data: Uint8Array) => Uint8Array;
|
|
1536
1469
|
interface IRCEncryptorHooks {
|
|
1537
1470
|
/**
|
|
1538
1471
|
* @since 5.7.3
|
|
@@ -2362,7 +2295,7 @@ interface IAudioLevelChangeHandler {
|
|
|
2362
2295
|
/**
|
|
2363
2296
|
* 房间资源数据
|
|
2364
2297
|
*/
|
|
2365
|
-
|
|
2298
|
+
type RoomData = {
|
|
2366
2299
|
[userId: string]: IPublishedResource[];
|
|
2367
2300
|
};
|
|
2368
2301
|
/**
|
|
@@ -3020,7 +2953,7 @@ declare class ReportMediaActionLogger {
|
|
|
3020
2953
|
/**
|
|
3021
2954
|
* 加房间
|
|
3022
2955
|
*/
|
|
3023
|
-
reportQualityJoinRoomData: (start: number, code:
|
|
2956
|
+
reportQualityJoinRoomData: (start: number, code: number, roomType: RTCMode$1, sessionId?: string) => void;
|
|
3024
2957
|
/**
|
|
3025
2958
|
* 异常掉线
|
|
3026
2959
|
*/
|
|
@@ -3146,7 +3079,7 @@ declare enum RCLivingType {
|
|
|
3146
3079
|
AUDIO = 1
|
|
3147
3080
|
}
|
|
3148
3081
|
|
|
3149
|
-
|
|
3082
|
+
type IOnRecvPKMsg = (msg: IReceivedMessage) => void;
|
|
3150
3083
|
interface IRoomPKEventListener {
|
|
3151
3084
|
/**
|
|
3152
3085
|
* 收到连麦邀请
|
|
@@ -3302,7 +3235,7 @@ declare class RCLivingPKHandler {
|
|
|
3302
3235
|
};
|
|
3303
3236
|
}
|
|
3304
3237
|
|
|
3305
|
-
|
|
3238
|
+
type ResourceMsgContent = {
|
|
3306
3239
|
/**
|
|
3307
3240
|
* 旧版本兼容参数,当收到非 `RTCMessageName.TOTAL_CONTENT_RESOURCE` 时:
|
|
3308
3241
|
* * ignore 值为 `true` 表示该消息由 signal server 向旧版本 RTCLib 提供的兼容消息,无需处理
|
|
@@ -3489,7 +3422,9 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
3489
3422
|
*/
|
|
3490
3423
|
getRoomAttributes(keys?: string[], isInner?: boolean): Promise<{
|
|
3491
3424
|
code: RCRTCCode;
|
|
3492
|
-
data?:
|
|
3425
|
+
data?: {
|
|
3426
|
+
[key: string]: string;
|
|
3427
|
+
};
|
|
3493
3428
|
}>;
|
|
3494
3429
|
/**
|
|
3495
3430
|
* 设置当前用户属性(暂不开放)
|
|
@@ -4386,7 +4321,7 @@ declare enum CommandPriority {
|
|
|
4386
4321
|
NORMAL = 1,
|
|
4387
4322
|
HIGH = 2
|
|
4388
4323
|
}
|
|
4389
|
-
|
|
4324
|
+
type ICommandResult<R = void> = {
|
|
4390
4325
|
code: number;
|
|
4391
4326
|
data?: R;
|
|
4392
4327
|
};
|
|
@@ -4898,7 +4833,7 @@ declare class RCLivingRoom extends RCAbstractRoom {
|
|
|
4898
4833
|
/**
|
|
4899
4834
|
* @private
|
|
4900
4835
|
*/
|
|
4901
|
-
__innerInitByIdentityChange(traceId: string): Promise<
|
|
4836
|
+
__innerInitByIdentityChange(traceId: string): Promise<number>;
|
|
4902
4837
|
/**
|
|
4903
4838
|
* 增量发布资源,若发布的资源 tag 及媒体类型重复,后者将覆盖前者进行发布。
|
|
4904
4839
|
* @param tracks 待发布的 RCLocalTrack 实例
|
|
@@ -5232,7 +5167,9 @@ declare class RCRTCClient extends RCMediaStreamCapture {
|
|
|
5232
5167
|
private readonly _runtime;
|
|
5233
5168
|
private _options;
|
|
5234
5169
|
private readonly _service;
|
|
5170
|
+
static _instance: RCRTCClient | null;
|
|
5235
5171
|
constructor(_context: RTCContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
|
|
5172
|
+
static init(options: IRCRTCInitOptions | undefined, pluginContext: IRTCPluginContext, runtime: IRuntime): RCRTCClient;
|
|
5236
5173
|
private _handleMessage;
|
|
5237
5174
|
/**
|
|
5238
5175
|
* voip 变更、jwt 变更需要触发重走嗅探逻辑
|
|
@@ -5242,6 +5179,10 @@ declare class RCRTCClient extends RCMediaStreamCapture {
|
|
|
5242
5179
|
* 获取加入的连麦房间
|
|
5243
5180
|
*/
|
|
5244
5181
|
private _getJoinedPKRoomList;
|
|
5182
|
+
/**
|
|
5183
|
+
* 获取 RTC 插件上下文(含 logger 等),供 CallPlus 等依赖使用
|
|
5184
|
+
*/
|
|
5185
|
+
getPluginContext(): IRTCPluginContext;
|
|
5245
5186
|
/**
|
|
5246
5187
|
* 获取当前用户 Id,若 IM 未连接,这返回 `''`
|
|
5247
5188
|
* @returns
|
|
@@ -5423,7 +5364,7 @@ declare const device: {
|
|
|
5423
5364
|
* RTC 插件生成器
|
|
5424
5365
|
* @public
|
|
5425
5366
|
*/
|
|
5426
|
-
declare const installer: IPluginGenerator<RCRTCClient,
|
|
5367
|
+
declare const installer: IPluginGenerator<RCRTCClient, void>;
|
|
5427
5368
|
/**
|
|
5428
5369
|
* 预定义的资源 tag
|
|
5429
5370
|
*/
|