@rongcloud/plugin-rtc 5.7.5-alpha.4 → 5.7.7-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.d.ts CHANGED
@@ -348,10 +348,6 @@ declare abstract class RCLocalTrack extends RCTrack {
348
348
  * 本地流已销毁
349
349
  */
350
350
  static __INNER_EVENT_DESTROY__: string;
351
- /**
352
- * 内部发送两秒视频
353
- */
354
- static __INNER_SEND_TWO_SECONDS_VIDEO__: string;
355
351
  /**
356
352
  * track 是否被销毁
357
353
  */
@@ -506,6 +502,7 @@ declare abstract class RCRemoteTrack extends RCTrack {
506
502
  }
507
503
  declare class RCRemoteAudioTrack extends RCRemoteTrack {
508
504
  constructor(logger: BasicLogger, tag: string, userId: string, roomId?: string);
505
+ protected _setLocalMuted(bool: boolean): Promise<RCRTCCode>;
509
506
  /**
510
507
  * 获取播放时指定的输出音量。若当前未播放,则返回 0。
511
508
  * 注意:该音量为对媒体输出设备设定的输出音量,与当前音频内容的 audioLevel 是不同概念。
@@ -696,6 +693,10 @@ interface IExchangeReqBody {
696
693
  * server 根据网络动态切换大小流开关,默认为 `false`
697
694
  */
698
695
  switchstream: boolean;
696
+ /**
697
+ * 是否支持 ipv6
698
+ */
699
+ ipType: number;
699
700
  }
700
701
  interface ILiveUrls {
701
702
  /**
@@ -1247,17 +1248,28 @@ declare enum PullRoomStatusEvent {
1247
1248
  RESOURCECHANGE = 3
1248
1249
  }
1249
1250
 
1250
- declare type RTCEncodedFrame = RTCEncodedAudioFrame | RTCEncodedVideoFrame;
1251
- declare type RCEncryptFunction<T extends RTCEncodedFrame> = (data: T) => T;
1251
+ declare type RCEncryptFunction = (data: Uint8Array) => Uint8Array;
1252
1252
  interface IRCEncryptorHooks {
1253
1253
  /**
1254
- * 加密回调,用于接收待加密的 opus 音频和 h.264 视频帧数据
1254
+ * @since 5.7.3
1255
+ * 加密回调,用于接收待加密的音频二进制数据的 Uint8Array 类型数组
1255
1256
  */
1256
- decode: RCEncryptFunction<RTCEncodedFrame>;
1257
+ decodeAudio: RCEncryptFunction;
1257
1258
  /**
1258
- * 解密回调,用于接收待解密的 opus 音频和 h.264 视频帧数据
1259
+ * @since 5.7.3
1260
+ * 加密回调,用于接收待加密的视频二进制数据的 Uint8Array 类型数组
1259
1261
  */
1260
- encode: RCEncryptFunction<RTCEncodedFrame>;
1262
+ decodeVideo: RCEncryptFunction;
1263
+ /**
1264
+ * @since 5.7.3
1265
+ * 解密回调,用于接收待解密的音频二进制数据的 Uint8Array 类型数组
1266
+ */
1267
+ encodeAudio: RCEncryptFunction;
1268
+ /**
1269
+ * @since 5.7.3
1270
+ * 解密回调,用于接收待解密的视频二进制数据的 Uint8Array 类型数组
1271
+ */
1272
+ encodeVideo: RCEncryptFunction;
1261
1273
  }
1262
1274
 
1263
1275
  interface IRCTrackBitrate {
@@ -1511,10 +1523,6 @@ interface ISendTrackState extends IRCTrackStat {
1511
1523
  * 流状态(0:不可用, 1:可用)
1512
1524
  */
1513
1525
  trackState: TrackState;
1514
- /**
1515
- * 发送帧数
1516
- */
1517
- framesSent?: number;
1518
1526
  }
1519
1527
  /**
1520
1528
  * receive track 所有字段
@@ -1891,10 +1899,14 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
1891
1899
  */
1892
1900
  onUserJoin?(userIds: string[]): void;
1893
1901
  /**
1894
- * 人员退出
1902
+ * 人员正常退出
1895
1903
  * @param userIds
1896
1904
  */
1897
1905
  onUserLeave?(userIds: string[]): void;
1906
+ /**
1907
+ * 人员离线退出
1908
+ */
1909
+ onUserOffline?(userIds: string[]): void;
1898
1910
  /**
1899
1911
  * 主播开启、停止推 CDN 状态通知
1900
1912
  */
@@ -1975,10 +1987,6 @@ interface IRCRTCInitOptions {
1975
1987
  * 加密机创建参数
1976
1988
  */
1977
1989
  encryptor?: IRCEncryptorHooks;
1978
- /**
1979
- * 是否开启 WebRTC 问题检测器,默认为 `false`
1980
- */
1981
- isOpenWebRTCIssueDetector?: boolean;
1982
1990
  }
1983
1991
  interface ICameraVideoProfile extends IVideoProfile {
1984
1992
  cameraId?: string;
@@ -2702,10 +2710,6 @@ declare class RCMediaService {
2702
2710
  * 请求超时时长
2703
2711
  */
2704
2712
  private readonly _timeout;
2705
- /**
2706
- * navi 中获取的媒体服务地址
2707
- */
2708
- private readonly _msInNavi;
2709
2713
  /**
2710
2714
  * 已失败的请求地址
2711
2715
  */
@@ -2723,16 +2727,11 @@ declare class RCMediaService {
2723
2727
  */
2724
2728
  private _configUrl;
2725
2729
  /**
2726
- * 嗅探中获取的媒体服务地址
2727
- */
2728
- private static isDetector;
2729
- /**
2730
- * 嗅探中获取的媒体服务地址
2730
+ * 排好序的探测地址
2731
2731
  */
2732
2732
  private static msInDetector;
2733
2733
  private static detectorTime;
2734
2734
  private static detectValidMinute;
2735
- static jwtToken: string;
2736
2735
  private _msList;
2737
2736
  private _qualityMsList;
2738
2737
  private readonly _logger;
@@ -2745,19 +2744,33 @@ declare class RCMediaService {
2745
2744
  * 请求超时时长
2746
2745
  */
2747
2746
  _timeout?: number);
2747
+ /**
2748
+ * 是否需要嗅探
2749
+ * im 未连接,无 navi 数据时,不需要嗅探
2750
+ * 客户端手动配置 mediaServer 时,不需要嗅探
2751
+ * navi 数据中 detectionServer 为空时,不需要嗅探
2752
+ * navi 数据中 jwt 为空时,不需要嗅探
2753
+ * 在探测有效期内不需要嗅探
2754
+ * RCMediaService.detectorTime 为 0 时,代表未探测过,需要嗅探
2755
+ */
2756
+ isNededDetector(): boolean;
2748
2757
  detectorMediaSever(): void;
2749
2758
  /**
2750
2759
  * 地址探测
2751
2760
  * RTC 初始化时检测是否可以拿到 navi,可以拿到开始嗅探
2752
2761
  * 拿不到等 IM 链接成功后,再回调中调用开始嗅探
2753
2762
  */
2754
- private _getDetectorUrls;
2755
- getNaviMS(): string[];
2763
+ private _startDetector;
2756
2764
  /**
2757
- * _mslist 列表排序:[_clusterId, ping1, 主域名,ping2, ..., pingN, 备用域名list ]
2765
+ * 清空 msList 列表,重新请求导航后需清空 msList 列表
2766
+ */
2767
+ clearMSList(): void;
2768
+ getMsList(): string[];
2769
+ /**
2770
+ * _mslist 列表排序:[_clusterId, ping1DetectorUrl, 主域名, ping2DetectorUrl, ..., pingNDetectorUrl, 备用域名list ]
2758
2771
  * ping1 :ping 结果返回最快值
2759
2772
  */
2760
- private setMediaServiceList;
2773
+ private _sortMediaServiceList;
2761
2774
  /**
2762
2775
  * 配置 gzip 请求头和请求体
2763
2776
  */
@@ -2950,12 +2963,6 @@ declare class ReportMediaActionLogger {
2950
2963
  recordQualityIceStatusData(iceCandidatePair: IRCCandidatePairStat, status: RTCIceConnectionState, time: number): void;
2951
2964
  }
2952
2965
 
2953
- declare enum RCEncoder {
2954
- VP8 = "VP8",
2955
- VP9 = "VP9",
2956
- H264 = "H264"
2957
- }
2958
-
2959
2966
  declare class RCLocalMediaStream {
2960
2967
  readonly msid: string;
2961
2968
  readonly mediaStream: MediaStream;
@@ -3398,7 +3405,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
3398
3405
  * 是否是房间内观众
3399
3406
  */
3400
3407
  private readonly _isRoomAudience;
3401
- private readonly _options;
3402
3408
  static __INNER_EVENT_TRACK_READY__: string;
3403
3409
  static __INNER_AUDIOLEVEL_CHANGE__: string;
3404
3410
  static __INNER_ICE_STATE_CHANGE__: string;
@@ -3412,7 +3418,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
3412
3418
  private _reportR3R4ToPolarisTimer;
3413
3419
  private _isDestroyed;
3414
3420
  private _formatStatsData?;
3415
- private _WebRTCIssueDetector?;
3416
3421
  constructor(_logger: BasicLogger,
3417
3422
  /**
3418
3423
  * _reTryExchange 方法
@@ -3433,16 +3438,11 @@ declare class RCRTCPeerConnection extends EventEmitter {
3433
3438
  /**
3434
3439
  * 是否是房间内观众
3435
3440
  */
3436
- _isRoomAudience?: boolean, _options?: {
3437
- /**
3438
- * 是否启用自定义加密
3439
- */
3440
- encrypt: boolean;
3441
- /**
3442
- * 是否开启 WebRTC 问题检测器
3443
- */
3444
- isOpenWebRTCIssueDetector: boolean;
3445
- });
3441
+ _isRoomAudience?: boolean,
3442
+ /**
3443
+ * 是否启用自定义加密
3444
+ */
3445
+ encrypt?: boolean);
3446
3446
  getLocalTracks(): RCLocalTrack[];
3447
3447
  private _onConnectionStateChange;
3448
3448
  private startAutoExecute;
@@ -3504,13 +3504,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
3504
3504
  * @param listener
3505
3505
  */
3506
3506
  registerReportListener(listener: IRCRTCReportListener | null): void;
3507
- /**
3508
- * 判断是否发送了两秒视频
3509
- * @param framesSent 发送帧数
3510
- * @param frameRate 发送帧率
3511
- * @param trackId
3512
- */
3513
- private _isSendTwoSecondsVideo;
3514
3507
  /**
3515
3508
  * 组装上行质量报告数据
3516
3509
  */
@@ -3542,17 +3535,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
3542
3535
  */
3543
3536
  __reportR3R4ToPolaris(): Promise<void>;
3544
3537
  getRTCPeerConn(): RTCPeerConnection;
3545
- /**
3546
- * 它返回一个 RTCRtpCodecCapability 对象数组,第一个元素是与传入的编码器类型匹配的元素
3547
- * @param {RCEncoder} encoder - RCEncoder.H264
3548
- * @returns 正在返回 RTCRtpCodecCapability[] 数组。
3549
- */
3550
- private getCapabilitiesCodes;
3551
- /**
3552
- * 它为视频流设置编码器首选项。
3553
- * @param {RCEncoder} [encoder] - RC编码器
3554
- */
3555
- setEncoderPreferences(encoder?: RCEncoder): Promise<void>;
3556
3538
  /**
3557
3539
  * 关闭 RTCPeerConnection 连接。其生命周期:
3558
3540
  * 1. 连接生命周期与房间实例一致(包含观众加房间),仅在退出房间时进行关闭。
@@ -5059,4 +5041,4 @@ declare const helper: {
5059
5041
  ifSupportScreenShare: typeof ifSupportScreenShare;
5060
5042
  };
5061
5043
 
5062
- export { BackgroundPictureFillMode, IAudienceRoomEventListener, IAudioLevelChangeHandler, ICameraVideoProfile, ICreateLocalTrackOptions, IJoinRTCRoomOptions, IJoinResCDNInfo, ILiveAudioState, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPubSuccessRes, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCEncryptorHooks, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRTCUserData, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, IScreenVideoProfile, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCAudioBitrate, RCCameraVideoTrack, RCEncryptFunction, 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, RTCEncodedFrame, RTCJoinType, RTCMode, device, helper, installer };
5044
+ export { BackgroundPictureFillMode, IAudienceRoomEventListener, IAudioLevelChangeHandler, ICameraVideoProfile, ICreateLocalTrackOptions, IJoinRTCRoomOptions, IJoinResCDNInfo, ILiveAudioState, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPubSuccessRes, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCEncryptorHooks, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRTCUserData, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, IScreenVideoProfile, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCAudioBitrate, RCCameraVideoTrack, RCEncryptFunction, 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, RTCMode, device, helper, installer };