trtc-electron-sdk 9.3.301 → 9.5.100-beta.0

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/liteav/trtc.d.ts CHANGED
@@ -39,7 +39,6 @@ declare class TRTCCloud extends EventEmitter {
39
39
  private audioQuality;
40
40
  private bgmId;
41
41
  private playAudioEffectIdList;
42
- private enableRenderFrame;
43
42
  constructor();
44
43
  /**
45
44
  * 创建 TRTCCloud 对象单例
@@ -1494,29 +1493,6 @@ declare class TRTCCloud extends EventEmitter {
1494
1493
  * @param {Number} volume - 设置的混音音量大小,范围0 - 100
1495
1494
  */
1496
1495
  setSubStreamMixVolume(volume: number): void;
1497
- /**
1498
- * 8.13 将指定窗口加入屏幕分享的排除列表中,加入排除列表中的窗口不会被分享出去
1499
- *
1500
- * 支持启动屏幕分享前设置过滤窗口,也支持屏幕分享过程中动态添加过滤窗口。
1501
- *
1502
- * @param {String} win - 不希望分享出去的窗口
1503
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1504
- * - Windows下该方法添加的窗口列表会在退房后清空;Mac下在退出房间时不会自动清空,需要调用一次removeAllExcludedShareWindow()方法清空列表。
1505
- */
1506
- addExcludedShareWindow(win: string): void;
1507
- /**
1508
- * 8.14 将指定窗口从屏幕分享的排除列表中移除
1509
- *
1510
- * @param {String} win - 不希望分享出去的窗口
1511
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1512
- */
1513
- removeExcludedShareWindow(win: string): void;
1514
- /**
1515
- * 8.15 将所有窗口从屏幕分享的排除列表中移除
1516
- *
1517
- * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1518
- */
1519
- removeAllExcludedShareWindow(): void;
1520
1496
  /**
1521
1497
  * @private
1522
1498
  * 9.5 设置本地视频自定义渲染(Electron 平台下不可用)
@@ -1770,6 +1746,13 @@ declare class TRTCCloud extends EventEmitter {
1770
1746
  * @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 100;默认值:100
1771
1747
  */
1772
1748
  setMusicPublishVolume(id: number, volume: number): void;
1749
+ /**
1750
+ * 11.22 调整背景音乐的变速效果
1751
+ *
1752
+ * @param {Number} id - 音乐 ID
1753
+ * @param {Number} speedRate - 速度,默认值是1.0f,范围是:[0.5 ~ 2] 之间的浮点数;
1754
+ */
1755
+ setMusicSpeedRate(id: number, speedRate: number): void;
1773
1756
  /**
1774
1757
  * 12.1 废弃接口: 播放音效
1775
1758
  *
@@ -1976,9 +1959,7 @@ declare class TRTCCloud extends EventEmitter {
1976
1959
  removePlugin(id: string): void;
1977
1960
  getPluginList(): PluginInfo[];
1978
1961
  createPlugin(pluginId: string): PluginInfo;
1979
- setPluginCallback(pluginCb: (pluginId: string, errorCode: number, msg: string) => void): void;
1980
1962
  getKey(uid: string, type: TRTCVideoStreamType): string;
1981
- setEnableRenderFrame(enable: boolean): void;
1982
1963
  /**
1983
1964
  * 判断是否支持webGL
1984
1965
  * @returns {boolean}
package/liteav/trtc.js CHANGED
@@ -31,7 +31,6 @@ __exportStar(require("./trtc_define"), exports);
31
31
  __exportStar(require("./trtc_code"), exports);
32
32
  // 监听该事件,返回自定义视频渲染数据 ( bgra 格式)
33
33
  const CUSTOM_VIDEO_DATA = 'onVideoData';
34
- const SDK_LOG_LEVEL = 2;
35
34
  let genSecFunc = function (instance, key) {
36
35
  return function () {
37
36
  let param = Array.from(arguments);
@@ -67,20 +66,7 @@ let secMethods = function (instance) {
67
66
  copyMethods(instance);
68
67
  copyPropMethods(instance);
69
68
  };
70
- let formatLogParams = function (params) {
71
- let logParamsStr = '';
72
- let paramsKeyList = Object.keys(params);
73
- for (let i = 0; i < paramsKeyList.length; i++) {
74
- const paramKey = paramsKeyList[i];
75
- logParamsStr += `${paramKey}:${params[paramKey]}`;
76
- if (i !== paramsKeyList.length - 1) {
77
- logParamsStr += ',';
78
- }
79
- }
80
- return logParamsStr;
81
- };
82
69
  let trtcCloudInstance = null;
83
- let oriRtcCloud = null;
84
70
  /**
85
71
  * 腾讯云视频通话功能的主要接口类
86
72
  *
@@ -96,10 +82,7 @@ let oriRtcCloud = null;
96
82
  class TRTCCloud extends events_1.EventEmitter {
97
83
  constructor() {
98
84
  super();
99
- oriRtcCloud = new trtc.NodeRTCCloud(pkg.version);
100
- this.rtcCloud = Object.assign({}, oriRtcCloud, {
101
- onlineLog: undefined
102
- });
85
+ this.rtcCloud = new trtc.NodeRTCCloud(pkg.version);
103
86
  this.streams = new Map();
104
87
  this.firstVideoFrameList = [];
105
88
  this.playStreamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
@@ -120,7 +103,6 @@ class TRTCCloud extends events_1.EventEmitter {
120
103
  // 生成一个足够大, 不会与用户输入重复的 id
121
104
  this.bgmId = 1 << 29;
122
105
  this.playAudioEffectIdList = [];
123
- this.enableRenderFrame = true;
124
106
  this.initEventHandler();
125
107
  console.log('constructor render:' + this.renderMode + '|sdk version:' + pkg.version +
126
108
  '|native sdk version:' + this.rtcCloud.getSDKVersion());
@@ -401,13 +383,6 @@ class TRTCCloud extends events_1.EventEmitter {
401
383
  */
402
384
  handleOnEnterRoom(result) {
403
385
  this.fire('onEnterRoom', result);
404
- const params = {
405
- js_version: pkg.version,
406
- electron_version: process && process.versions && process.versions.electron || '',
407
- arch: process && process.arch || '',
408
- ua: window.navigator.userAgent
409
- };
410
- oriRtcCloud.onlineLog(result, SDK_LOG_LEVEL, '[trtc-electron-sdk] trtcstats', formatLogParams(params));
411
386
  }
412
387
  /**
413
388
  * 2.2 退出房间的事件回调
@@ -505,15 +480,15 @@ class TRTCCloud extends events_1.EventEmitter {
505
480
  * @param {Number} reason - 离开原因,0表示用户主动退出房间,1表示用户超时退出,2表示被踢出房间。
506
481
  */
507
482
  handleOnRemoteUserLeaveRoom(userId, reason) {
508
- const streamTypeList = [
509
- trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig,
510
- trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub,
511
- trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall
512
- ];
513
- streamTypeList.forEach(streamType => {
514
- const key = this.getKey(userId, streamType);
515
- this._destroyRender(key, null);
516
- });
483
+ // const streamTypeList = [
484
+ // TRTCVideoStreamType.TRTCVideoStreamTypeBig,
485
+ // TRTCVideoStreamType.TRTCVideoStreamTypeSub,
486
+ // TRTCVideoStreamType.TRTCVideoStreamTypeSmall
487
+ // ];
488
+ // streamTypeList.forEach(streamType => {
489
+ // const key = this.getKey(userId, streamType);
490
+ // this._destroyRender(key, null);
491
+ // });
517
492
  this.fire('onRemoteUserLeaveRoom', userId, reason);
518
493
  }
519
494
  /**
@@ -1472,13 +1447,7 @@ class TRTCCloud extends events_1.EventEmitter {
1472
1447
  }
1473
1448
  if (view !== undefined) {
1474
1449
  if (view !== null) {
1475
- let bindStreamType = streamType;
1476
- if (bindStreamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall) {
1477
- // 如果拉取小流, 绑定 render 时也采用大流, 防止大小流切换后无法找到对应 render 进行渲染
1478
- // 这里的逻辑和 _onRenderFrame 里, 获取 render 是不论小流还是大流, 都采用大流取获取 render 有关
1479
- bindStreamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
1480
- }
1481
- const key = this.getKey(userId, bindStreamType);
1450
+ const key = this.getKey(userId, streamType);
1482
1451
  this._initRender(key, view);
1483
1452
  }
1484
1453
  this.addRemoteVideoRenderCallback(userId);
@@ -2400,35 +2369,6 @@ class TRTCCloud extends events_1.EventEmitter {
2400
2369
  setSubStreamMixVolume(volume) {
2401
2370
  this.rtcCloud.setSubStreamMixVolume(volume);
2402
2371
  }
2403
- /**
2404
- * 8.13 将指定窗口加入屏幕分享的排除列表中,加入排除列表中的窗口不会被分享出去
2405
- *
2406
- * 支持启动屏幕分享前设置过滤窗口,也支持屏幕分享过程中动态添加过滤窗口。
2407
- *
2408
- * @param {String} win - 不希望分享出去的窗口
2409
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
2410
- * - Windows下该方法添加的窗口列表会在退房后清空;Mac下在退出房间时不会自动清空,需要调用一次removeAllExcludedShareWindow()方法清空列表。
2411
- */
2412
- addExcludedShareWindow(win) {
2413
- this.rtcCloud.addExcludedShareWindow(win);
2414
- }
2415
- /**
2416
- * 8.14 将指定窗口从屏幕分享的排除列表中移除
2417
- *
2418
- * @param {String} win - 不希望分享出去的窗口
2419
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
2420
- */
2421
- removeExcludedShareWindow(win) {
2422
- this.rtcCloud.removeExcludedShareWindow(win);
2423
- }
2424
- /**
2425
- * 8.15 将所有窗口从屏幕分享的排除列表中移除
2426
- *
2427
- * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
2428
- */
2429
- removeAllExcludedShareWindow() {
2430
- this.rtcCloud.removeAllExcludedShareWindow();
2431
- }
2432
2372
  /////////////////////////////////////////////////////////////////////////////////
2433
2373
  //
2434
2374
  // (九)自定义采集和渲染
@@ -2807,6 +2747,15 @@ class TRTCCloud extends events_1.EventEmitter {
2807
2747
  setMusicPublishVolume(id, volume) {
2808
2748
  this.rtcCloud.setMusicPublishVolume(id, volume);
2809
2749
  }
2750
+ /**
2751
+ * 11.22 调整背景音乐的变速效果
2752
+ *
2753
+ * @param {Number} id - 音乐 ID
2754
+ * @param {Number} speedRate - 速度,默认值是1.0f,范围是:[0.5 ~ 2] 之间的浮点数;
2755
+ */
2756
+ setMusicSpeedRate(id, speedRate) {
2757
+ this.rtcCloud.setMusicSpeedRate(id, speedRate);
2758
+ }
2810
2759
  /////////////////////////////////////////////////////////////////////////////////
2811
2760
  //
2812
2761
  // (十二)音效相关接口函数
@@ -2960,9 +2909,6 @@ class TRTCCloud extends events_1.EventEmitter {
2960
2909
  let key = this.getKey('camera_device_test_view', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
2961
2910
  this._destroyRender(key, null);
2962
2911
  this.rtcCloud.stopCameraDeviceTest();
2963
- this.firstVideoFrameList = this.firstVideoFrameList.filter(function (item) {
2964
- return !('' === item.uid && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
2965
- });
2966
2912
  }
2967
2913
  /**
2968
2914
  * 13.5 开始进行麦克风测试
@@ -3103,9 +3049,7 @@ class TRTCCloud extends events_1.EventEmitter {
3103
3049
  this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
3104
3050
  }
3105
3051
  this.rtcCloud.addLocalVideoRenderCallback((id, type, width, height, timestamp, rotation, data) => {
3106
- if (this.enableRenderFrame) {
3107
- this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3108
- }
3052
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3109
3053
  }, this.pixelformate);
3110
3054
  }
3111
3055
  addRemoteVideoRenderCallback(userid) {
@@ -3116,9 +3060,7 @@ class TRTCCloud extends events_1.EventEmitter {
3116
3060
  this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
3117
3061
  }
3118
3062
  this.rtcCloud.addRemoteVideoRenderCallback(userid, (id, type, width, height, timestamp, rotation, data) => {
3119
- if (this.enableRenderFrame) {
3120
- this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3121
- }
3063
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3122
3064
  }, this.pixelformate);
3123
3065
  }
3124
3066
  //----------------------------------//
@@ -3183,16 +3125,9 @@ class TRTCCloud extends events_1.EventEmitter {
3183
3125
  }
3184
3126
  };
3185
3127
  }
3186
- setPluginCallback(pluginCb) {
3187
- this.rtcCloud.setPluginCallback(pluginCb);
3188
- }
3189
3128
  getKey(uid, type) {
3190
3129
  return String(uid) + '_' + String(type);
3191
3130
  }
3192
- setEnableRenderFrame(enable) {
3193
- console.log('setEnableRenderFrame:' + enable);
3194
- this.enableRenderFrame = enable;
3195
- }
3196
3131
  /**
3197
3132
  * 判断是否支持webGL
3198
3133
  * @returns {boolean}
@@ -3280,9 +3215,6 @@ class TRTCCloud extends events_1.EventEmitter {
3280
3215
  });
3281
3216
  // 画面不区分大小流,只区分主流和辅流(屏幕分享),这里统一使用主流当做 key
3282
3217
  let streamType = type;
3283
- if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall) {
3284
- streamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
3285
- }
3286
3218
  this._onRealRender(uid, streamType, width, height, timestamp, rotation, data);
3287
3219
  }
3288
3220
  //回调远程给用户数据
@@ -119,7 +119,7 @@ export declare class TRTCImageBuffer {
119
119
  length: number;
120
120
  width: number;
121
121
  height: number;
122
- constructor(buffer?: ArrayBuffer, length?: number, width?: number, height?: number);
122
+ constructor();
123
123
  }
124
124
  /**
125
125
  * 3.5 屏幕采集源信息
@@ -129,7 +129,6 @@ export declare class TRTCImageBuffer {
129
129
  * @param {String} sourceName - 采集源名称,UTF8编码
130
130
  * @param {TRTCImageBuffer} thumbBGRA - 缩略图内容
131
131
  * @param {TRTCImageBuffer} iconBGRA - 图标内容
132
- * @param {Boolean} isMinimizeWindow - 是否最小化窗口
133
132
  *
134
133
  */
135
134
  export declare class TRTCScreenCaptureSourceInfo {
@@ -138,8 +137,7 @@ export declare class TRTCScreenCaptureSourceInfo {
138
137
  sourceName: string;
139
138
  thumbBGRA: TRTCImageBuffer;
140
139
  iconBGRA: TRTCImageBuffer;
141
- isMinimizeWindow: boolean;
142
- constructor(type?: TRTCScreenCaptureSourceType, sourceId?: string, sourceName?: string, thumbBGRA?: TRTCImageBuffer, iconBGRA?: TRTCImageBuffer, isMinimizeWindow?: boolean);
140
+ constructor();
143
141
  }
144
142
  /**
145
143
  * 3.6 设备信息
@@ -151,7 +149,7 @@ export declare class TRTCScreenCaptureSourceInfo {
151
149
  export declare class TRTCDeviceInfo {
152
150
  deviceId: string;
153
151
  deviceName: string;
154
- constructor(deviceId?: string, deviceName?: string);
152
+ constructor();
155
153
  }
156
154
  /**
157
155
  * 3.7 视频帧数据
@@ -177,7 +175,7 @@ export declare class TRTCVideoFrame {
177
175
  height: number;
178
176
  timestamp: number;
179
177
  rotation: number;
180
- constructor(videoFormat?: TRTCVideoPixelFormat, bufferType?: TRTCVideoBufferType, data?: null | ArrayBuffer, textureId?: number, length?: number, width?: number, height?: number, timestamp?: number, rotation?: number);
178
+ constructor();
181
179
  }
182
180
  export declare enum TRTCLogLevel {
183
181
  TRTCLogLevelNone = 0,
@@ -215,10 +213,8 @@ export declare enum TRTCWaterMarkSrcType {
215
213
  * 【推荐取值】如果一个用户在您的账号系统中的 ID 为“abc”,则 userId 即可设置为“abc”。<br>
216
214
  * @param {String} userSig - 【字段含义】用户签名(必填),当前 userId 对应的验证签名,相当于登录密码。<br>
217
215
  * 【推荐取值】请参考 [如何计算UserSig](https://cloud.tencent.com/document/product/647/17275)。<br>
218
- * @param {Number} roomId - 【字段含义】房间号码(必填),指定房间号,在同一个房间里的用户(userId)可以彼此看到对方并进行视频通话, roomId 和 strRoomId 必须填一个, 若您选用 strRoomId,则 roomId 需要填写为0。<br>
216
+ * @param {Number} roomId - 【字段含义】房间号码(必填),指定房间号,在同一个房间里的用户(userId)可以彼此看到对方并进行视频通话。<br>
219
217
  * 【推荐取值】您可以随意指定,但请不要重复,如果您的用户账号 ID 是数字类型的,可以直接用创建者的用户 ID 作为 roomId。<br>
220
- * @param {String} strRoomId - 【字段含义】字符串房间号码(选填),roomId 和 strRoomId 必须填一个。若两者都填,则优先选择 roomId。<br>
221
- * 【推荐取值】您可以随意指定,但请不要重复。<br>
222
218
  * @param {TRTCRoleType} role - 【字段含义】直播场景下的角色,仅适用于直播场景(TRTCAppSceneLIVE 和 TRTCAppSceneVoiceChatRoom),视频通话场景下指定无效。<br>
223
219
  * 【推荐取值】默认值:主播(TRTCRoleAnchor)<br>
224
220
  * @param {String} privateMapKey - 【字段含义】房间签名(非必填),如果您希望某个房间只能让特定的某些 userId 进入,就需要使用 privateMapKey 进行权限保护。<br>
@@ -235,8 +231,8 @@ export declare enum TRTCWaterMarkSrcType {
235
231
  */
236
232
  export declare class TRTCParams {
237
233
  sdkAppId: number;
238
- userId: string;
239
- userSig: string;
234
+ userId: null | string;
235
+ userSig: null | string;
240
236
  roomId: number;
241
237
  strRoomId: string;
242
238
  role: number;
@@ -244,7 +240,7 @@ export declare class TRTCParams {
244
240
  businessInfo: null | string;
245
241
  streamId: null | string;
246
242
  userDefineRecordId: null | string;
247
- constructor(sdkAppId?: number, userId?: string, userSig?: string, roomId?: number, strRoomId?: string, role?: TRTCRoleType, privateMapKey?: null | string, businessInfo?: null | string, streamId?: null | string, userDefineRecordId?: null | string);
243
+ constructor();
248
244
  }
249
245
  /**
250
246
  * 5.2 视频编码参数
@@ -285,12 +281,12 @@ export declare class TRTCParams {
285
281
  */
286
282
  export declare class TRTCVideoEncParam {
287
283
  videoResolution: TRTCVideoResolution;
288
- resMode: TRTCVideoResolutionMode;
284
+ resMode: number;
289
285
  videoFps: number;
290
286
  videoBitrate: number;
291
287
  minVideoBitrate: number;
292
288
  enableAdjustRes: boolean;
293
- constructor(videoResolution?: TRTCVideoResolution, resMode?: TRTCVideoResolutionMode, videoFps?: number, videoBitrate?: number, minVideoBitrate?: number, enableAdjustRes?: boolean);
289
+ constructor();
294
290
  }
295
291
  /**
296
292
  * 5.3 画面渲染参数
@@ -306,7 +302,7 @@ export declare class TRTCRenderParams {
306
302
  rotation: TRTCVideoRotation;
307
303
  fillMode: TRTCVideoFillMode;
308
304
  mirrorType: TRTCVideoMirrorType;
309
- constructor(rotation?: TRTCVideoRotation, fillMode?: TRTCVideoFillMode, mirrorType?: TRTCVideoMirrorType);
305
+ constructor();
310
306
  }
311
307
  /**
312
308
  * 5.4 网络流控相关参数
@@ -325,9 +321,9 @@ export declare class TRTCRenderParams {
325
321
  *
326
322
  */
327
323
  export declare class TRTCNetworkQosParam {
328
- preference: TRTCVideoQosPreference;
329
- controlMode: TRTCQosControlMode;
330
- constructor(preference?: TRTCVideoQosPreference, controlMode?: TRTCQosControlMode);
324
+ preference: number;
325
+ controlMode: number;
326
+ constructor();
331
327
  }
332
328
  /**
333
329
  * 5.5 视频质量
@@ -339,9 +335,9 @@ export declare class TRTCNetworkQosParam {
339
335
  *
340
336
  */
341
337
  export declare class TRTCQualityInfo {
342
- userId: string;
338
+ userId: null | string;
343
339
  quality: TRTCQuality;
344
- constructor(userId?: string, quality?: TRTCQuality);
340
+ constructor();
345
341
  }
346
342
  /**
347
343
  * 5.6 音量大小
@@ -353,9 +349,9 @@ export declare class TRTCQualityInfo {
353
349
  *
354
350
  */
355
351
  export declare class TRTCVolumeInfo {
356
- userId: string;
352
+ userId: null | string;
357
353
  volume: number;
358
- constructor(userId?: string, volume?: number);
354
+ constructor();
359
355
  }
360
356
  /**
361
357
  * 5.8 网络测速结果
@@ -377,12 +373,12 @@ export declare class TRTCVolumeInfo {
377
373
  *
378
374
  */
379
375
  export declare class TRTCSpeedTestResult {
380
- ip: string;
381
- quality: TRTCQuality;
376
+ ip: null | string;
377
+ quality: number;
382
378
  upLostRate: number;
383
379
  downLostRate: number;
384
380
  rtt: number;
385
- constructor(ip?: string, quality?: TRTCQuality, upLostRate?: number, downLostRate?: number, rtt?: number);
381
+ constructor();
386
382
  }
387
383
  /**
388
384
  * 记录矩形的四个点坐标
@@ -423,8 +419,8 @@ export declare class TRTCMixUser {
423
419
  rect: null | Rect;
424
420
  zOrder: number;
425
421
  pureAudio: boolean;
426
- streamType: TRTCVideoStreamType;
427
- constructor(userId?: string, roomId?: string, rect?: null | Rect, zOrder?: number, pureAudio?: boolean, streamType?: TRTCVideoStreamType);
422
+ streamType: number;
423
+ constructor();
428
424
  }
429
425
  export declare enum TRTCTranscodingConfigMode {
430
426
  TRTCTranscodingConfigMode_Unknown = 0,
@@ -478,7 +474,7 @@ export declare enum TRTCTranscodingConfigMode {
478
474
  * 【推荐取值】默认值:'',即房间里的多路流会混合到该接口调用者的视频流上。
479
475
  */
480
476
  export declare class TRTCTranscodingConfig {
481
- mode: TRTCTranscodingConfigMode;
477
+ mode: number;
482
478
  appId: number;
483
479
  bizId: number;
484
480
  videoWidth: number;
@@ -486,14 +482,14 @@ export declare class TRTCTranscodingConfig {
486
482
  videoBitrate: number;
487
483
  videoFramerate: number;
488
484
  videoGOP: number;
489
- backgroundColor: number;
490
- backgroundImage: string;
491
485
  audioSampleRate: number;
492
486
  audioBitrate: number;
493
487
  audioChannels: number;
494
488
  mixUsersArray: TRTCMixUser[];
489
+ backgroundColor: number;
490
+ backgroundImage: string;
495
491
  streamId: string;
496
- constructor(mode?: TRTCTranscodingConfigMode, appId?: number, bizId?: number, videoWidth?: number, videoHeight?: number, videoBitrate?: number, videoFramerate?: number, videoGOP?: number, backgroundColor?: number, backgroundImage?: string, audioSampleRate?: number, audioBitrate?: number, audioChannels?: number, mixUsersArray?: any[], streamId?: string);
492
+ constructor();
497
493
  }
498
494
  /**
499
495
  * 5.12 CDN 旁路推流参数
@@ -507,7 +503,7 @@ export declare class TRTCPublishCDNParam {
507
503
  appId: number;
508
504
  bizId: number;
509
505
  url: null | string;
510
- constructor(appId?: number, bizId?: number, url?: null | string);
506
+ constructor();
511
507
  }
512
508
  /**
513
509
  * 5.13 录音参数
@@ -520,7 +516,7 @@ export declare class TRTCPublishCDNParam {
520
516
  */
521
517
  export declare class TRTCAudioRecordingParams {
522
518
  filePath: null | string;
523
- constructor(filePath?: null | string);
519
+ constructor();
524
520
  }
525
521
  /**
526
522
  * 5.14 音效
@@ -541,7 +537,7 @@ export declare class TRTCAudioEffectParam {
541
537
  loopCount: number;
542
538
  publish: boolean;
543
539
  volume: number;
544
- constructor(effectId?: number, path?: string, loopCount?: number, publish?: boolean, volume?: number);
540
+ constructor();
545
541
  }
546
542
  /**
547
543
  * 本地的音视频统计信息
@@ -562,8 +558,8 @@ export declare class TRTCLocalStatistics {
562
558
  videoBitrate: number;
563
559
  audioSampleRate: number;
564
560
  audioBitrate: number;
565
- streamType: TRTCVideoStreamType;
566
- constructor(width?: number, height?: number, frameRate?: number, videoBitrate?: number, audioSampleRate?: number, audioBitrate?: number, streamType?: TRTCVideoStreamType);
561
+ streamType: number;
562
+ constructor();
567
563
  }
568
564
  /**
569
565
  * 远端成员的音视频统计信息
@@ -601,8 +597,8 @@ export declare class TRTCRemoteStatistics {
601
597
  audioBlockRate: number;
602
598
  videoTotalBlockTime: number;
603
599
  videoBlockRate: number;
604
- streamType: TRTCVideoStreamType;
605
- constructor(userId?: string, finalLoss?: number, width?: number, height?: number, frameRate?: number, videoBitrate?: number, audioSampleRate?: number, audioBitrate?: number, jitterBufferDelay?: number, audioTotalBlockTime?: number, audioBlockRate?: number, videoTotalBlockTime?: number, videoBlockRate?: number, streamType?: TRTCVideoStreamType);
600
+ streamType: number;
601
+ constructor();
606
602
  }
607
603
  /**
608
604
  * 统计数据
@@ -616,6 +612,9 @@ export declare class TRTCRemoteStatistics {
616
612
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
617
613
  * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
618
614
  * 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
615
+ * @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
616
+ * 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
617
+ * 当网络为蜂窝网非 WiFi 类型时,该值无效。
619
618
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
620
619
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
621
620
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
@@ -630,13 +629,14 @@ export declare class TRTCStatistics {
630
629
  appCpu: number;
631
630
  systemCpu: number;
632
631
  rtt: number;
632
+ gatewayRtt: number;
633
633
  receivedBytes: number;
634
634
  sentBytes: number;
635
- localStatisticsArray: TRTCLocalStatistics[];
635
+ localStatisticsArray: null | TRTCLocalStatistics[];
636
636
  localStatisticsArraySize: number;
637
637
  remoteStatisticsArray: TRTCRemoteStatistics[];
638
638
  remoteStatisticsArraySize: number;
639
- constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number, receivedBytes?: number, sentBytes?: number, localStatisticsArray?: TRTCLocalStatistics[], localStatisticsArraySize?: number, remoteStatisticsArray?: TRTCRemoteStatistics[], remoteStatisticsArraySize?: number);
639
+ constructor();
640
640
  }
641
641
  /**
642
642
  * 音乐参数
@@ -658,7 +658,7 @@ export declare class AudioMusicParam {
658
658
  isShortFile: boolean;
659
659
  startTimeMS: number;
660
660
  endTimeMS: number;
661
- constructor(id?: number, path?: string, loopCount?: number, publish?: boolean, isShortFile?: boolean, startTimeMS?: number, endTimeMS?: number);
661
+ constructor();
662
662
  }
663
663
  /**
664
664
  * 房间切换参数
@@ -675,7 +675,7 @@ export declare class TRTCSwitchRoomParam {
675
675
  strRoomId: string;
676
676
  userSig: string;
677
677
  privateMapKey: string;
678
- constructor(roomId?: number, strRoomId?: string, userSig?: string, privateMapKey?: string);
678
+ constructor();
679
679
  }
680
680
  export interface VideoFramePayload {
681
681
  uid: string;
@@ -506,11 +506,11 @@ var TRTCAudioQuality;
506
506
  *
507
507
  */
508
508
  class TRTCImageBuffer {
509
- constructor(buffer = new ArrayBuffer(0), length = 0, width = 0, height = 0) {
510
- this.buffer = buffer;
511
- this.length = length;
512
- this.width = width;
513
- this.height = height;
509
+ constructor() {
510
+ this.buffer = new ArrayBuffer(0);
511
+ this.length = 0;
512
+ this.width = 0;
513
+ this.height = 0;
514
514
  }
515
515
  }
516
516
  exports.TRTCImageBuffer = TRTCImageBuffer;
@@ -523,17 +523,15 @@ exports.TRTCImageBuffer = TRTCImageBuffer;
523
523
  * @param {String} sourceName - 采集源名称,UTF8编码
524
524
  * @param {TRTCImageBuffer} thumbBGRA - 缩略图内容
525
525
  * @param {TRTCImageBuffer} iconBGRA - 图标内容
526
- * @param {Boolean} isMinimizeWindow - 是否最小化窗口
527
526
  *
528
527
  */
529
528
  class TRTCScreenCaptureSourceInfo {
530
- constructor(type = TRTCScreenCaptureSourceType.TRTCScreenCaptureSourceTypeUnknown, sourceId = '', sourceName = '', thumbBGRA = new TRTCImageBuffer(), iconBGRA = new TRTCImageBuffer(), isMinimizeWindow = false) {
531
- this.type = type;
532
- this.sourceId = sourceId;
533
- this.sourceName = sourceName;
534
- this.thumbBGRA = thumbBGRA;
535
- this.iconBGRA = iconBGRA;
536
- this.isMinimizeWindow = isMinimizeWindow;
529
+ constructor() {
530
+ this.type = TRTCScreenCaptureSourceType.TRTCScreenCaptureSourceTypeUnknown;
531
+ this.sourceId = '';
532
+ this.sourceName = '';
533
+ this.thumbBGRA = new TRTCImageBuffer();
534
+ this.iconBGRA = new TRTCImageBuffer();
537
535
  }
538
536
  }
539
537
  exports.TRTCScreenCaptureSourceInfo = TRTCScreenCaptureSourceInfo;
@@ -546,9 +544,9 @@ exports.TRTCScreenCaptureSourceInfo = TRTCScreenCaptureSourceInfo;
546
544
  *
547
545
  */
548
546
  class TRTCDeviceInfo {
549
- constructor(deviceId = '', deviceName = '') {
550
- this.deviceId = deviceId;
551
- this.deviceName = deviceName;
547
+ constructor() {
548
+ this.deviceId = '';
549
+ this.deviceName = '';
552
550
  }
553
551
  }
554
552
  exports.TRTCDeviceInfo = TRTCDeviceInfo;
@@ -568,16 +566,16 @@ exports.TRTCDeviceInfo = TRTCDeviceInfo;
568
566
  *
569
567
  */
570
568
  class TRTCVideoFrame {
571
- constructor(videoFormat = TRTCVideoPixelFormat.TRTCVideoPixelFormat_Unknown, bufferType = TRTCVideoBufferType.TRTCVideoBufferType_Unknown, data = null, textureId = 0, length = 0, width = 0, height = 0, timestamp = 0, rotation = 0) {
572
- this.videoFormat = videoFormat;
573
- this.bufferType = bufferType;
574
- this.data = data;
575
- this.textureId = textureId;
576
- this.length = length;
577
- this.width = width;
578
- this.height = height;
579
- this.timestamp = timestamp;
580
- this.rotation = rotation;
569
+ constructor() {
570
+ this.videoFormat = TRTCVideoPixelFormat.TRTCVideoPixelFormat_Unknown;
571
+ this.bufferType = TRTCVideoBufferType.TRTCVideoBufferType_Unknown;
572
+ this.data = null;
573
+ this.textureId = 0;
574
+ this.length = 0;
575
+ this.width = 0;
576
+ this.height = 0;
577
+ this.timestamp = 0;
578
+ this.rotation = 0;
581
579
  }
582
580
  }
583
581
  exports.TRTCVideoFrame = TRTCVideoFrame;
@@ -702,10 +700,8 @@ var TRTCWaterMarkSrcType;
702
700
  * 【推荐取值】如果一个用户在您的账号系统中的 ID 为“abc”,则 userId 即可设置为“abc”。<br>
703
701
  * @param {String} userSig - 【字段含义】用户签名(必填),当前 userId 对应的验证签名,相当于登录密码。<br>
704
702
  * 【推荐取值】请参考 [如何计算UserSig](https://cloud.tencent.com/document/product/647/17275)。<br>
705
- * @param {Number} roomId - 【字段含义】房间号码(必填),指定房间号,在同一个房间里的用户(userId)可以彼此看到对方并进行视频通话, roomId 和 strRoomId 必须填一个, 若您选用 strRoomId,则 roomId 需要填写为0。<br>
703
+ * @param {Number} roomId - 【字段含义】房间号码(必填),指定房间号,在同一个房间里的用户(userId)可以彼此看到对方并进行视频通话。<br>
706
704
  * 【推荐取值】您可以随意指定,但请不要重复,如果您的用户账号 ID 是数字类型的,可以直接用创建者的用户 ID 作为 roomId。<br>
707
- * @param {String} strRoomId - 【字段含义】字符串房间号码(选填),roomId 和 strRoomId 必须填一个。若两者都填,则优先选择 roomId。<br>
708
- * 【推荐取值】您可以随意指定,但请不要重复。<br>
709
705
  * @param {TRTCRoleType} role - 【字段含义】直播场景下的角色,仅适用于直播场景(TRTCAppSceneLIVE 和 TRTCAppSceneVoiceChatRoom),视频通话场景下指定无效。<br>
710
706
  * 【推荐取值】默认值:主播(TRTCRoleAnchor)<br>
711
707
  * @param {String} privateMapKey - 【字段含义】房间签名(非必填),如果您希望某个房间只能让特定的某些 userId 进入,就需要使用 privateMapKey 进行权限保护。<br>
@@ -721,17 +717,17 @@ var TRTCWaterMarkSrcType;
721
717
  * 【参考文档】[云端录制](https://cloud.tencent.com/document/product/647/16823)。
722
718
  */
723
719
  class TRTCParams {
724
- constructor(sdkAppId = 0, userId = '', userSig = '', roomId = 0, strRoomId = '', role = TRTCRoleType.TRTCRoleAnchor, privateMapKey = null, businessInfo = null, streamId = null, userDefineRecordId = null) {
725
- this.sdkAppId = sdkAppId;
726
- this.userId = userId;
727
- this.userSig = userSig;
728
- this.roomId = roomId;
729
- this.strRoomId = strRoomId;
730
- this.role = role;
731
- this.privateMapKey = privateMapKey;
732
- this.businessInfo = businessInfo;
733
- this.streamId = streamId;
734
- this.userDefineRecordId = userDefineRecordId;
720
+ constructor() {
721
+ this.sdkAppId = 0;
722
+ this.userId = null;
723
+ this.userSig = null;
724
+ this.roomId = 0;
725
+ this.strRoomId = '';
726
+ this.role = TRTCRoleType.TRTCRoleAnchor;
727
+ this.privateMapKey = null;
728
+ this.businessInfo = null;
729
+ this.streamId = null;
730
+ this.userDefineRecordId = null;
735
731
  }
736
732
  }
737
733
  exports.TRTCParams = TRTCParams;
@@ -774,13 +770,13 @@ exports.TRTCParams = TRTCParams;
774
770
  * 【特别说明】若有录制需求,选择 YES 时,请确保通话过程中,调整分辨率不会影响您的录制效果。<br>
775
771
  */
776
772
  class TRTCVideoEncParam {
777
- constructor(videoResolution = TRTCVideoResolution.TRTCVideoResolution_640_360, resMode = TRTCVideoResolutionMode.TRTCVideoResolutionModeLandscape, videoFps = 15, videoBitrate = 550, minVideoBitrate = 0, enableAdjustRes = false) {
778
- this.videoResolution = videoResolution;
779
- this.resMode = resMode;
780
- this.videoFps = videoFps;
781
- this.videoBitrate = videoBitrate;
782
- this.minVideoBitrate = minVideoBitrate;
783
- this.enableAdjustRes = enableAdjustRes;
773
+ constructor() {
774
+ this.videoResolution = TRTCVideoResolution.TRTCVideoResolution_640_360;
775
+ this.resMode = TRTCVideoResolutionMode.TRTCVideoResolutionModeLandscape;
776
+ this.videoFps = 15;
777
+ this.videoBitrate = 550;
778
+ this.minVideoBitrate = 0;
779
+ this.enableAdjustRes = false;
784
780
  }
785
781
  }
786
782
  exports.TRTCVideoEncParam = TRTCVideoEncParam;
@@ -796,10 +792,10 @@ exports.TRTCVideoEncParam = TRTCVideoEncParam;
796
792
  *
797
793
  */
798
794
  class TRTCRenderParams {
799
- constructor(rotation = TRTCVideoRotation.TRTCVideoRotation0, fillMode = TRTCVideoFillMode.TRTCVideoFillMode_Fit, mirrorType = TRTCVideoMirrorType.TRTCVideoMirrorType_Disable) {
800
- this.rotation = rotation;
801
- this.fillMode = fillMode;
802
- this.mirrorType = mirrorType;
795
+ constructor() {
796
+ this.rotation = TRTCVideoRotation.TRTCVideoRotation0;
797
+ this.fillMode = TRTCVideoFillMode.TRTCVideoFillMode_Fit;
798
+ this.mirrorType = TRTCVideoMirrorType.TRTCVideoMirrorType_Disable;
803
799
  }
804
800
  }
805
801
  exports.TRTCRenderParams = TRTCRenderParams;
@@ -820,9 +816,9 @@ exports.TRTCRenderParams = TRTCRenderParams;
820
816
  *
821
817
  */
822
818
  class TRTCNetworkQosParam {
823
- constructor(preference = TRTCVideoQosPreference.TRTCVideoQosPreferenceClear, controlMode = TRTCQosControlMode.TRTCQosControlModeServer) {
824
- this.preference = preference;
825
- this.controlMode = controlMode;
819
+ constructor() {
820
+ this.preference = TRTCVideoQosPreference.TRTCVideoQosPreferenceClear;
821
+ this.controlMode = TRTCQosControlMode.TRTCQosControlModeServer;
826
822
  }
827
823
  }
828
824
  exports.TRTCNetworkQosParam = TRTCNetworkQosParam;
@@ -837,9 +833,9 @@ exports.TRTCNetworkQosParam = TRTCNetworkQosParam;
837
833
  *
838
834
  */
839
835
  class TRTCQualityInfo {
840
- constructor(userId = '', quality = TRTCQuality.TRTCQuality_Unknown) {
841
- this.userId = userId;
842
- this.quality = quality;
836
+ constructor() {
837
+ this.userId = null;
838
+ this.quality = TRTCQuality.TRTCQuality_Unknown;
843
839
  }
844
840
  }
845
841
  exports.TRTCQualityInfo = TRTCQualityInfo;
@@ -854,9 +850,9 @@ exports.TRTCQualityInfo = TRTCQualityInfo;
854
850
  *
855
851
  */
856
852
  class TRTCVolumeInfo {
857
- constructor(userId = '', volume = 0) {
858
- this.userId = userId;
859
- this.volume = volume;
853
+ constructor() {
854
+ this.userId = null;
855
+ this.volume = 0;
860
856
  }
861
857
  }
862
858
  exports.TRTCVolumeInfo = TRTCVolumeInfo;
@@ -881,12 +877,12 @@ exports.TRTCVolumeInfo = TRTCVolumeInfo;
881
877
  *
882
878
  */
883
879
  class TRTCSpeedTestResult {
884
- constructor(ip = '', quality = TRTCQuality.TRTCQuality_Unknown, upLostRate = 0.0, downLostRate = 0.0, rtt = 0) {
885
- this.ip = ip;
886
- this.quality = quality;
887
- this.upLostRate = upLostRate;
888
- this.downLostRate = downLostRate;
889
- this.rtt = rtt;
880
+ constructor() {
881
+ this.ip = null;
882
+ this.quality = TRTCQuality.TRTCQuality_Unknown;
883
+ this.upLostRate = 0.0;
884
+ this.downLostRate = 0.0;
885
+ this.rtt = 0;
890
886
  }
891
887
  }
892
888
  exports.TRTCSpeedTestResult = TRTCSpeedTestResult;
@@ -928,13 +924,13 @@ exports.Rect = Rect;
928
924
  *
929
925
  */
930
926
  class TRTCMixUser {
931
- constructor(userId = '', roomId = '', rect = null, zOrder = 0, pureAudio = false, streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig) {
932
- this.userId = userId;
933
- this.roomId = roomId;
934
- this.rect = rect;
935
- this.zOrder = zOrder;
936
- this.pureAudio = pureAudio;
937
- this.streamType = streamType;
927
+ constructor() {
928
+ this.userId = '';
929
+ this.roomId = '';
930
+ this.rect = null;
931
+ this.zOrder = 0;
932
+ this.pureAudio = false;
933
+ this.streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig;
938
934
  }
939
935
  }
940
936
  exports.TRTCMixUser = TRTCMixUser;
@@ -1038,22 +1034,22 @@ var TRTCTranscodingConfigMode;
1038
1034
  * 【推荐取值】默认值:'',即房间里的多路流会混合到该接口调用者的视频流上。
1039
1035
  */
1040
1036
  class TRTCTranscodingConfig {
1041
- constructor(mode = TRTCTranscodingConfigMode.TRTCTranscodingConfigMode_Unknown, appId = 0, bizId = 0, videoWidth = 0, videoHeight = 0, videoBitrate = 0, videoFramerate = 15, videoGOP = 2, backgroundColor = 0, backgroundImage = '', audioSampleRate = 64, audioBitrate = 48000, audioChannels = 1, mixUsersArray = [], streamId = '') {
1042
- this.mode = mode;
1043
- this.appId = appId;
1044
- this.bizId = bizId;
1045
- this.videoWidth = videoWidth;
1046
- this.videoHeight = videoHeight;
1047
- this.videoBitrate = videoBitrate;
1048
- this.videoFramerate = videoFramerate;
1049
- this.videoGOP = videoGOP;
1050
- this.backgroundColor = backgroundColor;
1051
- this.backgroundImage = backgroundImage;
1052
- this.audioSampleRate = audioSampleRate;
1053
- this.audioBitrate = audioBitrate;
1054
- this.audioChannels = audioChannels;
1055
- this.mixUsersArray = mixUsersArray;
1056
- this.streamId = streamId;
1037
+ constructor() {
1038
+ this.mode = TRTCTranscodingConfigMode.TRTCTranscodingConfigMode_Unknown;
1039
+ this.appId = 0;
1040
+ this.bizId = 0;
1041
+ this.videoWidth = 0;
1042
+ this.videoHeight = 0;
1043
+ this.videoBitrate = 0;
1044
+ this.videoFramerate = 15;
1045
+ this.videoGOP = 2;
1046
+ this.audioSampleRate = 64;
1047
+ this.audioBitrate = 48000;
1048
+ this.audioChannels = 1;
1049
+ this.mixUsersArray = [];
1050
+ this.backgroundColor = 0;
1051
+ this.backgroundImage = '';
1052
+ this.streamId = '';
1057
1053
  }
1058
1054
  }
1059
1055
  exports.TRTCTranscodingConfig = TRTCTranscodingConfig;
@@ -1067,10 +1063,10 @@ exports.TRTCTranscodingConfig = TRTCTranscodingConfig;
1067
1063
  *
1068
1064
  */
1069
1065
  class TRTCPublishCDNParam {
1070
- constructor(appId = 0, bizId = 0, url = null) {
1071
- this.appId = appId;
1072
- this.bizId = bizId;
1073
- this.url = url;
1066
+ constructor() {
1067
+ this.appId = 0;
1068
+ this.bizId = 0;
1069
+ this.url = null;
1074
1070
  }
1075
1071
  }
1076
1072
  exports.TRTCPublishCDNParam = TRTCPublishCDNParam;
@@ -1085,8 +1081,8 @@ exports.TRTCPublishCDNParam = TRTCPublishCDNParam;
1085
1081
  *
1086
1082
  */
1087
1083
  class TRTCAudioRecordingParams {
1088
- constructor(filePath = null) {
1089
- this.filePath = filePath;
1084
+ constructor() {
1085
+ this.filePath = null;
1090
1086
  }
1091
1087
  }
1092
1088
  exports.TRTCAudioRecordingParams = TRTCAudioRecordingParams;
@@ -1105,12 +1101,12 @@ exports.TRTCAudioRecordingParams = TRTCAudioRecordingParams;
1105
1101
  * 【推荐取值】取值范围为0 - 100;默认值:100
1106
1102
  */
1107
1103
  class TRTCAudioEffectParam {
1108
- constructor(effectId = 0, path = '', loopCount = 0, publish = false, volume = 100) {
1109
- this.effectId = effectId;
1110
- this.path = path;
1111
- this.loopCount = loopCount;
1112
- this.publish = publish;
1113
- this.volume = volume;
1104
+ constructor() {
1105
+ this.effectId = 0;
1106
+ this.path = '';
1107
+ this.loopCount = 0;
1108
+ this.publish = false;
1109
+ this.volume = 100;
1114
1110
  }
1115
1111
  }
1116
1112
  exports.TRTCAudioEffectParam = TRTCAudioEffectParam;
@@ -1128,14 +1124,14 @@ exports.TRTCAudioEffectParam = TRTCAudioEffectParam;
1128
1124
  *
1129
1125
  */
1130
1126
  class TRTCLocalStatistics {
1131
- constructor(width = 0, height = 0, frameRate = 0, videoBitrate = 0, audioSampleRate = 0, audioBitrate = 0, streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig) {
1132
- this.width = width;
1133
- this.height = height;
1134
- this.frameRate = frameRate;
1135
- this.videoBitrate = videoBitrate;
1136
- this.audioSampleRate = audioSampleRate;
1137
- this.audioBitrate = audioBitrate;
1138
- this.streamType = streamType;
1127
+ constructor() {
1128
+ this.width = 0;
1129
+ this.height = 0;
1130
+ this.frameRate = 0;
1131
+ this.videoBitrate = 0;
1132
+ this.audioSampleRate = 0;
1133
+ this.audioBitrate = 0;
1134
+ this.streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig;
1139
1135
  }
1140
1136
  }
1141
1137
  exports.TRTCLocalStatistics = TRTCLocalStatistics;
@@ -1163,21 +1159,21 @@ exports.TRTCLocalStatistics = TRTCLocalStatistics;
1163
1159
  *
1164
1160
  */
1165
1161
  class TRTCRemoteStatistics {
1166
- constructor(userId = '', finalLoss = 0, width = 0, height = 0, frameRate = 0, videoBitrate = 0, audioSampleRate = 0, audioBitrate = 0, jitterBufferDelay = 0, audioTotalBlockTime = 0, audioBlockRate = 0, videoTotalBlockTime = 0, videoBlockRate = 0, streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig) {
1167
- this.userId = userId;
1168
- this.finalLoss = finalLoss;
1169
- this.width = width;
1170
- this.height = height;
1171
- this.frameRate = frameRate;
1172
- this.videoBitrate = videoBitrate;
1173
- this.audioSampleRate = audioSampleRate;
1174
- this.audioBitrate = audioBitrate;
1175
- this.jitterBufferDelay = jitterBufferDelay;
1176
- this.audioTotalBlockTime = audioTotalBlockTime;
1177
- this.audioBlockRate = audioBlockRate;
1178
- this.videoTotalBlockTime = videoTotalBlockTime;
1179
- this.videoBlockRate = videoBlockRate;
1180
- this.streamType = streamType;
1162
+ constructor() {
1163
+ this.userId = '';
1164
+ this.finalLoss = 0;
1165
+ this.width = 0;
1166
+ this.height = 0;
1167
+ this.frameRate = 0;
1168
+ this.videoBitrate = 0;
1169
+ this.audioSampleRate = 0;
1170
+ this.audioBitrate = 0;
1171
+ this.jitterBufferDelay = 0;
1172
+ this.audioTotalBlockTime = 0;
1173
+ this.audioBlockRate = 0;
1174
+ this.videoTotalBlockTime = 0;
1175
+ this.videoBlockRate = 0;
1176
+ this.streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig;
1181
1177
  }
1182
1178
  }
1183
1179
  exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
@@ -1194,6 +1190,9 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1194
1190
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
1195
1191
  * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
1196
1192
  * 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
1193
+ * @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
1194
+ * 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
1195
+ * 当网络为蜂窝网非 WiFi 类型时,该值无效。
1197
1196
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
1198
1197
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
1199
1198
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
@@ -1203,18 +1202,19 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1203
1202
  *
1204
1203
  */
1205
1204
  class TRTCStatistics {
1206
- constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
1207
- this.upLoss = upLoss;
1208
- this.downLoss = downLoss;
1209
- this.appCpu = appCpu;
1210
- this.systemCpu = systemCpu;
1211
- this.rtt = rtt;
1212
- this.receivedBytes = receivedBytes;
1213
- this.sentBytes = sentBytes;
1214
- this.localStatisticsArray = localStatisticsArray;
1215
- this.localStatisticsArraySize = localStatisticsArraySize;
1216
- this.remoteStatisticsArray = remoteStatisticsArray;
1217
- this.remoteStatisticsArraySize = remoteStatisticsArraySize;
1205
+ constructor() {
1206
+ this.upLoss = 0;
1207
+ this.downLoss = 0;
1208
+ this.appCpu = 0;
1209
+ this.systemCpu = 0;
1210
+ this.rtt = 0;
1211
+ this.gatewayRtt = 0;
1212
+ this.receivedBytes = 0;
1213
+ this.sentBytes = 0;
1214
+ this.localStatisticsArray = null;
1215
+ this.localStatisticsArraySize = 0;
1216
+ this.remoteStatisticsArray = [];
1217
+ this.remoteStatisticsArraySize = 0;
1218
1218
  }
1219
1219
  }
1220
1220
  exports.TRTCStatistics = TRTCStatistics;
@@ -1232,14 +1232,14 @@ exports.TRTCStatistics = TRTCStatistics;
1232
1232
  *
1233
1233
  */
1234
1234
  class AudioMusicParam {
1235
- constructor(id = 0, path = '', loopCount = 0, publish = true, isShortFile = false, startTimeMS = 0, endTimeMS = 0) {
1236
- this.id = id;
1237
- this.path = path;
1238
- this.loopCount = loopCount;
1239
- this.publish = publish;
1240
- this.isShortFile = isShortFile;
1241
- this.startTimeMS = startTimeMS;
1242
- this.endTimeMS = endTimeMS;
1235
+ constructor() {
1236
+ this.id = 0;
1237
+ this.path = '';
1238
+ this.loopCount = 0;
1239
+ this.publish = true;
1240
+ this.isShortFile = false;
1241
+ this.startTimeMS = 0;
1242
+ this.endTimeMS = 0;
1243
1243
  }
1244
1244
  }
1245
1245
  exports.AudioMusicParam = AudioMusicParam;
@@ -1254,11 +1254,11 @@ exports.AudioMusicParam = AudioMusicParam;
1254
1254
  *
1255
1255
  */
1256
1256
  class TRTCSwitchRoomParam {
1257
- constructor(roomId = 0, strRoomId = '', userSig = '', privateMapKey = '') {
1258
- this.roomId = roomId;
1259
- this.strRoomId = strRoomId;
1260
- this.userSig = userSig;
1261
- this.privateMapKey = privateMapKey;
1257
+ constructor() {
1258
+ this.roomId = 0;
1259
+ this.strRoomId = '';
1260
+ this.userSig = '';
1261
+ this.privateMapKey = '';
1262
1262
  }
1263
1263
  }
1264
1264
  exports.TRTCSwitchRoomParam = TRTCSwitchRoomParam;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "9.3.301",
3
+ "version": "9.5.100-beta.0",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",
@@ -34,7 +34,7 @@ const cos = new COS({
34
34
 
35
35
  const bucket = 'sdk-web-1252463788';
36
36
  const region = 'ap-hongkong';
37
- const keyPrefix = 'trtc/electron/doc/zh-cn/trtc_electron_sdk/';
37
+ const keyPrefix = 'trtc/electron/doc/zh-cn/trtc_electron_sdk';
38
38
  const docPath = path.join(__dirname, '../_doc');
39
39
 
40
40
  function walkSync(dir, filelist) {