@rongcloud/plugin-rtc 5.4.7-alpha.3 → 5.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/core/Invoker.d.ts +3 -2
  2. package/dist/core/PolarisReporter.d.ts +3 -2
  3. package/dist/core/RCAudienceClient.d.ts +3 -2
  4. package/dist/core/RCMediaStreamCapture.d.ts +3 -3
  5. package/dist/core/RCRTCClient.d.ts +25 -3
  6. package/dist/core/Store.d.ts +5 -3
  7. package/dist/core/codec/RTCContext.d.ts +76 -0
  8. package/dist/core/codec/interface.d.ts +168 -0
  9. package/dist/core/codec/proto.d.ts +94 -0
  10. package/dist/core/codec/rtc-helper.d.ts +17 -0
  11. package/dist/core/command/JoinRoomCommand.d.ts +4 -1
  12. package/dist/core/command/OnSignalReconnectedCommand.d.ts +1 -1
  13. package/dist/core/command/PubCommand.d.ts +34 -0
  14. package/dist/core/command/RTCIdentityChangeCommand.d.ts +2 -1
  15. package/dist/core/constants.d.ts +2 -0
  16. package/dist/core/enums/RCLoggerTag.d.ts +9 -1
  17. package/dist/core/enums/RCRTCCode.d.ts +3 -0
  18. package/dist/core/enums/RCResolution.d.ts +8 -8
  19. package/dist/core/enums/RTCJoinType.d.ts +18 -0
  20. package/dist/core/enums/RTCMode.d.ts +22 -0
  21. package/dist/core/enums/inner/LiveRole.d.ts +11 -0
  22. package/dist/core/enums/inner/LiveType.d.ts +14 -0
  23. package/dist/core/enums/inner/RTCApiType.d.ts +5 -0
  24. package/dist/core/enums/inner/RTCIdentityChangeType.d.ts +5 -0
  25. package/dist/core/interfaces.d.ts +11 -0
  26. package/dist/core/room/Pinger.d.ts +3 -2
  27. package/dist/core/room/RCAbstractRoom.d.ts +7 -3
  28. package/dist/core/room/RCAudienceLivingRoom.d.ts +7 -2
  29. package/dist/core/room/RCLivingPKHandler.d.ts +3 -2
  30. package/dist/core/room/RCLivingRoom.d.ts +6 -2
  31. package/dist/core/room/RCRTCRoom.d.ts +5 -3
  32. package/dist/core/service/RCMediaService.d.ts +27 -2
  33. package/dist/core/service/helper.d.ts +11 -1
  34. package/dist/core/service/interface.d.ts +6 -1
  35. package/dist/core/webrtc/sdp/ASdpBuilder.d.ts +5 -0
  36. package/dist/helper.d.ts +7 -1
  37. package/dist/index.d.ts +399 -31
  38. package/dist/index.esm.js +15 -19373
  39. package/dist/index.js +15 -19405
  40. package/dist/index.umd.js +15 -19409
  41. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*
2
- * RCRTC - v5.4.7-alpha.3
3
- * CommitId - 851c4005fa6dfee3d966699f4bc260b0b6cbd7ea
4
- * Fri Sep 02 2022 09:48:41 GMT+0800 (China Standard Time)
2
+ * RCRTC - v5.5.1
3
+ * CommitId - 94aa71a7ee851d6dc16a3015eeb036fe805fd6db
4
+ * Tue Sep 20 2022 09:40:08 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
- import { EventEmitter, RTCMode, IRuntime, RTCPluginContext, IJoinRTCRoomData, IReceivedMessage, ErrorCode, RTCJoinType, IRTCUserData, KVString, IServerRTCRoomEntry, LogLevel, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
8
- export { RTCJoinType } from '@rongcloud/engine';
7
+ import * as _rongcloud_engine from '@rongcloud/engine';
8
+ import { EventEmitter, RTCPluginContext, AbsCodec, IPromiseResult, ErrorCode, KVString, IAsyncRes, ConnectionStatus, ConversationType, ISendMsgOptions, IReceivedMessage, IRuntime, LogLevel, IPluginGenerator } from '@rongcloud/engine';
9
9
 
10
10
  /**
11
11
  * 错误码,与移动端对齐
@@ -15,6 +15,7 @@ export { RTCJoinType } from '@rongcloud/engine';
15
15
  * 3. `53000 - 53199` 为 Web RTC 专用段
16
16
  * 4. `53200 - 53499` 为 Web Call 专用段
17
17
  * 5. `53500 - 53999` 为 Web 保留段
18
+ * 6. 1004 jwt token 过期
18
19
  */
19
20
  declare enum RCRTCCode {
20
21
  /** 成功 */
@@ -91,6 +92,8 @@ declare enum RCRTCCode {
91
92
  SOME_TRACKS_PUBLISH_FAILED = 53031,
92
93
  /** electron 中 mac 系统暂不支持屏幕共享采集声音 */
93
94
  MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO = 53032,
95
+ /** JWT token 解析超时,需要刷新 navi 重新获取 */
96
+ JWT_TIME_OUT = 1004,
94
97
  /** 获取媒体资源时,无系统权限 */
95
98
  SYSTEM_PERMISSION_DENIED = 53033,
96
99
  /** 发布时无有效资源,如 track 已被销毁 */
@@ -125,22 +128,22 @@ declare enum RCFrameRate {
125
128
  declare enum RCResolution {
126
129
  W176_H132 = "W176_H132",
127
130
  W176_H144 = "W176_H144",
131
+ W180_H180 = "W180_H180",
132
+ W240_H180 = "W240_H180",
133
+ W240_H240 = "W240_H240",
128
134
  W256_H144 = "W256_H144",
129
135
  W320_H180 = "W320_H180",
130
- W240_H240 = "W240_H240",
131
136
  W320_H240 = "W320_H240",
137
+ W360_H360 = "W360_H360",
132
138
  W480_H360 = "W480_H360",
133
- W640_H360 = "W640_H360",
134
139
  W480_H480 = "W480_H480",
140
+ W640_H360 = "W640_H360",
135
141
  W640_H480 = "W640_H480",
136
142
  W720_H480 = "W720_H480",
137
- W1280_H720 = "W1280_H720",
138
- W1920_H1080 = "W1920_H1080",
139
- W180_H180 = "W180_H180",
140
- W240_H180 = "W240_H180",
141
- W360_H360 = "W360_H360",
142
143
  W848_H480 = "W848_H480",
143
- W960_H720 = "W960_H720"
144
+ W960_H720 = "W960_H720",
145
+ W1280_H720 = "W1280_H720",
146
+ W1920_H1080 = "W1920_H1080"
144
147
  }
145
148
 
146
149
  /**
@@ -624,6 +627,28 @@ declare enum RCInnerCDNBroadcast {
624
627
  NO_SPREAD = -1
625
628
  }
626
629
 
630
+ /**
631
+ * 音视频模式
632
+ */
633
+ declare enum RTCMode {
634
+ /**
635
+ * 普通音视频模式
636
+ */
637
+ RTC = 0,
638
+ /**
639
+ * 直播模式
640
+ */
641
+ LIVE = 2,
642
+ /**
643
+ * 跨应用多人房间
644
+ */
645
+ CROSS_MUTI = 7,
646
+ /**
647
+ * 跨应用直播
648
+ */
649
+ CROSS_LIVE = 8
650
+ }
651
+
627
652
  /**
628
653
  * 与 MediaServer 交互所需的 Request Header 信息
629
654
  */
@@ -1187,6 +1212,299 @@ interface ISetEnableCDN {
1187
1212
  };
1188
1213
  }
1189
1214
 
1215
+ /**
1216
+ * RTC 房间加入类型
1217
+ */
1218
+ declare enum RTCJoinType {
1219
+ /**
1220
+ * 踢前一个设备
1221
+ */
1222
+ KICK = 0,
1223
+ /**
1224
+ * 当前加入拒绝
1225
+ */
1226
+ REFUSE = 1,
1227
+ /**
1228
+ * 两个设备共存
1229
+ */
1230
+ COEXIST = 2
1231
+ }
1232
+
1233
+ declare enum RTCApiType {
1234
+ ROOM = 1,
1235
+ PERSON = 2
1236
+ }
1237
+
1238
+ declare enum RTCIdentityChangeType {
1239
+ AnchorToViewer = 1,
1240
+ ViewerToAnchor = 2
1241
+ }
1242
+
1243
+ declare const keymaps: {
1244
+ readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas"];
1245
+ readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo"];
1246
+ readonly SetUserStatusInput: readonly ["status"];
1247
+ readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
1248
+ readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
1249
+ readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
1250
+ readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
1251
+ readonly MCFollowInput: readonly ["state"];
1252
+ readonly RtcTokenOutput: readonly ["rtcToken"];
1253
+ readonly RtcQryOutput: readonly ["outInfo"];
1254
+ readonly RtcQryUserOutDataInput: readonly ["userId"];
1255
+ readonly RtcUserOutDataOutput: readonly ["user"];
1256
+ readonly RtcQueryListInput: readonly ["order"];
1257
+ readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
1258
+ readonly RtcValueInfo: readonly ["key", "value"];
1259
+ readonly RtcKeyDeleteInput: readonly ["key"];
1260
+ readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
1261
+ readonly RtcPullKV: readonly ["timestamp", "roomId"];
1262
+ readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
1263
+ readonly RtcQueryUserJoinedInput: readonly ["userId"];
1264
+ readonly RtcQueryUserJoinedOutput: readonly ["info"];
1265
+ readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
1266
+ readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
1267
+ readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
1268
+ readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
1269
+ };
1270
+ declare type RTCKeyMaps = typeof keymaps;
1271
+
1272
+ /**
1273
+ * 设置 RTC 人员 inner、outer 数据
1274
+ */
1275
+ interface IRTCUserData {
1276
+ [key: string]: string;
1277
+ }
1278
+ interface IRtcTokenData {
1279
+ rtcToken: string;
1280
+ }
1281
+ /**
1282
+ * 加入 RTC 房间的用户信息
1283
+ */
1284
+ interface IRTCJoinedInfo {
1285
+ /**
1286
+ * 设备 ID
1287
+ */
1288
+ deviceId: string;
1289
+ /**
1290
+ * RTC 房间 ID
1291
+ */
1292
+ roomId: string;
1293
+ /**
1294
+ * 加入的时间戳
1295
+ */
1296
+ joinTime: number;
1297
+ }
1298
+ interface IRTCRoomInfo {
1299
+ roomId: string;
1300
+ roomData: unknown[];
1301
+ userCount: number;
1302
+ list: unknown[];
1303
+ }
1304
+ interface IServerRTCRoomEntry {
1305
+ key: string;
1306
+ value: string;
1307
+ status: number;
1308
+ timestamp: number;
1309
+ uid: string;
1310
+ }
1311
+ interface IRTCUsers {
1312
+ users: {
1313
+ [userId: string]: {
1314
+ /**
1315
+ * 发布的资源数据,是一个 JSON 字符串,解析后为发布的资源列表
1316
+ */
1317
+ uris?: string;
1318
+ /**
1319
+ * 加房间的身份标识,保存主房间 roomId
1320
+ */
1321
+ extra?: string;
1322
+ };
1323
+ };
1324
+ }
1325
+ interface IJoinRTCRoomData extends IRTCUsers {
1326
+ token: string;
1327
+ sessionId: string;
1328
+ roomInfo: {
1329
+ key: string;
1330
+ value: string;
1331
+ }[];
1332
+ kvEntries: IServerRTCRoomEntry[];
1333
+ offlineKickTime: number;
1334
+ }
1335
+ interface IReqRoomPKOptions {
1336
+ /**
1337
+ * 当前房间 ID
1338
+ */
1339
+ roomId: string;
1340
+ /**
1341
+ * 被邀请房间 ID
1342
+ */
1343
+ invitedRoomId: string;
1344
+ /**
1345
+ * 被邀请用户 ID
1346
+ */
1347
+ invitedUserId: string;
1348
+ /**
1349
+ * 本次邀请超时时间
1350
+ */
1351
+ inviteTimeout: number;
1352
+ /**
1353
+ * 本次邀请额外信息
1354
+ */
1355
+ inviteInfo: string;
1356
+ /**
1357
+ * 本次邀请唯一 ID
1358
+ */
1359
+ inviteSessionId: string;
1360
+ }
1361
+ interface ICancelRoomPKOptions {
1362
+ /**
1363
+ * 当前房间 ID
1364
+ */
1365
+ roomId: string;
1366
+ /**
1367
+ * 被邀请房间 ID
1368
+ */
1369
+ invitedRoomId: string;
1370
+ /**
1371
+ * 被邀请用户 ID
1372
+ */
1373
+ invitedUserId: string;
1374
+ /**
1375
+ * 本次邀请额外信息
1376
+ */
1377
+ inviteInfo: string;
1378
+ /**
1379
+ * 本次邀请唯一 ID
1380
+ */
1381
+ inviteSessionId: string;
1382
+ }
1383
+ interface IResRoomPKOptions {
1384
+ /**
1385
+ * 当前房间 ID
1386
+ */
1387
+ roomId: string;
1388
+ /**
1389
+ * 邀请者 ID
1390
+ */
1391
+ inviteUserId: string;
1392
+ /**
1393
+ * 邀请者房间 ID
1394
+ */
1395
+ inviteRoomId: string;
1396
+ /**
1397
+ * 邀请的 session ID
1398
+ */
1399
+ inviteSessionId: string;
1400
+ /**
1401
+ * 需要转发的信息
1402
+ */
1403
+ content: string;
1404
+ /**
1405
+ * 同意邀请时要设置的 key, 放在room级别的k和v,新加入房间的能拉取到
1406
+ */
1407
+ key: string;
1408
+ /**
1409
+ * 同意邀请时要设置的 value, 放在room级别的k和v,新加入房间的能拉取到
1410
+ */
1411
+ value: string;
1412
+ /**
1413
+ * 是否同意邀请
1414
+ */
1415
+ agree: boolean;
1416
+ }
1417
+ interface IEndRoomPKOptions {
1418
+ /**
1419
+ * 当前房间 ID
1420
+ */
1421
+ roomId: string;
1422
+ /**
1423
+ * 需要结束的连麦房间 ID
1424
+ */
1425
+ endRoomId: string;
1426
+ /**
1427
+ * 需要结束连麦的 sessionID
1428
+ */
1429
+ sessionId: string;
1430
+ /**
1431
+ * 结束连麦的信息
1432
+ */
1433
+ content: string;
1434
+ /**
1435
+ * 需要删除连麦的信息的 keys
1436
+ */
1437
+ keys: string[];
1438
+ }
1439
+
1440
+ declare class RTCContext {
1441
+ private context;
1442
+ private codec;
1443
+ constructor(context: RTCPluginContext, codec: AbsCodec<RTCKeyMaps>);
1444
+ joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData): IPromiseResult<IJoinRTCRoomData>;
1445
+ quitRTCRoom(roomId: string): Promise<ErrorCode>;
1446
+ getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
1447
+ getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
1448
+ getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
1449
+ removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
1450
+ setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
1451
+ name: string;
1452
+ content: string;
1453
+ }): Promise<ErrorCode>;
1454
+ /**
1455
+ * 全量订阅资源修改
1456
+ * @param roomId 房间 Id
1457
+ * @param message 向前兼容的消息内容
1458
+ * @param valueInfo 全量资源数据
1459
+ * @param objectName 全量 URI 消息名
1460
+ */
1461
+ setRTCTotalRes(roomId: string, message: {
1462
+ name: string;
1463
+ content: string;
1464
+ }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
1465
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
1466
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
1467
+ removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
1468
+ name: string;
1469
+ content: string;
1470
+ }): Promise<ErrorCode>;
1471
+ setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
1472
+ getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
1473
+ getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
1474
+ setRTCState(roomId: string, report: string): Promise<ErrorCode>;
1475
+ getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
1476
+ joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
1477
+ token: string;
1478
+ kvEntries: IServerRTCRoomEntry[];
1479
+ }>>;
1480
+ quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
1481
+ rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
1482
+ requestRoomPK(options: IReqRoomPKOptions): Promise<ErrorCode>;
1483
+ cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
1484
+ responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
1485
+ endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
1486
+ getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
1487
+ pullRTCRoomEntry(roomId: string): Promise<IAsyncRes<IChrmKVPullData>>;
1488
+ decodeRtcNotify(buffer: Uint8Array): {
1489
+ time: any;
1490
+ type: any;
1491
+ roomId: any;
1492
+ };
1493
+ getCurrentId(): string;
1494
+ getNaviInfo(): _rongcloud_engine.INaviInfo | null;
1495
+ getConnectionStatus(): ConnectionStatus;
1496
+ getAppkey(): string;
1497
+ rtcPing(roomId: string, roomMode: number, broadcastType?: number): Promise<ErrorCode>;
1498
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
1499
+ registerRTCSignalListener(listener?: ((buffer: Uint8Array) => void) | undefined): void;
1500
+ registerConnectionStateChangeListener(listener: (status: ConnectionStatus) => void): void;
1501
+ registerDisconnectListener(listener: () => void): void;
1502
+ registerDestroyListener(listener: () => void): void;
1503
+ registerMessageListener(listener: (message: IReceivedMessage) => boolean): void;
1504
+ getCoreVersion(): string;
1505
+ getPluginContext(): RTCPluginContext;
1506
+ }
1507
+
1190
1508
  declare class RCMediaService {
1191
1509
  private readonly _runtime;
1192
1510
  private readonly _context;
@@ -1218,7 +1536,19 @@ declare class RCMediaService {
1218
1536
  * MCU 服务地址
1219
1537
  */
1220
1538
  private _configUrl;
1221
- constructor(_runtime: IRuntime, _context: RTCPluginContext,
1539
+ /**
1540
+ * 嗅探中获取的媒体服务地址
1541
+ */
1542
+ private static isDetector;
1543
+ /**
1544
+ * 嗅探中获取的媒体服务地址
1545
+ */
1546
+ private static msInDetector;
1547
+ private static detectorTime;
1548
+ private static detectValidMinute;
1549
+ private static naviRefetchCount;
1550
+ private _msList;
1551
+ constructor(_runtime: IRuntime, _context: RTCContext,
1222
1552
  /**
1223
1553
  * 自定义 MediaServer 地址,当有值时,不再使用导航内的地址
1224
1554
  */
@@ -1227,7 +1557,19 @@ declare class RCMediaService {
1227
1557
  * 请求超时时长
1228
1558
  */
1229
1559
  _timeout?: number);
1560
+ detectorMediaSever(): void;
1561
+ /**
1562
+ * 地址探测
1563
+ * RTC 初始化时检测是否可以拿到 navi,可以拿到开始嗅探
1564
+ * 拿不到等 IM 链接成功后,再回调中调用开始嗅探
1565
+ */
1566
+ private _getDetectorUrls;
1230
1567
  getNaviMS(): string[];
1568
+ /**
1569
+ * _mslist 列表排序:[_clusterId, ping1, 主域名,ping2, ..., pingN, 备用域名list ]
1570
+ * ping1 :ping 结果返回最快值
1571
+ */
1572
+ private setMediaServiceList;
1231
1573
  /**
1232
1574
  * 发送请求,请求发送若失败,会继续尝试使用后续可用地址直到无地址可用,此时认为请求失败
1233
1575
  * @param path
@@ -1464,7 +1806,7 @@ declare class RCRTCPeerCManager {
1464
1806
  }
1465
1807
 
1466
1808
  declare abstract class ReadableStore {
1467
- readonly context: RTCPluginContext;
1809
+ readonly context: RTCContext;
1468
1810
  readonly service: RCMediaService;
1469
1811
  readonly peerMgr: RCRTCPeerCManager;
1470
1812
  readonly roomId: string;
@@ -1502,7 +1844,7 @@ declare abstract class ReadableStore {
1502
1844
  protected _CDNUris: ICDNUris | null;
1503
1845
  protected _CDNEnable: boolean;
1504
1846
  protected _destroyed: boolean;
1505
- constructor(context: RTCPluginContext, service: RCMediaService, peerMgr: RCRTCPeerCManager, roomId: string, crtUserId: string, roomMode: RTCMode, polarisReport: PolarisReporter, isUpgrade?: boolean | undefined, isMainRoom?: boolean | undefined);
1847
+ constructor(context: RTCContext, service: RCMediaService, peerMgr: RCRTCPeerCManager, roomId: string, crtUserId: string, roomMode: RTCMode, polarisReport: PolarisReporter, isUpgrade?: boolean | undefined, isMainRoom?: boolean | undefined);
1506
1848
  get useMutilPeerC(): boolean;
1507
1849
  getResourcesByUserId(userId: string): IPublishedResource[] | undefined;
1508
1850
  getRemoteTrack(trackId: string): RCRemoteTrack | undefined;
@@ -1602,7 +1944,7 @@ declare class BaseInvoker<STORE> {
1602
1944
  * 房间任务队列管理
1603
1945
  */
1604
1946
  declare class Invoker extends BaseInvoker<Store> {
1605
- constructor(context: RTCPluginContext, service: RCMediaService, peerMrg: RCRTCPeerCManager, roomId: string, crtUserId: string, mode: RTCMode, reporter: PolarisReporter, isUpgrade?: boolean, isMainRoom?: boolean);
1947
+ constructor(context: RTCContext, service: RCMediaService, peerMrg: RCRTCPeerCManager, roomId: string, crtUserId: string, mode: RTCMode, reporter: PolarisReporter, isUpgrade?: boolean, isMainRoom?: boolean);
1606
1948
  /**
1607
1949
  * 获取 store 存储实例,返回值类型 `ReadableStore`,避免非 command 定义中修改内存
1608
1950
  */
@@ -1663,7 +2005,7 @@ declare class RCLivingPKHandler {
1663
2005
  * 跨房间连麦加入的 PK 房间
1664
2006
  */
1665
2007
  private _joinedPKRooms;
1666
- constructor(_invoker: Invoker, _PKInfo: IPKInfo, _hooks: ExchangeHooks, _context: RTCPluginContext, _runtime: IRuntime, _service: RCMediaService, _initOptions: IRCRTCInitOptions,
2008
+ constructor(_invoker: Invoker, _PKInfo: IPKInfo, _hooks: ExchangeHooks, _context: RTCContext, _runtime: IRuntime, _service: RCMediaService, _initOptions: IRCRTCInitOptions,
1667
2009
  /**
1668
2010
  * 主直播房间
1669
2011
  */
@@ -1790,7 +2132,7 @@ declare type ResourceMsgContent = {
1790
2132
  * 房间抽象基类
1791
2133
  */
1792
2134
  declare abstract class RCAbstractRoom extends EventEmitter {
1793
- protected readonly _context: RTCPluginContext;
2135
+ protected readonly _context: RTCContext;
1794
2136
  protected readonly _runtime: IRuntime;
1795
2137
  readonly _roomId: string;
1796
2138
  protected readonly _service: RCMediaService;
@@ -1818,7 +2160,7 @@ declare abstract class RCAbstractRoom extends EventEmitter {
1818
2160
  protected _peerCManager: RCRTCPeerCManager | null;
1819
2161
  protected readonly _invoker: Invoker;
1820
2162
  protected readonly _store: ReadableStore;
1821
- constructor(_context: RTCPluginContext, _runtime: IRuntime, _roomId: string, _roomMode: RTCMode, _service: RCMediaService, _initOptions: IRCRTCInitOptions, isUpgrade?: boolean, isMainRoom?: boolean,
2163
+ constructor(_context: RTCContext, _runtime: IRuntime, _roomId: string, _roomMode: RTCMode, _service: RCMediaService, _initOptions: IRCRTCInitOptions, isUpgrade?: boolean, isMainRoom?: boolean,
1822
2164
  /**
1823
2165
  * 是否使用多 peerConnection
1824
2166
  */
@@ -2248,10 +2590,13 @@ declare class RCAudienceLivingRoom {
2248
2590
  * peerConnection 管理类
2249
2591
  */
2250
2592
  private _peerCManager;
2251
- constructor(_context: RTCPluginContext, _runtime: IRuntime, _initOptions: IRCRTCInitOptions, _roomId: string, _joinResData: {
2593
+ private _isPulling;
2594
+ private _pullTime;
2595
+ constructor(_context: RTCContext, _runtime: IRuntime, _initOptions: IRCRTCInitOptions, _roomId: string, _joinResData: {
2252
2596
  token: string;
2253
2597
  kvEntries: IServerRTCRoomEntry[];
2254
2598
  }, livingType: RCLivingType, _useMutilPeerC?: boolean | undefined, _clientSessionId?: string);
2599
+ private _startPull;
2255
2600
  /**
2256
2601
  * 解析服务端返回的 KV 数据,赋值 room 内数据
2257
2602
  */
@@ -2464,7 +2809,7 @@ declare class PolarisReporter {
2464
2809
  private readonly _roomId;
2465
2810
  private readonly _crtRTCRoom;
2466
2811
  private readonly _userRole;
2467
- constructor(_context: RTCPluginContext, _runtime: IRuntime, _roomId: string, _crtRTCRoom: RCAbstractRoom | RCAudienceLivingRoom, _userRole?: PolarisRole);
2812
+ constructor(_context: RTCContext, _runtime: IRuntime, _roomId: string, _crtRTCRoom: RCAbstractRoom | RCAudienceLivingRoom, _userRole?: PolarisRole);
2468
2813
  private _send;
2469
2814
  private _getClientID;
2470
2815
  /**
@@ -3197,6 +3542,11 @@ interface IPubSuccessRes {
3197
3542
  tracks: RCLocalTrack[];
3198
3543
  }[];
3199
3544
  }
3545
+ interface IChrmKVPullData {
3546
+ kvEntries: IServerRTCRoomEntry[];
3547
+ isFullUpdate?: boolean;
3548
+ syncTime?: number;
3549
+ }
3200
3550
 
3201
3551
  /**
3202
3552
  * 自定义合流布局时,背景图片填充方式
@@ -3425,7 +3775,7 @@ declare class RCLivingRoom extends RCAbstractRoom {
3425
3775
  * 跨房间连麦管理器
3426
3776
  */
3427
3777
  private _roomPKHandler;
3428
- constructor(context: RTCPluginContext, runtime: IRuntime, roomId: string, service: RCMediaService, initOptions: IRCRTCInitOptions, _livingType: RCLivingType, isUpgrade?: boolean, isMainRoom?: boolean,
3778
+ constructor(context: RTCContext, runtime: IRuntime, roomId: string, service: RCMediaService, initOptions: IRCRTCInitOptions, _livingType: RCLivingType, isUpgrade?: boolean, isMainRoom?: boolean,
3429
3779
  /**
3430
3780
  * 是否使用多 peerConnection
3431
3781
  */
@@ -3515,11 +3865,11 @@ declare class RCLivingRoom extends RCAbstractRoom {
3515
3865
  * 普通音视频房间
3516
3866
  */
3517
3867
  declare class RCRTCRoom extends RCAbstractRoom {
3518
- constructor(context: RTCPluginContext, runtime: IRuntime, roomId: string, service: RCMediaService, initOptions: IRCRTCInitOptions, isUpgrade?: boolean, isMainRoom?: boolean,
3868
+ constructor(context: RTCContext, runtime: IRuntime, roomId: string, service: RCMediaService, initOptions: IRCRTCInitOptions, isUpgrade?: boolean, isMainRoom?: boolean,
3519
3869
  /**
3520
3870
  * 是否使用多 peerConnection
3521
3871
  */
3522
- useMutilPeerC?: boolean, _clientSessionId?: string);
3872
+ useMutilPeerC?: boolean, _clientSessionId?: string, roomType?: RTCMode);
3523
3873
  }
3524
3874
 
3525
3875
  /**
@@ -3558,7 +3908,7 @@ declare class RCAudienceClient {
3558
3908
  */
3559
3909
  private _peerCManager;
3560
3910
  private readonly _clientSessionId;
3561
- constructor(_context: RTCPluginContext, runtime: IRuntime, _initOption: IRCRTCInitOptions,
3911
+ constructor(_context: RTCContext, runtime: IRuntime, _initOption: IRCRTCInitOptions,
3562
3912
  /**
3563
3913
  * 是否使用多 peerConnection
3564
3914
  */
@@ -3606,8 +3956,8 @@ declare class RCAudienceClient {
3606
3956
  }
3607
3957
 
3608
3958
  declare class RCMediaStreamCapture {
3609
- protected readonly _context: RTCPluginContext;
3610
- constructor(_context: RTCPluginContext);
3959
+ protected readonly _context: RTCContext;
3960
+ constructor(_context: RTCContext);
3611
3961
  private _isElectron;
3612
3962
  private _getMediaStream;
3613
3963
  /**
@@ -3730,12 +4080,16 @@ declare class RCMediaStreamCapture {
3730
4080
  * @public
3731
4081
  */
3732
4082
  declare class RCRTCClient extends RCMediaStreamCapture {
3733
- protected readonly _context: RTCPluginContext;
4083
+ protected readonly _context: RTCContext;
3734
4084
  private readonly _runtime;
3735
4085
  private readonly _options;
3736
4086
  private readonly _service;
3737
- constructor(_context: RTCPluginContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
4087
+ constructor(_context: RTCContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
3738
4088
  private _handleMessage;
4089
+ /**
4090
+ * voip 变更、jwt 变更需要触发重走嗅探逻辑
4091
+ */
4092
+ private naviDataChange;
3739
4093
  /**
3740
4094
  * 获取加入的连麦房间
3741
4095
  */
@@ -3760,6 +4114,20 @@ declare class RCRTCClient extends RCMediaStreamCapture {
3760
4114
  userIds?: string[];
3761
4115
  tracks?: RCRemoteTrack[];
3762
4116
  }>;
4117
+ /**
4118
+ * 加入跨AppKey音视频房间
4119
+ * @param roomId
4120
+ * @param joinType 多端处理方式
4121
+ * @param outerUserDatas 业务层设置人员属性
4122
+ * @param useMutilPeerC 是否使用多 peerConnection 发布资源
4123
+ * @param roomType 加入房间的类型 默认参数 RTCMode.CROSS_MUTI
4124
+ */
4125
+ joinCrossRTCRoom(roomId: string, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean, roomType?: RTCMode): Promise<{
4126
+ room?: RCRTCRoom;
4127
+ code: RCRTCCode;
4128
+ userIds?: string[];
4129
+ tracks?: RCRemoteTrack[];
4130
+ }>;
3763
4131
  /**
3764
4132
  * 主播加入直播房间或观众上麦场景调用,观众上麦之前需先取消已订阅的直播间资源
3765
4133
  * @param roomId 房间 Id
@@ -3887,4 +4255,4 @@ declare const helper: {
3887
4255
  ifSupportScreenShare: typeof ifSupportScreenShare;
3888
4256
  };
3889
4257
 
3890
- export { BackgroundPictureFillMode, IAudienceRoomEventListener, 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 };
4258
+ export { BackgroundPictureFillMode, IAudienceRoomEventListener, 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, RTCJoinType, device, helper, installer };