@rongcloud/plugin-rtc 5.5.5-beem.3 → 5.5.5-beem.4

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.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCRTC - v5.5.5-beem.3
3
- * CommitId - b639b89eb82e0b55da6285514427d887456ecbd2
4
- * Mon Oct 31 2022 13:25:42 GMT+0800 (China Standard Time)
2
+ * RCRTC - v5.5.5-beem.4
3
+ * CommitId - 1c464fa58c20897be94d3d50ee25c52729284323
4
+ * Tue Nov 08 2022 19:35:07 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  import { EventEmitter, BasicLogger, INaviInfo, RTCPluginContext, AbsCodec, IPromiseResult, ErrorCode, KVString, IRuntime, IAsyncRes, ConnectionStatus, ConversationType, ISendMsgOptions, IReceivedMessage, EnableLogL, IPluginGenerator } from '@rongcloud/engine';
@@ -1522,7 +1522,7 @@ declare class RTCContext {
1522
1522
  setRTCTotalRes(roomId: string, message: {
1523
1523
  name: string;
1524
1524
  content: string;
1525
- }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
1525
+ }, valueInfo: string, objectName: string, mcuValInfo?: string, cdnValInfo?: string): Promise<ErrorCode>;
1526
1526
  setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
1527
1527
  getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
1528
1528
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
@@ -1761,6 +1761,10 @@ declare class RCRTCPeerCManager {
1761
1761
  * 北极星上报模块
1762
1762
  */
1763
1763
  private readonly _polarisReport?;
1764
+ /**
1765
+ * context
1766
+ */
1767
+ protected readonly _initOptions?: IRCRTCInitOptions | undefined;
1764
1768
  /**
1765
1769
  * 存储创建的所有 peerC,key 为 pcName,/exchange 请求中 request header 中的 Peer-Connection-Id 值
1766
1770
  */
@@ -1786,7 +1790,11 @@ declare class RCRTCPeerCManager {
1786
1790
  /**
1787
1791
  * 北极星上报模块
1788
1792
  */
1789
- _polarisReport?: PolarisHttpReporter | undefined);
1793
+ _polarisReport?: PolarisHttpReporter | undefined,
1794
+ /**
1795
+ * context
1796
+ */
1797
+ _initOptions?: IRCRTCInitOptions | undefined);
1790
1798
  get useMutilPeerC(): boolean;
1791
1799
  /**
1792
1800
  * 根据 track 判断是否为上行
@@ -2239,6 +2247,7 @@ declare abstract class RCAbstractRoom extends EventEmitter {
2239
2247
  */
2240
2248
  protected readonly _useMutilPeerC?: boolean | undefined;
2241
2249
  protected readonly _clientSessionId: string;
2250
+ protected readonly signalRetryTime: number;
2242
2251
  /**
2243
2252
  * 房间保活 rtcPing
2244
2253
  */
@@ -2257,11 +2266,25 @@ declare abstract class RCAbstractRoom extends EventEmitter {
2257
2266
  protected _peerCManager: RCRTCPeerCManager | null;
2258
2267
  protected readonly _invoker: Invoker;
2259
2268
  protected readonly _store: ReadableStore;
2269
+ /**
2270
+ * RCRTCRoom 类的构造函数。
2271
+ * @param {RTCContext} _context - RTC上下文,
2272
+ * @param {IRuntime} _runtime - 运行时
2273
+ * @param {string} _roomId - 房间号
2274
+ * @param {RTCMode} _roomMode - RTC模式,
2275
+ * @param {RCMediaService} _service - RCMediaService
2276
+ * @param {IRCRTCInitOptions} _initOptions - IRCRTCInitOptions
2277
+ * @param {boolean} [isUpgrade] - 是否是升级,如果是升级则不会创建新的peerConnection
2278
+ * @param {boolean} [isMainRoom] - 无论是主房间,主房间都是用户创建的房间,子房间是用户创建的房间。
2279
+ * @param {boolean} [_useMutilPeerC] - 是否使用多个 peerConnections
2280
+ * @param {string} _clientSessionId - 客户端会话 ID,用于标识客户端。
2281
+ * @param {number} signalRetryTime - 发送信号的时间间隔。
2282
+ */
2260
2283
  constructor(_context: RTCContext, _runtime: IRuntime, _roomId: string, _roomMode: RTCMode, _service: RCMediaService, _initOptions: IRCRTCInitOptions, isUpgrade?: boolean, isMainRoom?: boolean,
2261
2284
  /**
2262
2285
  * 是否使用多 peerConnection
2263
2286
  */
2264
- _useMutilPeerC?: boolean | undefined, _clientSessionId?: string);
2287
+ _useMutilPeerC?: boolean | undefined, _clientSessionId?: string, signalRetryTime?: number);
2265
2288
  /**
2266
2289
  * 拉取房间数据
2267
2290
  * @param roomId 房间 id
@@ -3005,7 +3028,9 @@ declare class RCRTCPeerConnection extends EventEmitter {
3005
3028
  */
3006
3029
  private readonly _polarisReport?;
3007
3030
  private readonly onTrackTrouble?;
3031
+ protected readonly _initOptions?: IRCRTCInitOptions | undefined;
3008
3032
  static __INNER_EVENT_TRACK_READY__: string;
3033
+ private readonly senderAndReciveSize;
3009
3034
  private readonly _rtcPeerConn;
3010
3035
  private readonly _sdpStrategy;
3011
3036
  reportParser: IStatParser | null;
@@ -3033,7 +3058,7 @@ declare class RCRTCPeerConnection extends EventEmitter {
3033
3058
  /**
3034
3059
  * 北极星上传实例
3035
3060
  */
3036
- _polarisReport?: PolarisHttpReporter | undefined, onTrackTrouble?: Function | undefined);
3061
+ _polarisReport?: PolarisHttpReporter | undefined, onTrackTrouble?: Function | undefined, _initOptions?: IRCRTCInitOptions | undefined);
3037
3062
  getName(): string;
3038
3063
  getLocalTracks(): RCLocalTrack[];
3039
3064
  private _onConnectionStateChange;
@@ -3046,12 +3071,35 @@ declare class RCRTCPeerConnection extends EventEmitter {
3046
3071
  * @deprecated use RCLocalTrack.setBitrate instead of setBitrate
3047
3072
  */
3048
3073
  setBitrate(max: number, min: number, start?: number): Promise<void>;
3074
+ /**
3075
+ * `createOffer` 是一个创建报价并记录报价 SDP 和 SDP 语义的函数
3076
+ * @param {boolean} iceRestart - 布尔值
3077
+ * @returns 具有两个属性的对象:
3078
+ * - sdp:SDP 字符串
3079
+ * - 语义:SDP 语义
3080
+ */
3049
3081
  createOffer(iceRestart: boolean): Promise<IOfferInfo>;
3050
3082
  setRemoteAnswer(answer: string): Promise<RCRTCCode>;
3051
3083
  getLocalTrack(trackId: string): RCLocalTrack | null;
3084
+ /**
3085
+ * 它将本地轨道添加到对等连接。
3086
+ * @param {RCLocalTrack} track - 要添加的本地轨道。
3087
+ */
3052
3088
  addLocalTrack(track: RCLocalTrack): void;
3089
+ /**
3090
+ * 按 ID 删除本地轨道
3091
+ * @param {string} trackId - 要移除的轨道的 ID。
3092
+ * @returns 正在删除的轨道。
3093
+ */
3053
3094
  removeLocalTrackById(trackId: string): void;
3095
+ /**
3096
+ * 它会删除所有本地Track。
3097
+ */
3054
3098
  removeAllLocalTrack(): void;
3099
+ /**
3100
+ * 从对等连接中删除本地轨道。
3101
+ * @param {RCLocalTrack} track - 要删除的本地轨道。
3102
+ */
3055
3103
  removeLocalTrack(track: RCLocalTrack): void;
3056
3104
  private _updateRecvTransceiverMap;
3057
3105
  updateSubRemoteTracks(remoteTracks: RCRemoteTrack[]): void;
@@ -3085,7 +3133,7 @@ declare class RCRTCPeerConnection extends EventEmitter {
3085
3133
  /**
3086
3134
  * 获取缓存的本地质量数据
3087
3135
  */
3088
- _getCacheStatsData(): IInnerRCRTCStateReport | null | undefined;
3136
+ _getCacheStatsData(): Promise<IInnerRCRTCStateReport | undefined>;
3089
3137
  /**
3090
3138
  * 北极星上报 R3、R4 数据
3091
3139
  */
@@ -3345,6 +3393,7 @@ interface IInnerIcePair extends IRCCandidatePairStat {
3345
3393
  * 上、下行总丢包率
3346
3394
  */
3347
3395
  totalPacketsLost?: number;
3396
+ [key: string]: any;
3348
3397
  }
3349
3398
  /**
3350
3399
  * send track 所有字段
@@ -3812,7 +3861,6 @@ interface IRCRTCInitOptions {
3812
3861
  * 观众拉内置 CDN 资源时是否使用 https,默认为 RCInnerCDNPullIsHttps.HTTPS
3813
3862
  */
3814
3863
  pullInnerCDNUseHttps?: RCInnerCDNPullIsHttps;
3815
- signalRetryTime?: number;
3816
3864
  /**
3817
3865
  * 音频降噪处理
3818
3866
  * - workletModule 默认值为 https://cdn.ronghub.com/plugin-rtc/wasm/5.0.0-alpha.1/process-worklet.js
@@ -3824,6 +3872,10 @@ interface IRCRTCInitOptions {
3824
3872
  workletWasm?: string;
3825
3873
  isOpen?: boolean;
3826
3874
  };
3875
+ /**
3876
+ * 大会议场景下的北极星节流阀
3877
+ */
3878
+ polarisThrottle?: boolean;
3827
3879
  }
3828
3880
  interface ICameraVideoProfile extends IVideoProfile {
3829
3881
  cameraId?: string;
@@ -4273,6 +4325,19 @@ declare class RCLivingRoom extends RCAbstractRoom {
4273
4325
  * 跨房间连麦管理器
4274
4326
  */
4275
4327
  private _roomPKHandler;
4328
+ /**
4329
+ * 一个构造函数。
4330
+ * @param {RTCContext} context - RTC上下文,
4331
+ * @param {IRuntime} runtime - 运行时
4332
+ * @param {string} roomId - 房间号
4333
+ * @param {RCMediaService} service - RCMediaService
4334
+ * @param {IRCRTCInitOptions} initOptions - IRCRTCInitOptions
4335
+ * @param {RCLivingType} _livingType - RCLivingType.LIVE_ROOM,
4336
+ * @param {boolean} [isUpgrade] - 是否升级房间,如果为真,则表示房间从会议室升级到直播间,会议室关闭。
4337
+ * @param {boolean} [isMainRoom] - 无论是主房间,主房间都是发起呼叫的房间,子房间是接收呼叫的房间。
4338
+ * @param {boolean} [useMutilPeerC] - 是否使用多个 peerConnections
4339
+ * @param {string} [_clientSessionId] - 当前用户的会话 ID。
4340
+ */
4276
4341
  constructor(context: RTCContext, runtime: IRuntime, roomId: string, service: RCMediaService, initOptions: IRCRTCInitOptions, _livingType: RCLivingType, isUpgrade?: boolean, isMainRoom?: boolean,
4277
4342
  /**
4278
4343
  * 是否使用多 peerConnection
@@ -4363,11 +4428,25 @@ declare class RCLivingRoom extends RCAbstractRoom {
4363
4428
  * 普通音视频房间
4364
4429
  */
4365
4430
  declare class RCRTCRoom extends RCAbstractRoom {
4431
+ /**
4432
+ * 类的构造函数。
4433
+ * @param {RTCContext} context - RTC上下文
4434
+ * @param {IRuntime} runtime - 运行时
4435
+ * @param {string} roomId - 房间号
4436
+ * @param {RCMediaService} service - RCMediaService
4437
+ * @param {IRCRTCInitOptions} initOptions - IRCRTCInitOptions
4438
+ * @param {boolean} [isUpgrade] - 是否升级房间,默认为false
4439
+ * @param {boolean} [isMainRoom] - 无论是主房间,主房间是用户进入的房间,子房间是用户进入主房间后进入的房间。
4440
+ * @param {boolean} [useMutilPeerC] - 是否使用多个 peerConnections
4441
+ * @param {string} [_clientSessionId] - 当前房间的clientSessionId,用于区分当前房间和其他房间。
4442
+ * @param {RTCMode} roomType - RTCMode = RTCMode.RTC,
4443
+ * @param {number} signalRetryTime - 重新连接信令服务器的时间间隔。
4444
+ */
4366
4445
  constructor(context: RTCContext, runtime: IRuntime, roomId: string, service: RCMediaService, initOptions: IRCRTCInitOptions, isUpgrade?: boolean, isMainRoom?: boolean,
4367
4446
  /**
4368
4447
  * 是否使用多 peerConnection
4369
4448
  */
4370
- useMutilPeerC?: boolean, _clientSessionId?: string, roomType?: RTCMode);
4449
+ useMutilPeerC?: boolean, _clientSessionId?: string, roomType?: RTCMode, signalRetryTime?: number);
4371
4450
  }
4372
4451
 
4373
4452
  /**