trtc-electron-sdk 9.3.108-beta.0 → 9.3.112-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
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
- import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, PluginInfo, TRTCSpeedTestParams } from './trtc_define';
3
+ import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, PluginInfo } from './trtc_define';
4
4
  export * from './trtc_define';
5
5
  export * from './trtc_code';
6
6
  /**
@@ -39,7 +39,6 @@ declare class TRTCCloud extends EventEmitter {
39
39
  private audioQuality;
40
40
  private bgmId;
41
41
  private playAudioEffectIdList;
42
- private isStartLocalPreview;
43
42
  constructor();
44
43
  /**
45
44
  * 创建 TRTCCloud 对象单例
@@ -324,23 +323,14 @@ declare class TRTCCloud extends EventEmitter {
324
323
  */
325
324
  handleOnConnectionRecovery(): void;
326
325
  /**
327
- * 5.4 废弃事件:服务器测速的回调,SDK 对多个服务器 IP 做测速,每个 IP 的测速结果通过这个回调通知
326
+ * 5.4 服务器测速的回调,SDK 对多个服务器 IP 做测速,每个 IP 的测速结果通过这个回调通知
328
327
  *
329
- * @deprecated
330
328
  * @event TRTCCallback#onSpeedTest
331
329
  * @param {TRTCSpeedTestResult} currentResult - 当前完成的测速结果
332
330
  * @param {Number} finishedCount - 已完成测速的服务器数量
333
331
  * @param {Number} totalCount - 需要测速的服务器总数量
334
332
  */
335
333
  bindOnSpeedTest(): void;
336
- /**
337
- * 5.5 网速测试的结果回调
338
- *
339
- * @event TRTCCallback#onSpeedTestResult
340
- * 该统计回调由 @link TRTCCloud#startSpeedTest 触发。
341
- * @param {TRTCSpeedTestResult} result - 网速测试数据数据,包括丢包、往返延迟、上下行的带宽速率,详情请参考 {@link TRTCSpeedTestResult}。
342
- */
343
- bindOnSpeedTestResult(): void;
344
334
  /**
345
335
  * 6.1 摄像头准备就绪
346
336
  *
@@ -803,8 +793,6 @@ declare class TRTCCloud extends EventEmitter {
803
793
  *
804
794
  * 参考文档:[云端混流转码](https://cloud.tencent.com/document/product/647/16827)。
805
795
  *
806
- * 注意:混流转码为收费功能,调用接口将产生云端混流转码费用,详见 [云端混流转码计费说明](https://cloud.tencent.com/document/product/647/49446)。
807
- *
808
796
  * @note 关于云端混流的注意事项:
809
797
  * - 云端转码会引入一定的 CDN 观看延时,大概会增加1 - 2秒。
810
798
  * - 调用该函数的用户,会将连麦中的多路画面混合到自己当前这路画面中。
@@ -1456,7 +1444,7 @@ declare class TRTCCloud extends EventEmitter {
1456
1444
  */
1457
1445
  selectScreenCaptureTarget(type: number, sourceId: string, sourcename: string, captureRect: Rect, captureMouse: boolean, highlightWindow: boolean): any;
1458
1446
  /**
1459
- * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。
1447
+ * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。(暂不支持 mac 平台预览界面)
1460
1448
  *
1461
1449
  * 注意:
1462
1450
  * 一个用户同时最多只能上传一条主路(TRTCVideoStreamTypeBig)画面和一条辅路(TRTCVideoStreamTypeSub)画面,
@@ -1851,16 +1839,13 @@ declare class TRTCCloud extends EventEmitter {
1851
1839
  * 测速结果将会用于优化 SDK 接下来的服务器选择策略,因此推荐您在用户首次通话前先进行一次测速,这将有助于我们选择最佳的服务器。
1852
1840
  * 同时,如果测试结果非常不理想,您可以通过醒目的 UI 提示用户选择更好的网络。
1853
1841
  *
1854
- * 注意:测速过程将产生少量的基础服务费用,详见 [计费概述 > 基础服务](https://cloud.tencent.com/document/product/647/17157#.E5.9F.BA.E7.A1.80.E6.9C.8D.E5.8A.A1) 文档说明。
1842
+ * 注意:测速本身会消耗一定的流量,所以也会产生少量额外的流量费用。
1855
1843
  *
1856
- * @param {TRTCSpeedTestParams} params - 网络测速参数
1857
- * @param {Number} params.sdkAppId - 应用标识(必填)
1858
- * @param {String} params.userId - 用户标识(必填)
1859
- * @param {String} params.userSig - 用户签名(必填)
1860
- * @param {Number} params.expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)
1861
- * @param {Number} params.expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
1844
+ * @param {Number} sdkAppId - 应用标识
1845
+ * @param {String} userId - 用户标识
1846
+ * @param {String} userSig - 用户签名
1862
1847
  */
1863
- startSpeedTest(params: TRTCSpeedTestParams | number, userId?: string, userSig?: string): void;
1848
+ startSpeedTest(sdkAppId: number, userId: string, userSig: string): void;
1864
1849
  /**
1865
1850
  * 13.2 停止网络测速
1866
1851
  */
@@ -1990,6 +1975,7 @@ declare class TRTCCloud extends EventEmitter {
1990
1975
  removePlugin(id: string): void;
1991
1976
  getPluginList(): PluginInfo[];
1992
1977
  createPlugin(pluginId: string): PluginInfo;
1978
+ setPluginCallback(pluginCb: (pluginId: string, errorCode: number, msg: string) => void): void;
1993
1979
  getKey(uid: string, type: TRTCVideoStreamType): string;
1994
1980
  /**
1995
1981
  * 判断是否支持webGL
@@ -2018,6 +2004,5 @@ declare class TRTCCloud extends EventEmitter {
2018
2004
  _YUV2RGBA(width: number, height: number, buffer: ArrayBufferLike): Uint8ClampedArray;
2019
2005
  _BGRA2RGBA(data: ArrayBuffer, width: number, height: number): Uint8ClampedArray;
2020
2006
  _isMacPlatform(): boolean;
2021
- _isLocalUser(uid: string): boolean;
2022
2007
  }
2023
2008
  export default TRTCCloud;
package/liteav/trtc.js CHANGED
@@ -116,7 +116,6 @@ class TRTCCloud extends events_1.EventEmitter {
116
116
  // 生成一个足够大, 不会与用户输入重复的 id
117
117
  this.bgmId = 1 << 29;
118
118
  this.playAudioEffectIdList = [];
119
- this.isStartLocalPreview = false;
120
119
  this.initEventHandler();
121
120
  console.log('constructor render:' + this.renderMode + '|sdk version:' + pkg.version +
122
121
  '|native sdk version:' + this.rtcCloud.getSDKVersion());
@@ -161,7 +160,6 @@ class TRTCCloud extends events_1.EventEmitter {
161
160
  */
162
161
  destroy() {
163
162
  this.firstVideoFrameList = [];
164
- this.isStartLocalPreview = false;
165
163
  this.playAudioEffectIdList = [];
166
164
  this.rtcCloud.destroy();
167
165
  }
@@ -340,7 +338,6 @@ class TRTCCloud extends events_1.EventEmitter {
340
338
  this.bindOnNetworkQuality();
341
339
  this.bindOnStatistics();
342
340
  this.bindOnSpeedTest();
343
- this.bindOnSpeedTestResult();
344
341
  this.bindOnUserVoiceVolume();
345
342
  this.bindOnRecvCustomCmdMsg();
346
343
  this.bindOnMissCustomCmdMsg();
@@ -421,7 +418,6 @@ class TRTCCloud extends events_1.EventEmitter {
421
418
  */
422
419
  handleOnExitRoom(reason) {
423
420
  this.firstVideoFrameList = [];
424
- this.isStartLocalPreview = false;
425
421
  this.fire('onExitRoom', reason);
426
422
  }
427
423
  /**
@@ -707,9 +703,8 @@ class TRTCCloud extends events_1.EventEmitter {
707
703
  this.fire('onConnectionRecovery');
708
704
  }
709
705
  /**
710
- * 5.4 废弃事件:服务器测速的回调,SDK 对多个服务器 IP 做测速,每个 IP 的测速结果通过这个回调通知
706
+ * 5.4 服务器测速的回调,SDK 对多个服务器 IP 做测速,每个 IP 的测速结果通过这个回调通知
711
707
  *
712
- * @deprecated
713
708
  * @event TRTCCallback#onSpeedTest
714
709
  * @param {TRTCSpeedTestResult} currentResult - 当前完成的测速结果
715
710
  * @param {Number} finishedCount - 已完成测速的服务器数量
@@ -720,18 +715,6 @@ class TRTCCloud extends events_1.EventEmitter {
720
715
  this.fire('onSpeedTest', currentResult, finishedCount, totalCount);
721
716
  });
722
717
  }
723
- /**
724
- * 5.5 网速测试的结果回调
725
- *
726
- * @event TRTCCallback#onSpeedTestResult
727
- * 该统计回调由 @link TRTCCloud#startSpeedTest 触发。
728
- * @param {TRTCSpeedTestResult} result - 网速测试数据数据,包括丢包、往返延迟、上下行的带宽速率,详情请参考 {@link TRTCSpeedTestResult}。
729
- */
730
- bindOnSpeedTestResult() {
731
- this.rtcCloud.onEvent('onSpeedTestResult', (result) => {
732
- this.fire('onSpeedTestResult', result);
733
- });
734
- }
735
718
  /////////////////////////////////////////////////////////////////////////////////
736
719
  //
737
720
  // (六)硬件设备事件回调
@@ -1352,8 +1335,6 @@ class TRTCCloud extends events_1.EventEmitter {
1352
1335
  *
1353
1336
  * 参考文档:[云端混流转码](https://cloud.tencent.com/document/product/647/16827)。
1354
1337
  *
1355
- * 注意:混流转码为收费功能,调用接口将产生云端混流转码费用,详见 [云端混流转码计费说明](https://cloud.tencent.com/document/product/647/49446)。
1356
- *
1357
1338
  * @note 关于云端混流的注意事项:
1358
1339
  * - 云端转码会引入一定的 CDN 观看延时,大概会增加1 - 2秒。
1359
1340
  * - 调用该函数的用户,会将连麦中的多路画面混合到自己当前这路画面中。
@@ -1442,7 +1423,6 @@ class TRTCCloud extends events_1.EventEmitter {
1442
1423
  let key = this.getKey('local_video', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
1443
1424
  this._initRender(key, view);
1444
1425
  }
1445
- this.isStartLocalPreview = true;
1446
1426
  this.rtcCloud.startLocalPreview();
1447
1427
  this.addLocalVideoRenderCallback();
1448
1428
  }
@@ -1454,13 +1434,12 @@ class TRTCCloud extends events_1.EventEmitter {
1454
1434
  * 3.2 停止本地摄像头采集和预览
1455
1435
  */
1456
1436
  stopLocalPreview() {
1457
- this.isStartLocalPreview = false;
1458
- this.firstVideoFrameList = this.firstVideoFrameList.filter((item) => {
1459
- return !(this._isLocalUser(item.uid) && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
1460
- });
1461
1437
  let key = this.getKey('local_video', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
1462
1438
  this._destroyRender(key, null);
1463
1439
  this.rtcCloud.stopLocalPreview();
1440
+ this.firstVideoFrameList = this.firstVideoFrameList.filter(function (item) {
1441
+ return !('' === item.uid && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
1442
+ });
1464
1443
  }
1465
1444
  /**
1466
1445
  * 3.3 是否屏蔽自己的视频画面
@@ -2329,7 +2308,7 @@ class TRTCCloud extends events_1.EventEmitter {
2329
2308
  }
2330
2309
  }
2331
2310
  /**
2332
- * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。
2311
+ * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。(暂不支持 mac 平台预览界面)
2333
2312
  *
2334
2313
  * 注意:
2335
2314
  * 一个用户同时最多只能上传一条主路(TRTCVideoStreamTypeBig)画面和一条辅路(TRTCVideoStreamTypeSub)画面,
@@ -2930,27 +2909,14 @@ class TRTCCloud extends events_1.EventEmitter {
2930
2909
  * 测速结果将会用于优化 SDK 接下来的服务器选择策略,因此推荐您在用户首次通话前先进行一次测速,这将有助于我们选择最佳的服务器。
2931
2910
  * 同时,如果测试结果非常不理想,您可以通过醒目的 UI 提示用户选择更好的网络。
2932
2911
  *
2933
- * 注意:测速过程将产生少量的基础服务费用,详见 [计费概述 > 基础服务](https://cloud.tencent.com/document/product/647/17157#.E5.9F.BA.E7.A1.80.E6.9C.8D.E5.8A.A1) 文档说明。
2912
+ * 注意:测速本身会消耗一定的流量,所以也会产生少量额外的流量费用。
2934
2913
  *
2935
- * @param {TRTCSpeedTestParams} params - 网络测速参数
2936
- * @param {Number} params.sdkAppId - 应用标识(必填)
2937
- * @param {String} params.userId - 用户标识(必填)
2938
- * @param {String} params.userSig - 用户签名(必填)
2939
- * @param {Number} params.expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)
2940
- * @param {Number} params.expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
2914
+ * @param {Number} sdkAppId - 应用标识
2915
+ * @param {String} userId - 用户标识
2916
+ * @param {String} userSig - 用户签名
2941
2917
  */
2942
- startSpeedTest(params, userId, userSig) {
2943
- if (params instanceof trtc_define_1.TRTCSpeedTestParams) {
2944
- this.rtcCloud.startSpeedTest(params.sdkAppId, params.userId, params.userSig, params.expectedUpBandwidth, params.expectedDownBandwidth);
2945
- }
2946
- else if (typeof params === 'number' && typeof userId === 'string' && typeof userSig === 'string') {
2947
- // 兼容旧版本调用
2948
- let sdkAppId = params;
2949
- this.rtcCloud.startSpeedTest(sdkAppId, userId, userSig, 0, 0);
2950
- }
2951
- else {
2952
- console.error('enterRoom, params error!');
2953
- }
2918
+ startSpeedTest(sdkAppId, userId, userSig) {
2919
+ this.rtcCloud.startSpeedTest(sdkAppId, userId, userSig);
2954
2920
  }
2955
2921
  /**
2956
2922
  * 13.2 停止网络测速
@@ -2989,8 +2955,8 @@ class TRTCCloud extends events_1.EventEmitter {
2989
2955
  let key = this.getKey('camera_device_test_view', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
2990
2956
  this._destroyRender(key, null);
2991
2957
  this.rtcCloud.stopCameraDeviceTest();
2992
- this.firstVideoFrameList = this.firstVideoFrameList.filter((item) => {
2993
- return !(this._isLocalUser(item.uid) && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
2958
+ this.firstVideoFrameList = this.firstVideoFrameList.filter(function (item) {
2959
+ return !('' === item.uid && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
2994
2960
  });
2995
2961
  }
2996
2962
  /**
@@ -3202,9 +3168,15 @@ class TRTCCloud extends events_1.EventEmitter {
3202
3168
  },
3203
3169
  setParameter: (param) => {
3204
3170
  return this.rtcCloud.setPluginParameter(pluginId, param);
3171
+ },
3172
+ getParameter: () => {
3173
+ return this.rtcCloud.getPluginParameter(pluginId);
3205
3174
  }
3206
3175
  };
3207
3176
  }
3177
+ setPluginCallback(pluginCb) {
3178
+ this.rtcCloud.setPluginCallback(pluginCb);
3179
+ }
3208
3180
  getKey(uid, type) {
3209
3181
  return String(uid) + '_' + String(type);
3210
3182
  }
@@ -3243,7 +3215,6 @@ class TRTCCloud extends events_1.EventEmitter {
3243
3215
  return this.streams.get(key);
3244
3216
  }
3245
3217
  _onRenderFrame(uid, type, width, height, timestamp, rotation, data) {
3246
- const isCurrentLocalUser = this._isLocalUser(uid);
3247
3218
  // 由于 mac 监听自定义渲染回调后不会回调 onFirstVideoFrame ,所以在这里自己实现回调 onFirstVideoFrame
3248
3219
  if (this._isMacPlatform()) {
3249
3220
  setImmediate(() => {
@@ -3251,14 +3222,12 @@ class TRTCCloud extends events_1.EventEmitter {
3251
3222
  return uid === item.uid && type === item.type;
3252
3223
  });
3253
3224
  if (index === -1) {
3254
- if (!isCurrentLocalUser || this.isStartLocalPreview) {
3255
- this.emit('onFirstVideoFrame', uid, type, width, height);
3256
- this.firstVideoFrameList.push({ uid: uid, type: type });
3257
- }
3225
+ this.emit('onFirstVideoFrame', uid, type, width, height);
3226
+ this.firstVideoFrameList.push({ uid: uid, type: type });
3258
3227
  }
3259
3228
  });
3260
3229
  }
3261
- if (isCurrentLocalUser) {
3230
+ if (uid.length == 0) {
3262
3231
  if (this.isExternalRenderEnabled) {
3263
3232
  this.fire(CUSTOM_VIDEO_DATA, {
3264
3233
  uid: '', type, rotation, timestamp,
@@ -3499,9 +3468,6 @@ class TRTCCloud extends events_1.EventEmitter {
3499
3468
  _isMacPlatform() {
3500
3469
  return process.platform == 'darwin';
3501
3470
  }
3502
- _isLocalUser(uid) {
3503
- return uid === '';
3504
- }
3505
3471
  }
3506
3472
  class VideoRenderCallback {
3507
3473
  constructor() {
@@ -374,8 +374,6 @@ export declare class TRTCVolumeInfo {
374
374
  * @param {Number} upLostRate - 上行丢包率,范围是[0 - 1.0],例如0.3代表每向服务器发送10个数据包,可能有3个会在中途丢失。
375
375
  * @param {Number} downLostRate - 下行丢包率,范围是[0 - 1.0],例如0.2代表从服务器每收取10个数据包,可能有2个会在中途丢失。
376
376
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好,正常数值在10ms - 100ms之间。
377
- * @param {Number} availableUpBandwidth - 上行带宽(kbps,-1:无效值)。
378
- * @param {Number} availableDownBandwidth - 下行带宽(kbps,-1:无效值)。
379
377
  *
380
378
  */
381
379
  export declare class TRTCSpeedTestResult {
@@ -384,29 +382,7 @@ export declare class TRTCSpeedTestResult {
384
382
  upLostRate: number;
385
383
  downLostRate: number;
386
384
  rtt: number;
387
- availableUpBandwidth: number;
388
- availableDownBandwidth: number;
389
- constructor(ip?: string, quality?: TRTCQuality, upLostRate?: number, downLostRate?: number, rtt?: number, availableUpBandwidth?: number, availableDownBandwidth?: number);
390
- }
391
- /**
392
- * 5.9 测速参数
393
- *
394
- * 您可以在用户进入房间前通过 {@link startSpeedTest} 接口测试网速(注意:请不要在通话中调用)。
395
- *
396
- * @param {String} sdkAppId - 应用标识
397
- * @param {String} userId - 用户标识
398
- * @param {String} userSig - 用户签名
399
- * @param {Number} expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)
400
- * @param {Number} expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
401
- *
402
- */
403
- export declare class TRTCSpeedTestParams {
404
- sdkAppId: number;
405
- userId: string;
406
- userSig: string;
407
- expectedUpBandwidth: number;
408
- expectedDownBandwidth: number;
409
- constructor(sdkAppId?: number, userId?: string, userSig?: string, expectedUpBandwidth?: number, expectedDownBandwidth?: number);
385
+ constructor(ip?: string, quality?: TRTCQuality, upLostRate?: number, downLostRate?: number, rtt?: number);
410
386
  }
411
387
  /**
412
388
  * 记录矩形的四个点坐标
@@ -640,9 +616,6 @@ export declare class TRTCRemoteStatistics {
640
616
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
641
617
  * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
642
618
  * 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
643
- * @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
644
- * 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
645
- * 当网络为蜂窝网非 WiFi 类型时,该值无效。
646
619
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
647
620
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
648
621
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
@@ -657,14 +630,13 @@ export declare class TRTCStatistics {
657
630
  appCpu: number;
658
631
  systemCpu: number;
659
632
  rtt: number;
660
- gatewayRtt: number;
661
633
  receivedBytes: number;
662
634
  sentBytes: number;
663
635
  localStatisticsArray: TRTCLocalStatistics[];
664
636
  localStatisticsArraySize: number;
665
637
  remoteStatisticsArray: TRTCRemoteStatistics[];
666
638
  remoteStatisticsArraySize: number;
667
- constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number, gatewayRtt?: number, receivedBytes?: number, sentBytes?: number, localStatisticsArray?: TRTCLocalStatistics[], localStatisticsArraySize?: number, remoteStatisticsArray?: TRTCRemoteStatistics[], 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);
668
640
  }
669
641
  /**
670
642
  * 音乐参数
@@ -721,4 +693,5 @@ export interface PluginInfo {
721
693
  enable: () => number;
722
694
  disable: () => number;
723
695
  setParameter: (param: string) => number;
696
+ getParameter: (paramKey: string) => string;
724
697
  }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestParams = exports.TRTCSpeedTestResult = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
9
+ exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestResult = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
10
10
  /////////////////////////////////////////////////////////////////////////////////
11
11
  //
12
12
  // 【(一)视频相关枚举值定义】
@@ -878,45 +878,19 @@ exports.TRTCVolumeInfo = TRTCVolumeInfo;
878
878
  * @param {Number} upLostRate - 上行丢包率,范围是[0 - 1.0],例如0.3代表每向服务器发送10个数据包,可能有3个会在中途丢失。
879
879
  * @param {Number} downLostRate - 下行丢包率,范围是[0 - 1.0],例如0.2代表从服务器每收取10个数据包,可能有2个会在中途丢失。
880
880
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好,正常数值在10ms - 100ms之间。
881
- * @param {Number} availableUpBandwidth - 上行带宽(kbps,-1:无效值)。
882
- * @param {Number} availableDownBandwidth - 下行带宽(kbps,-1:无效值)。
883
881
  *
884
882
  */
885
883
  class TRTCSpeedTestResult {
886
- constructor(ip = '', quality = TRTCQuality.TRTCQuality_Unknown, upLostRate = 0.0, downLostRate = 0.0, rtt = 0, availableUpBandwidth = -1, availableDownBandwidth = -1) {
884
+ constructor(ip = '', quality = TRTCQuality.TRTCQuality_Unknown, upLostRate = 0.0, downLostRate = 0.0, rtt = 0) {
887
885
  this.ip = ip;
888
886
  this.quality = quality;
889
887
  this.upLostRate = upLostRate;
890
888
  this.downLostRate = downLostRate;
891
889
  this.rtt = rtt;
892
- this.availableUpBandwidth = availableUpBandwidth;
893
- this.availableDownBandwidth = availableDownBandwidth;
894
890
  }
895
891
  }
896
892
  exports.TRTCSpeedTestResult = TRTCSpeedTestResult;
897
893
  ;
898
- /**
899
- * 5.9 测速参数
900
- *
901
- * 您可以在用户进入房间前通过 {@link startSpeedTest} 接口测试网速(注意:请不要在通话中调用)。
902
- *
903
- * @param {String} sdkAppId - 应用标识
904
- * @param {String} userId - 用户标识
905
- * @param {String} userSig - 用户签名
906
- * @param {Number} expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)
907
- * @param {Number} expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
908
- *
909
- */
910
- class TRTCSpeedTestParams {
911
- constructor(sdkAppId = 0, userId = '', userSig = '', expectedUpBandwidth = 0, expectedDownBandwidth = 0) {
912
- this.sdkAppId = sdkAppId;
913
- this.userId = userId;
914
- this.userSig = userSig;
915
- this.expectedUpBandwidth = expectedUpBandwidth;
916
- this.expectedDownBandwidth = expectedDownBandwidth;
917
- }
918
- }
919
- exports.TRTCSpeedTestParams = TRTCSpeedTestParams;
920
894
  /**
921
895
  * 记录矩形的四个点坐标
922
896
  *
@@ -1220,9 +1194,6 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1220
1194
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
1221
1195
  * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
1222
1196
  * 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
1223
- * @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
1224
- * 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
1225
- * 当网络为蜂窝网非 WiFi 类型时,该值无效。
1226
1197
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
1227
1198
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
1228
1199
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
@@ -1232,13 +1203,12 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1232
1203
  *
1233
1204
  */
1234
1205
  class TRTCStatistics {
1235
- constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, gatewayRtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
1206
+ constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
1236
1207
  this.upLoss = upLoss;
1237
1208
  this.downLoss = downLoss;
1238
1209
  this.appCpu = appCpu;
1239
1210
  this.systemCpu = systemCpu;
1240
1211
  this.rtt = rtt;
1241
- this.gatewayRtt = gatewayRtt;
1242
1212
  this.receivedBytes = receivedBytes;
1243
1213
  this.sentBytes = sentBytes;
1244
1214
  this.localStatisticsArray = localStatisticsArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "9.3.108-beta.0",
3
+ "version": "9.3.112-beta.0",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",