trtc-electron-sdk 12.1.608 → 12.2.701

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.
@@ -265,10 +265,11 @@ export declare enum TRTCLogLevel {
265
265
  export declare enum TRTCDeviceState {
266
266
  TRTCDeviceStateAdd = 0,
267
267
  TRTCDeviceStateRemove = 1,
268
- TRTCDeviceStateActive = 2
268
+ TRTCDeviceStateActive = 2,
269
+ TRTCDefaultDeviceChanged = 3
269
270
  }
270
271
  export declare enum TRTCDeviceType {
271
- TRTCDeviceTypeUnknow = -1,
272
+ TRTCDeviceTypeUnknown = -1,
272
273
  TRTCDeviceTypeMic = 0,
273
274
  TRTCDeviceTypeSpeaker = 1,
274
275
  TRTCDeviceTypeCamera = 2
@@ -836,15 +837,22 @@ export declare class TRTCRemoteStatistics {
836
837
  * 而 30% 的丢包率则意味着服务器向 SDK 发送的每10个数据包中就会有3个会在下行传输中丢失。
837
838
  * @param {Number} appCpu - 当前 App 的 CPU 使用率(%)
838
839
  * @param {Number} systemCpu - 当前系统的 CPU 使用率(%)
839
- * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
840
- * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
841
- * 由于数据上下行共享一条网络连接,所以 local remote rtt 相同。
840
+ * @param {Number} rtt - SDK 到云端的往返延时,单位 ms。
841
+ * 该数值代表从 SDK 发送一个网络包到云端,再从云端回送一个网络包到 SDK 的总计耗时,也就是一个网络包经历 “SDK=>云端=>SDK” 的总耗时。
842
+ * 该数值越小越好:如果 rtt < 50ms,意味着较低的音视频通话延迟;如果 rtt > 200ms,则意味着较高的音视频通话延迟。
843
+ * 需要特别解释的是,rtt 代表 “SDK=>云端=>SDK” 的总耗时,所以不需要区分 upRtt 和 downRtt。
842
844
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
843
845
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
844
846
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
845
847
  * @param {Number} localStatisticsArraySize - 数组 localStatisticsArray 的大小
846
848
  * @param {TRTCRemoteStatistics[]} remoteStatisticsArray - 远端成员的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
847
849
  * @param {Number} remoteStatisticsArraySize - 数组 remoteStatisticsArray 的大小
850
+ * @param {Number} gatewayRtt - 从 SDK 到本地路由器的往返时延,单位 ms。
851
+ * 该数值代表从 SDK 发送一个网络包到本地路由器网关,再从网关回送一个网络包到 SDK 的总计耗时,也就是一个网络包经历 “SDK>网关>SDK” 的总耗时。
852
+ * 该数值越小越好:如果 gatewayRtt < 50ms,意味着较低的音视频通话延迟;如果 gatewayRtt > 200ms,则意味着较高的音视频通话延迟。
853
+ * @param {Number} systemMemoryInMB - 当前系统的内存,单位 (MB)
854
+ * @param {Number} systemMemoryUsageInMB - 当前系统内存占用,单位 (MB)
855
+ * @param {Number} appMemoryUsageInMB - 当前应用的内存占用,单位 (MB)
848
856
  *
849
857
  */
850
858
  export declare class TRTCStatistics {
@@ -859,7 +867,11 @@ export declare class TRTCStatistics {
859
867
  localStatisticsArraySize: number;
860
868
  remoteStatisticsArray: TRTCRemoteStatistics[];
861
869
  remoteStatisticsArraySize: number;
862
- constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number, receivedBytes?: number, sentBytes?: number, localStatisticsArray?: TRTCLocalStatistics[], localStatisticsArraySize?: number, remoteStatisticsArray?: TRTCRemoteStatistics[], remoteStatisticsArraySize?: number);
870
+ gatewayRtt: number;
871
+ appMemoryUsageInMB: number;
872
+ systemMemoryUsageInMB: number;
873
+ systemMemoryInMB: number;
874
+ constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number, receivedBytes?: number, sentBytes?: number, localStatisticsArray?: TRTCLocalStatistics[], localStatisticsArraySize?: number, remoteStatisticsArray?: TRTCRemoteStatistics[], remoteStatisticsArraySize?: number, gatewayRtt?: number, appMemoryUsageInMB?: number, systemMemoryUsageInMB?: number, systemMemoryInMB?: number);
863
875
  }
864
876
  /**
865
877
  * 音乐参数
@@ -883,6 +895,15 @@ export declare class AudioMusicParam {
883
895
  endTimeMS: number;
884
896
  constructor(id?: number, path?: string, loopCount?: number, publish?: boolean, isShortFile?: boolean, startTimeMS?: number, endTimeMS?: number);
885
897
  }
898
+ export declare type TRTCAudioMusicParam = {
899
+ id: number;
900
+ path: string;
901
+ loopCount: number;
902
+ publish: boolean;
903
+ isShortFile: boolean;
904
+ startTimeMS: number;
905
+ endTimeMS: number;
906
+ };
886
907
  /**
887
908
  * 背景音乐播放事件监听器类型定义
888
909
  */
@@ -910,6 +931,20 @@ export declare type TRTCMusicPlayObserver = {
910
931
  */
911
932
  onComplete: (id: number, errCode: number) => void | null;
912
933
  };
934
+ export declare type TRTCMusicPreloadObserver = {
935
+ /**
936
+ * 背景音乐预加载进度
937
+ * @param {Number} id - 背景音乐 ID
938
+ * @param {Number} progress - 加载进度
939
+ */
940
+ onLoadProgress: (id: number, progress: number) => void;
941
+ /**
942
+ * 背景音乐预加载出错
943
+ * @param {Number} id - 背景音乐 ID
944
+ * @param {Number} errorCode - 错误码
945
+ */
946
+ onLoadError: (id: number, errorCode: number) => void;
947
+ };
913
948
  /**
914
949
  * 音频数据自定义回调事件监听器类型定义
915
950
  */
@@ -992,6 +1027,9 @@ export declare class VideoBufferInfo {
992
1027
  pixelFormat: TRTCVideoPixelFormat;
993
1028
  });
994
1029
  }
1030
+ /**
1031
+ * 构造函数参数
1032
+ */
995
1033
  export interface TRTCInitConfig {
996
1034
  networkProxy?: {
997
1035
  host: string;
@@ -1004,4 +1042,5 @@ export interface TRTCInitConfig {
1004
1042
  supportUdp: boolean;
1005
1043
  };
1006
1044
  };
1045
+ isIPCMode?: boolean;
1007
1046
  }
@@ -111,7 +111,6 @@ var TRTCVideoResolutionMode;
111
111
  TRTCVideoResolutionMode[TRTCVideoResolutionMode["TRTCVideoResolutionModeLandscape"] = 0] = "TRTCVideoResolutionModeLandscape";
112
112
  TRTCVideoResolutionMode[TRTCVideoResolutionMode["TRTCVideoResolutionModePortrait"] = 1] = "TRTCVideoResolutionModePortrait";
113
113
  })(TRTCVideoResolutionMode = exports.TRTCVideoResolutionMode || (exports.TRTCVideoResolutionMode = {}));
114
- ;
115
114
  /**
116
115
  * 视频流类型
117
116
  *
@@ -140,7 +139,6 @@ var TRTCVideoStreamType;
140
139
  TRTCVideoStreamType[TRTCVideoStreamType["TRTCVideoStreamTypeSmall"] = 1] = "TRTCVideoStreamTypeSmall";
141
140
  TRTCVideoStreamType[TRTCVideoStreamType["TRTCVideoStreamTypeSub"] = 2] = "TRTCVideoStreamTypeSub";
142
141
  })(TRTCVideoStreamType = exports.TRTCVideoStreamType || (exports.TRTCVideoStreamType = {}));
143
- ;
144
142
  /**
145
143
  * 画质级别
146
144
  *
@@ -174,7 +172,6 @@ var TRTCQuality;
174
172
  TRTCQuality[TRTCQuality["TRTCQuality_Vbad"] = 5] = "TRTCQuality_Vbad";
175
173
  TRTCQuality[TRTCQuality["TRTCQuality_Down"] = 6] = "TRTCQuality_Down";
176
174
  })(TRTCQuality = exports.TRTCQuality || (exports.TRTCQuality = {}));
177
- ;
178
175
  /**
179
176
  * 视频画面填充模式
180
177
  *
@@ -195,7 +192,6 @@ var TRTCVideoFillMode;
195
192
  TRTCVideoFillMode[TRTCVideoFillMode["TRTCVideoFillMode_Fill"] = 0] = "TRTCVideoFillMode_Fill";
196
193
  TRTCVideoFillMode[TRTCVideoFillMode["TRTCVideoFillMode_Fit"] = 1] = "TRTCVideoFillMode_Fit";
197
194
  })(TRTCVideoFillMode = exports.TRTCVideoFillMode || (exports.TRTCVideoFillMode = {}));
198
- ;
199
195
  /**
200
196
  * 视频画面旋转方向
201
197
  *
@@ -220,7 +216,6 @@ var TRTCVideoRotation;
220
216
  TRTCVideoRotation[TRTCVideoRotation["TRTCVideoRotation180"] = 2] = "TRTCVideoRotation180";
221
217
  TRTCVideoRotation[TRTCVideoRotation["TRTCVideoRotation270"] = 3] = "TRTCVideoRotation270";
222
218
  })(TRTCVideoRotation = exports.TRTCVideoRotation || (exports.TRTCVideoRotation = {}));
223
- ;
224
219
  /**
225
220
  * 美颜(磨皮)算法
226
221
  *
@@ -240,7 +235,6 @@ var TRTCBeautyStyle;
240
235
  TRTCBeautyStyle[TRTCBeautyStyle["TRTCBeautyStyleSmooth"] = 0] = "TRTCBeautyStyleSmooth";
241
236
  TRTCBeautyStyle[TRTCBeautyStyle["TRTCBeautyStyleNature"] = 1] = "TRTCBeautyStyleNature";
242
237
  })(TRTCBeautyStyle = exports.TRTCBeautyStyle || (exports.TRTCBeautyStyle = {}));
243
- ;
244
238
  /**
245
239
  * 视频像素格式
246
240
  *
@@ -271,7 +265,6 @@ var TRTCVideoPixelFormat;
271
265
  TRTCVideoPixelFormat[TRTCVideoPixelFormat["TRTCVideoPixelFormat_RGBA32"] = 5] = "TRTCVideoPixelFormat_RGBA32";
272
266
  TRTCVideoPixelFormat[TRTCVideoPixelFormat["TRTCVideoPixelFormat_H264"] = 6] = "TRTCVideoPixelFormat_H264";
273
267
  })(TRTCVideoPixelFormat = exports.TRTCVideoPixelFormat || (exports.TRTCVideoPixelFormat = {}));
274
- ;
275
268
  /**
276
269
  * 视频数据包装格式
277
270
  *
@@ -400,7 +393,6 @@ var TRTCAppScene;
400
393
  TRTCAppScene[TRTCAppScene["TRTCAppSceneAudioCall"] = 2] = "TRTCAppSceneAudioCall";
401
394
  TRTCAppScene[TRTCAppScene["TRTCAppSceneVoiceChatRoom"] = 3] = "TRTCAppSceneVoiceChatRoom";
402
395
  })(TRTCAppScene = exports.TRTCAppScene || (exports.TRTCAppScene = {}));
403
- ;
404
396
  /**
405
397
  * 角色,仅适用于直播场景(TRTCAppSceneLIVE 和 TRTCAppSceneVoiceChatRoom)
406
398
  *
@@ -423,7 +415,6 @@ var TRTCRoleType;
423
415
  TRTCRoleType[TRTCRoleType["TRTCRoleAnchor"] = 20] = "TRTCRoleAnchor";
424
416
  TRTCRoleType[TRTCRoleType["TRTCRoleAudience"] = 21] = "TRTCRoleAudience";
425
417
  })(TRTCRoleType = exports.TRTCRoleType || (exports.TRTCRoleType = {}));
426
- ;
427
418
  /**
428
419
  * 流控模式
429
420
  *
@@ -448,7 +439,6 @@ var TRTCQosControlMode;
448
439
  TRTCQosControlMode[TRTCQosControlMode["TRTCQosControlModeClient"] = 0] = "TRTCQosControlModeClient";
449
440
  TRTCQosControlMode[TRTCQosControlMode["TRTCQosControlModeServer"] = 1] = "TRTCQosControlModeServer";
450
441
  })(TRTCQosControlMode = exports.TRTCQosControlMode || (exports.TRTCQosControlMode = {}));
451
- ;
452
442
  /**
453
443
  * 画质偏好
454
444
  *
@@ -471,7 +461,6 @@ var TRTCVideoQosPreference;
471
461
  TRTCVideoQosPreference[TRTCVideoQosPreference["TRTCVideoQosPreferenceSmooth"] = 1] = "TRTCVideoQosPreferenceSmooth";
472
462
  TRTCVideoQosPreference[TRTCVideoQosPreference["TRTCVideoQosPreferenceClear"] = 2] = "TRTCVideoQosPreferenceClear";
473
463
  })(TRTCVideoQosPreference = exports.TRTCVideoQosPreference || (exports.TRTCVideoQosPreference = {}));
474
- ;
475
464
  /////////////////////////////////////////////////////////////////////////////////
476
465
  //
477
466
  // 【(三)继承 TXLiteAVBase 的定义】
@@ -494,7 +483,6 @@ var TRTCAudioFrameFormat;
494
483
  TRTCAudioFrameFormat[TRTCAudioFrameFormat["TRTCAudioFrameFormatNone"] = 0] = "TRTCAudioFrameFormatNone";
495
484
  TRTCAudioFrameFormat[TRTCAudioFrameFormat["TRTCAudioFrameFormatPCM"] = 1] = "TRTCAudioFrameFormatPCM";
496
485
  })(TRTCAudioFrameFormat = exports.TRTCAudioFrameFormat || (exports.TRTCAudioFrameFormat = {}));
497
- ;
498
486
  /**
499
487
  * 屏幕分享目标信息
500
488
  *
@@ -518,7 +506,6 @@ var TRTCScreenCaptureSourceType;
518
506
  TRTCScreenCaptureSourceType[TRTCScreenCaptureSourceType["TRTCScreenCaptureSourceTypeScreen"] = 1] = "TRTCScreenCaptureSourceTypeScreen";
519
507
  TRTCScreenCaptureSourceType[TRTCScreenCaptureSourceType["TRTCScreenCaptureSourceTypeCustom"] = 2] = "TRTCScreenCaptureSourceTypeCustom";
520
508
  })(TRTCScreenCaptureSourceType = exports.TRTCScreenCaptureSourceType || (exports.TRTCScreenCaptureSourceType = {}));
521
- ;
522
509
  /**
523
510
  * 音频质量
524
511
  *
@@ -557,7 +544,6 @@ class TRTCImageBuffer {
557
544
  }
558
545
  }
559
546
  exports.TRTCImageBuffer = TRTCImageBuffer;
560
- ;
561
547
  /**
562
548
  * 屏幕采集源信息
563
549
  *
@@ -588,7 +574,6 @@ class TRTCScreenCaptureSourceInfo {
588
574
  }
589
575
  }
590
576
  exports.TRTCScreenCaptureSourceInfo = TRTCScreenCaptureSourceInfo;
591
- ;
592
577
  /**
593
578
  * 屏幕分享的进阶控制参数
594
579
  *
@@ -634,7 +619,6 @@ class TRTCDeviceInfo {
634
619
  }
635
620
  }
636
621
  exports.TRTCDeviceInfo = TRTCDeviceInfo;
637
- ;
638
622
  /**
639
623
  * 视频帧数据
640
624
  *
@@ -663,7 +647,6 @@ class TRTCVideoFrame {
663
647
  }
664
648
  }
665
649
  exports.TRTCVideoFrame = TRTCVideoFrame;
666
- ;
667
650
  /**
668
651
  * 音频帧数据
669
652
  *
@@ -689,7 +672,6 @@ class TRTCAudioFrame {
689
672
  }
690
673
  }
691
674
  exports.TRTCAudioFrame = TRTCAudioFrame;
692
- ;
693
675
  /////////////////////////////////////////////////////////////////////////////////
694
676
  //
695
677
  // 【(四)更多枚举值定义】
@@ -727,7 +709,6 @@ var TRTCLogLevel;
727
709
  TRTCLogLevel[TRTCLogLevel["TRTCLogLevelFatal"] = 5] = "TRTCLogLevelFatal";
728
710
  TRTCLogLevel[TRTCLogLevel["TRTCLogLevelNone"] = 6] = "TRTCLogLevelNone";
729
711
  })(TRTCLogLevel = exports.TRTCLogLevel || (exports.TRTCLogLevel = {}));
730
- ;
731
712
  /**
732
713
  * 设备操作
733
714
  *
@@ -741,14 +722,16 @@ const TRTCDeviceState_HACK_JSDOC = {
741
722
  TRTCDeviceStateRemove: 1,
742
723
  /** 设备已启用 */
743
724
  TRTCDeviceStateActive: 2,
725
+ /** 系统默认设备变更 */
726
+ TRTCDefaultDeviceChanged: 3,
744
727
  };
745
728
  var TRTCDeviceState;
746
729
  (function (TRTCDeviceState) {
747
730
  TRTCDeviceState[TRTCDeviceState["TRTCDeviceStateAdd"] = 0] = "TRTCDeviceStateAdd";
748
731
  TRTCDeviceState[TRTCDeviceState["TRTCDeviceStateRemove"] = 1] = "TRTCDeviceStateRemove";
749
732
  TRTCDeviceState[TRTCDeviceState["TRTCDeviceStateActive"] = 2] = "TRTCDeviceStateActive";
733
+ TRTCDeviceState[TRTCDeviceState["TRTCDefaultDeviceChanged"] = 3] = "TRTCDefaultDeviceChanged";
750
734
  })(TRTCDeviceState = exports.TRTCDeviceState || (exports.TRTCDeviceState = {}));
751
- ;
752
735
  /**
753
736
  * 设备类型
754
737
  *
@@ -757,7 +740,7 @@ var TRTCDeviceState;
757
740
  */
758
741
  const TRTCDeviceType_HACK_JSDOC = {
759
742
  /** 未知类型 */
760
- TRTCDeviceTypeUnknow: -1,
743
+ TRTCDeviceTypeUnknown: -1,
761
744
  /** 麦克风 */
762
745
  TRTCDeviceTypeMic: 0,
763
746
  /** 扬声器 */
@@ -767,12 +750,11 @@ const TRTCDeviceType_HACK_JSDOC = {
767
750
  };
768
751
  var TRTCDeviceType;
769
752
  (function (TRTCDeviceType) {
770
- TRTCDeviceType[TRTCDeviceType["TRTCDeviceTypeUnknow"] = -1] = "TRTCDeviceTypeUnknow";
753
+ TRTCDeviceType[TRTCDeviceType["TRTCDeviceTypeUnknown"] = -1] = "TRTCDeviceTypeUnknown";
771
754
  TRTCDeviceType[TRTCDeviceType["TRTCDeviceTypeMic"] = 0] = "TRTCDeviceTypeMic";
772
755
  TRTCDeviceType[TRTCDeviceType["TRTCDeviceTypeSpeaker"] = 1] = "TRTCDeviceTypeSpeaker";
773
756
  TRTCDeviceType[TRTCDeviceType["TRTCDeviceTypeCamera"] = 2] = "TRTCDeviceTypeCamera";
774
757
  })(TRTCDeviceType = exports.TRTCDeviceType || (exports.TRTCDeviceType = {}));
775
- ;
776
758
  /**
777
759
  * 摄像头采集偏好
778
760
  *
@@ -828,7 +810,6 @@ var TRTCWaterMarkSrcType;
828
810
  TRTCWaterMarkSrcType[TRTCWaterMarkSrcType["TRTCWaterMarkSrcTypeBGRA32"] = 1] = "TRTCWaterMarkSrcTypeBGRA32";
829
811
  TRTCWaterMarkSrcType[TRTCWaterMarkSrcType["TRTCWaterMarkSrcTypeRGBA32"] = 2] = "TRTCWaterMarkSrcTypeRGBA32";
830
812
  })(TRTCWaterMarkSrcType = exports.TRTCWaterMarkSrcType || (exports.TRTCWaterMarkSrcType = {}));
831
- ;
832
813
  /////////////////////////////////////////////////////////////////////////////////
833
814
  //
834
815
  // 【(五)TRTC 核心类型定义】
@@ -878,7 +859,6 @@ class TRTCParams {
878
859
  }
879
860
  }
880
861
  exports.TRTCParams = TRTCParams;
881
- ;
882
862
  /**
883
863
  * 视频编码参数
884
864
  *
@@ -924,7 +904,6 @@ class TRTCVideoEncParam {
924
904
  }
925
905
  }
926
906
  exports.TRTCVideoEncParam = TRTCVideoEncParam;
927
- ;
928
907
  /**
929
908
  * 画面渲染参数
930
909
  *
@@ -966,7 +945,6 @@ class TRTCNetworkQosParam {
966
945
  }
967
946
  }
968
947
  exports.TRTCNetworkQosParam = TRTCNetworkQosParam;
969
- ;
970
948
  /**
971
949
  * 视频质量
972
950
  *
@@ -983,7 +961,6 @@ class TRTCQualityInfo {
983
961
  }
984
962
  }
985
963
  exports.TRTCQualityInfo = TRTCQualityInfo;
986
- ;
987
964
  /**
988
965
  * 音量大小
989
966
  *
@@ -1009,7 +986,6 @@ class TRTCVolumeInfo {
1009
986
  }
1010
987
  }
1011
988
  exports.TRTCVolumeInfo = TRTCVolumeInfo;
1012
- ;
1013
989
  /**
1014
990
  * 测速参数
1015
991
  *
@@ -1072,7 +1048,6 @@ class TRTCSpeedTestResult {
1072
1048
  }
1073
1049
  }
1074
1050
  exports.TRTCSpeedTestResult = TRTCSpeedTestResult;
1075
- ;
1076
1051
  /**
1077
1052
  * 记录矩形的四个点坐标
1078
1053
  *
@@ -1091,7 +1066,6 @@ class Rect {
1091
1066
  }
1092
1067
  }
1093
1068
  exports.Rect = Rect;
1094
- ;
1095
1069
  /**
1096
1070
  * 云端混流中每一路子画面的位置信息
1097
1071
  *
@@ -1126,7 +1100,6 @@ class TRTCMixUser {
1126
1100
  }
1127
1101
  }
1128
1102
  exports.TRTCMixUser = TRTCMixUser;
1129
- ;
1130
1103
  /**
1131
1104
  * 混流参数配置模式
1132
1105
  *
@@ -1185,7 +1158,6 @@ var TRTCTranscodingConfigMode;
1185
1158
  TRTCTranscodingConfigMode[TRTCTranscodingConfigMode["TRTC_TranscodingConfigMode_Template_PresetLayout"] = 8] = "TRTC_TranscodingConfigMode_Template_PresetLayout";
1186
1159
  TRTCTranscodingConfigMode[TRTCTranscodingConfigMode["TRTC_TranscodingConfigMode_Template_ScreenSharing"] = 9] = "TRTC_TranscodingConfigMode_Template_ScreenSharing";
1187
1160
  })(TRTCTranscodingConfigMode = exports.TRTCTranscodingConfigMode || (exports.TRTCTranscodingConfigMode = {}));
1188
- ;
1189
1161
  /**
1190
1162
  * 混流输入类型
1191
1163
  *
@@ -1440,7 +1412,6 @@ class TRTCTranscodingConfig {
1440
1412
  }
1441
1413
  }
1442
1414
  exports.TRTCTranscodingConfig = TRTCTranscodingConfig;
1443
- ;
1444
1415
  /**
1445
1416
  * CDN 旁路推流参数
1446
1417
  *
@@ -1459,7 +1430,6 @@ class TRTCPublishCDNParam {
1459
1430
  }
1460
1431
  }
1461
1432
  exports.TRTCPublishCDNParam = TRTCPublishCDNParam;
1462
- ;
1463
1433
  /**
1464
1434
  * 录音参数
1465
1435
  *
@@ -1479,7 +1449,6 @@ class TRTCAudioRecordingParams {
1479
1449
  }
1480
1450
  }
1481
1451
  exports.TRTCAudioRecordingParams = TRTCAudioRecordingParams;
1482
- ;
1483
1452
  /**
1484
1453
  * 音效
1485
1454
  *
@@ -1503,7 +1472,6 @@ class TRTCAudioEffectParam {
1503
1472
  }
1504
1473
  }
1505
1474
  exports.TRTCAudioEffectParam = TRTCAudioEffectParam;
1506
- ;
1507
1475
  /**
1508
1476
  * 本地的音视频统计信息
1509
1477
  *
@@ -1528,7 +1496,6 @@ class TRTCLocalStatistics {
1528
1496
  }
1529
1497
  }
1530
1498
  exports.TRTCLocalStatistics = TRTCLocalStatistics;
1531
- ;
1532
1499
  /**
1533
1500
  * 远端成员的音视频统计信息
1534
1501
  *
@@ -1592,7 +1559,6 @@ class TRTCRemoteStatistics {
1592
1559
  }
1593
1560
  }
1594
1561
  exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1595
- ;
1596
1562
  /**
1597
1563
  * 统计数据
1598
1564
  *
@@ -1602,19 +1568,26 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1602
1568
  * 而 30% 的丢包率则意味着服务器向 SDK 发送的每10个数据包中就会有3个会在下行传输中丢失。
1603
1569
  * @param {Number} appCpu - 当前 App 的 CPU 使用率(%)
1604
1570
  * @param {Number} systemCpu - 当前系统的 CPU 使用率(%)
1605
- * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
1606
- * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
1607
- * 由于数据上下行共享一条网络连接,所以 local remote rtt 相同。
1571
+ * @param {Number} rtt - SDK 到云端的往返延时,单位 ms。
1572
+ * 该数值代表从 SDK 发送一个网络包到云端,再从云端回送一个网络包到 SDK 的总计耗时,也就是一个网络包经历 “SDK=>云端=>SDK” 的总耗时。
1573
+ * 该数值越小越好:如果 rtt < 50ms,意味着较低的音视频通话延迟;如果 rtt > 200ms,则意味着较高的音视频通话延迟。
1574
+ * 需要特别解释的是,rtt 代表 “SDK=>云端=>SDK” 的总耗时,所以不需要区分 upRtt 和 downRtt。
1608
1575
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
1609
1576
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
1610
1577
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
1611
1578
  * @param {Number} localStatisticsArraySize - 数组 localStatisticsArray 的大小
1612
1579
  * @param {TRTCRemoteStatistics[]} remoteStatisticsArray - 远端成员的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
1613
1580
  * @param {Number} remoteStatisticsArraySize - 数组 remoteStatisticsArray 的大小
1581
+ * @param {Number} gatewayRtt - 从 SDK 到本地路由器的往返时延,单位 ms。
1582
+ * 该数值代表从 SDK 发送一个网络包到本地路由器网关,再从网关回送一个网络包到 SDK 的总计耗时,也就是一个网络包经历 “SDK>网关>SDK” 的总耗时。
1583
+ * 该数值越小越好:如果 gatewayRtt < 50ms,意味着较低的音视频通话延迟;如果 gatewayRtt > 200ms,则意味着较高的音视频通话延迟。
1584
+ * @param {Number} systemMemoryInMB - 当前系统的内存,单位 (MB)
1585
+ * @param {Number} systemMemoryUsageInMB - 当前系统内存占用,单位 (MB)
1586
+ * @param {Number} appMemoryUsageInMB - 当前应用的内存占用,单位 (MB)
1614
1587
  *
1615
1588
  */
1616
1589
  class TRTCStatistics {
1617
- constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
1590
+ constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0, gatewayRtt = 0, appMemoryUsageInMB = 0, systemMemoryUsageInMB = 0, systemMemoryInMB = 0) {
1618
1591
  this.upLoss = upLoss;
1619
1592
  this.downLoss = downLoss;
1620
1593
  this.appCpu = appCpu;
@@ -1626,10 +1599,13 @@ class TRTCStatistics {
1626
1599
  this.localStatisticsArraySize = localStatisticsArraySize;
1627
1600
  this.remoteStatisticsArray = remoteStatisticsArray;
1628
1601
  this.remoteStatisticsArraySize = remoteStatisticsArraySize;
1602
+ this.gatewayRtt = gatewayRtt;
1603
+ this.appMemoryUsageInMB = appMemoryUsageInMB;
1604
+ this.systemMemoryUsageInMB = systemMemoryUsageInMB;
1605
+ this.systemMemoryInMB = systemMemoryInMB;
1629
1606
  }
1630
1607
  }
1631
1608
  exports.TRTCStatistics = TRTCStatistics;
1632
- ;
1633
1609
  /**
1634
1610
  * 音乐参数
1635
1611
  *
@@ -1661,19 +1637,36 @@ exports.AudioMusicParam = AudioMusicParam;
1661
1637
  */
1662
1638
  /**
1663
1639
  * @callback TRTCMusicEvent~onStart
1664
- * @param {number} [id] - 背景音乐 ID
1665
- * @param {number} [errCode] - 错误码。0: 开始播放成功;-4001: 打开文件失败,如音频文件格式不支持,本地音频文件不存在,网络音频文件无法访问等。
1640
+ * @param {Number} [id] - 背景音乐 ID
1641
+ * @param {Number} [errCode] - 错误码。0: 开始播放成功;-4001: 打开文件失败,如音频文件格式不支持,本地音频文件不存在,网络音频文件无法访问等。
1666
1642
  */
1667
1643
  /**
1668
1644
  * @callback TRTCMusicEvent~onPlayProgress
1669
- * @param {number} [id] - 背景音乐 ID
1645
+ * @param {Number} [id] - 背景音乐 ID
1670
1646
  * @param {Number} [curPtsMS] - 背景音乐当前播放时间戳
1671
1647
  * @param {Number} [durationMS] - 背景音乐时长
1672
1648
  */
1673
1649
  /**
1674
1650
  * @callback TRTCMusicEvent~onComplete
1675
- * @param {number} [id] - 背景音乐 ID
1676
- * @param {number} [errCode] - 错误码。0: 播放结束;-4002: 解码失败,如音频文件损坏,网络音频文件服务器无法访问等。
1651
+ * @param {Number} [id] - 背景音乐 ID
1652
+ * @param {Number} [errCode] - 错误码。0: 播放结束;-4002: 解码失败,如音频文件损坏,网络音频文件服务器无法访问等。
1653
+ */
1654
+ /**
1655
+ * @callback TRTCMusicEvent~onLoadProgress
1656
+ * @param {Number} [id] - 背景音乐 ID
1657
+ * @param {Number} [progress] - 加载进度
1658
+ */
1659
+ /**
1660
+ * @callback TRTCMusicEvent~onLoadError
1661
+ * @param {Number} [id] - 背景音乐 ID
1662
+ * @param {Number} [errorCode] - errorCode
1663
+ * - -4001:打开文件失败,如音频数据无效,FFMPEG 协议未找到等;
1664
+ * - -4002:解码失败,如音频文件损坏,网络音频文件服务器无法访问等;
1665
+ * - -4003:预加载数量超上限,请先调用 stopPlayMusic 释放无用的预加载;
1666
+ * - -4005:非法路径导致打开文件失败,请检查您传入的路径参数是否指向一个合法的音乐文件;
1667
+ * - -4006:非法URL导致打开文件失败,请用浏览器检查您传入的 URL 地址是否可以下载到期望的音乐文件;
1668
+ * - -4007:无音频流导致打开文件失败,请确认您传入的文件是否是合法的音频文件,以及文件是否被损坏;
1669
+ * - -4008:格式不支持导致打开文件失败,请确认您传入的文件格式是否是支持的文件格式,移动端支持【mp3,aac,m4a,wav,ogg,mp4,mkv】,桌面端支持【mp3,aac,m4a,wav,mp4,mkv】。
1677
1670
  */
1678
1671
  /**
1679
1672
  * 背景音乐播放事件回调
@@ -1684,6 +1677,14 @@ exports.AudioMusicParam = AudioMusicParam;
1684
1677
  * @property {TRTCMusicEvent~onComplete|null} onComplete - 背景音乐播放完毕事件。
1685
1678
  */
1686
1679
  const TRTCMusicPlayObserver_HACK_JSDOC = null;
1680
+ /**
1681
+ * 背景音乐预加载事件回调
1682
+ *
1683
+ * @typedef {Object} TRTCMusicPreloadObserver
1684
+ * @property {TRTCMusicEvent~onLoadProgress|null} onLoadProgress - 背景音乐预加载进度
1685
+ * @property {TRTCMusicEvent~onLoadError|null} onLoadError - 背景音乐预加载出错
1686
+ */
1687
+ const TRTCMusicPreloadObserver_HACK_JSDOC = null;
1687
1688
  /**
1688
1689
  * 音频数据自定义回调
1689
1690
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "12.1.608",
3
+ "version": "12.2.701",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",