trtc-electron-sdk 8.9.102 → 9.1.100-alpha.2

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,8 @@ declare class TRTCCloud extends EventEmitter {
39
39
  private audioQuality;
40
40
  private bgmId;
41
41
  private playAudioEffectIdList;
42
- constructor();
42
+ private features;
43
+ constructor(enableDebug?: boolean);
43
44
  /**
44
45
  * 创建 TRTCCloud 对象单例
45
46
  * @returns {TRTCCloud}
@@ -1493,29 +1494,6 @@ declare class TRTCCloud extends EventEmitter {
1493
1494
  * @param {Number} volume - 设置的混音音量大小,范围0 - 100
1494
1495
  */
1495
1496
  setSubStreamMixVolume(volume: number): void;
1496
- /**
1497
- * 8.13 将指定窗口加入屏幕分享的排除列表中,加入排除列表中的窗口不会被分享出去
1498
- *
1499
- * 支持启动屏幕分享前设置过滤窗口,也支持屏幕分享过程中动态添加过滤窗口。
1500
- *
1501
- * @param {String} win - 不希望分享出去的窗口
1502
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1503
- * - Windows下该方法添加的窗口列表会在退房后清空;Mac下在退出房间时不会自动清空,需要调用一次removeAllExcludedShareWindow()方法清空列表。
1504
- */
1505
- addExcludedShareWindow(win: string): void;
1506
- /**
1507
- * 8.14 将指定窗口从屏幕分享的排除列表中移除
1508
- *
1509
- * @param {String} win - 不希望分享出去的窗口
1510
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1511
- */
1512
- removeExcludedShareWindow(win: string): void;
1513
- /**
1514
- * 8.15 将所有窗口从屏幕分享的排除列表中移除
1515
- *
1516
- * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1517
- */
1518
- removeAllExcludedShareWindow(): void;
1519
1497
  /**
1520
1498
  * @private
1521
1499
  * 9.5 设置本地视频自定义渲染(Electron 平台下不可用)
@@ -1839,7 +1817,7 @@ declare class TRTCCloud extends EventEmitter {
1839
1817
  * 测速结果将会用于优化 SDK 接下来的服务器选择策略,因此推荐您在用户首次通话前先进行一次测速,这将有助于我们选择最佳的服务器。
1840
1818
  * 同时,如果测试结果非常不理想,您可以通过醒目的 UI 提示用户选择更好的网络。
1841
1819
  *
1842
- * 注意:测速过程将产生少量的基础服务费用,详见 [计费概述 > 基础服务](https://cloud.tencent.com/document/product/647/17157#.E5.9F.BA.E7.A1.80.E6.9C.8D.E5.8A.A1) 文档说明。
1820
+ * 注意:测速本身会消耗一定的流量,所以也会产生少量额外的流量费用。
1843
1821
  *
1844
1822
  * @param {Number} sdkAppId - 应用标识
1845
1823
  * @param {String} userId - 用户标识
@@ -2003,5 +1981,7 @@ declare class TRTCCloud extends EventEmitter {
2003
1981
  _YUV2RGBA(width: number, height: number, buffer: ArrayBufferLike): Uint8ClampedArray;
2004
1982
  _BGRA2RGBA(data: ArrayBuffer, width: number, height: number): Uint8ClampedArray;
2005
1983
  _isMacPlatform(): boolean;
1984
+ _getFeaturesSetting(): void;
1985
+ _isEnableFeature(featureKey: string): boolean;
2006
1986
  }
2007
1987
  export default TRTCCloud;
package/liteav/trtc.js CHANGED
@@ -27,7 +27,6 @@ __exportStar(require("./trtc_define"), exports);
27
27
  __exportStar(require("./trtc_code"), exports);
28
28
  // 监听该事件,返回自定义视频渲染数据 ( bgra 格式)
29
29
  const CUSTOM_VIDEO_DATA = 'onVideoData';
30
- const SDK_LOG_LEVEL = 2;
31
30
  let genSecFunc = function (instance, key) {
32
31
  return function () {
33
32
  let param = Array.from(arguments);
@@ -63,20 +62,7 @@ let secMethods = function (instance) {
63
62
  copyMethods(instance);
64
63
  copyPropMethods(instance);
65
64
  };
66
- let formatLogParams = function (params) {
67
- let logParamsStr = '';
68
- let paramsKeyList = Object.keys(params);
69
- for (let i = 0; i < paramsKeyList.length; i++) {
70
- const paramKey = paramsKeyList[i];
71
- logParamsStr += `${paramKey}:${params[paramKey]}`;
72
- if (i !== paramsKeyList.length - 1) {
73
- logParamsStr += ',';
74
- }
75
- }
76
- return logParamsStr;
77
- };
78
65
  let trtcCloudInstance = null;
79
- let oriRtcCloud = null;
80
66
  /**
81
67
  * 腾讯云视频通话功能的主要接口类
82
68
  *
@@ -90,12 +76,9 @@ let oriRtcCloud = null;
90
76
  *
91
77
  */
92
78
  class TRTCCloud extends events_1.EventEmitter {
93
- constructor() {
79
+ constructor(enableDebug = false) {
94
80
  super();
95
- oriRtcCloud = new trtc.NodeRTCCloud(pkg.version);
96
- this.rtcCloud = Object.assign({}, oriRtcCloud, {
97
- onlineLog: undefined
98
- });
81
+ this.rtcCloud = new trtc.NodeRTCCloud(pkg.version);
99
82
  this.streams = new Map();
100
83
  this.firstVideoFrameList = [];
101
84
  this.playStreamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
@@ -116,6 +99,10 @@ class TRTCCloud extends events_1.EventEmitter {
116
99
  // 生成一个足够大, 不会与用户输入重复的 id
117
100
  this.bgmId = 1 << 29;
118
101
  this.playAudioEffectIdList = [];
102
+ this.features = null;
103
+ if (enableDebug) {
104
+ this._getFeaturesSetting();
105
+ }
119
106
  this.initEventHandler();
120
107
  console.log('constructor render:' + this.renderMode + '|sdk version:' + pkg.version +
121
108
  '|native sdk version:' + this.rtcCloud.getSDKVersion());
@@ -362,6 +349,9 @@ class TRTCCloud extends events_1.EventEmitter {
362
349
  * @param {String} errMsg - 错误信息
363
350
  */
364
351
  handleOnError(errCode, errMsg) {
352
+ if (!this._isEnableFeature('onErrorJS')) {
353
+ return;
354
+ }
365
355
  this.fire('onError', errCode, errMsg);
366
356
  }
367
357
  /**
@@ -395,14 +385,10 @@ class TRTCCloud extends events_1.EventEmitter {
395
385
  * @param {Number} result - result > 0 时为进房耗时(ms),result < 0 时为进房错误码。
396
386
  */
397
387
  handleOnEnterRoom(result) {
388
+ if (!this._isEnableFeature('onEnterRoomJS')) {
389
+ return;
390
+ }
398
391
  this.fire('onEnterRoom', result);
399
- const params = {
400
- js_version: pkg.version,
401
- electron_version: process && process.versions && process.versions.electron || '',
402
- arch: process && process.arch || '',
403
- ua: window.navigator.userAgent
404
- };
405
- oriRtcCloud.onlineLog(result, SDK_LOG_LEVEL, '[trtc-electron-sdk] trtcstats', formatLogParams(params));
406
392
  }
407
393
  /**
408
394
  * 2.2 退出房间的事件回调
@@ -417,6 +403,9 @@ class TRTCCloud extends events_1.EventEmitter {
417
403
  * @param {Number} reason - 离开房间原因,0:主动调用 exitRoom 退房;1:被服务器踢出当前房间;2:当前房间整个被解散。
418
404
  */
419
405
  handleOnExitRoom(reason) {
406
+ if (!this._isEnableFeature('onExitRoomJS')) {
407
+ return;
408
+ }
420
409
  this.firstVideoFrameList = [];
421
410
  this.fire('onExitRoom', reason);
422
411
  }
@@ -486,6 +475,9 @@ class TRTCCloud extends events_1.EventEmitter {
486
475
  * @param {String} userId - 用户标识
487
476
  */
488
477
  handleOnRemoteUserEnterRoom(userId) {
478
+ if (!this._isEnableFeature('onRemoteUserEnterRoomJS')) {
479
+ return;
480
+ }
489
481
  this.fire('onRemoteUserEnterRoom', userId);
490
482
  }
491
483
  /**
@@ -500,15 +492,18 @@ class TRTCCloud extends events_1.EventEmitter {
500
492
  * @param {Number} reason - 离开原因,0表示用户主动退出房间,1表示用户超时退出,2表示被踢出房间。
501
493
  */
502
494
  handleOnRemoteUserLeaveRoom(userId, reason) {
503
- const streamTypeList = [
504
- trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig,
505
- trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub,
506
- trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall
507
- ];
508
- streamTypeList.forEach(streamType => {
509
- const key = this.getKey(userId, streamType);
510
- this._destroyRender(key, null);
511
- });
495
+ // const streamTypeList = [
496
+ // TRTCVideoStreamType.TRTCVideoStreamTypeBig,
497
+ // TRTCVideoStreamType.TRTCVideoStreamTypeSub,
498
+ // TRTCVideoStreamType.TRTCVideoStreamTypeSmall
499
+ // ];
500
+ // streamTypeList.forEach(streamType => {
501
+ // const key = this.getKey(userId, streamType);
502
+ // this._destroyRender(key, null);
503
+ // });
504
+ if (!this._isEnableFeature('onRemoteUserLeaveRoomJS')) {
505
+ return;
506
+ }
512
507
  this.fire('onRemoteUserLeaveRoom', userId, reason);
513
508
  }
514
509
  /**
@@ -526,6 +521,9 @@ class TRTCCloud extends events_1.EventEmitter {
526
521
  * @param {Number} available - 画面是否开启
527
522
  */
528
523
  handleOnUserVideoAvailable(userId, available) {
524
+ if (!this._isEnableFeature('onUserVideoAvailableJS')) {
525
+ return;
526
+ }
529
527
  if (this._isMacPlatform()) {
530
528
  if (available == 0) {
531
529
  this.firstVideoFrameList = this.firstVideoFrameList.filter(function (item) {
@@ -653,6 +651,9 @@ class TRTCCloud extends events_1.EventEmitter {
653
651
  * @param {TRTCQualityInfo[]} remoteQuality - 下行网络质量
654
652
  */
655
653
  bindOnNetworkQuality() {
654
+ if (!this._isEnableFeature('onNetworkQualityJS')) {
655
+ return;
656
+ }
656
657
  this.rtcCloud.onEvent('onNetworkQuality', (localQuality, remoteQuality) => {
657
658
  this.fire('onNetworkQuality', localQuality, remoteQuality);
658
659
  });
@@ -669,6 +670,9 @@ class TRTCCloud extends events_1.EventEmitter {
669
670
  * @param {TRTCStatistics} statis - 统计数据,包括本地和远程的
670
671
  */
671
672
  bindOnStatistics() {
673
+ if (!this._isEnableFeature('onStatisticsJS')) {
674
+ return;
675
+ }
672
676
  this.rtcCloud.onEvent('onStatistics', (statis) => {
673
677
  this.fire('onStatistics', statis);
674
678
  });
@@ -749,6 +753,9 @@ class TRTCCloud extends events_1.EventEmitter {
749
753
  * @param {Number} totalVolume - 总的语音音量, 取值范围0 - 100
750
754
  */
751
755
  bindOnUserVoiceVolume() {
756
+ if (!this._isEnableFeature('onUserVoiceVolumeJS')) {
757
+ return;
758
+ }
752
759
  this.rtcCloud.onEvent('onUserVoiceVolume', (userVolumes, userVolumesCount, totalVolume) => {
753
760
  this.fire('onUserVoiceVolume', userVolumes, userVolumesCount, totalVolume);
754
761
  });
@@ -1012,6 +1019,9 @@ class TRTCCloud extends events_1.EventEmitter {
1012
1019
  * @param {Number} height - 截图画面的高度
1013
1020
  */
1014
1021
  handleOnSnapshotComplete(userId, type, buffer, width, height) {
1022
+ if (!this._isEnableFeature('onSnapshotCompleteJS')) {
1023
+ return;
1024
+ }
1015
1025
  const rgbData = this._BGRA2RGBA(buffer, width, height);
1016
1026
  const canvas = document.createElement('canvas');
1017
1027
  canvas.width = width;
@@ -1128,6 +1138,9 @@ class TRTCCloud extends events_1.EventEmitter {
1128
1138
  * @param {TRTCAppScene} scene - 应用场景,目前支持视频通话(VideoCall)、在线直播(Live)、语音通话(AudioCall)、语音聊天室(VoiceChatRoom)四种场景。
1129
1139
  */
1130
1140
  enterRoom(params, scene) {
1141
+ if (!this._isEnableFeature('enterRoomJS')) {
1142
+ return;
1143
+ }
1131
1144
  if (params instanceof trtc_define_1.TRTCParams) {
1132
1145
  this.rtcCloud.enterRoom(params.sdkAppId, params.roomId, params.strRoomId, params.userId, params.userSig, params.privateMapKey, params.businessInfo, params.role, params.userDefineRecordId, params.streamId === '' ? null : params.streamId, scene);
1133
1146
  }
@@ -1418,6 +1431,9 @@ class TRTCCloud extends events_1.EventEmitter {
1418
1431
  * @param {HTMLElement} view - 承载预览画面的 DOM
1419
1432
  */
1420
1433
  startLocalPreview(view) {
1434
+ if (!this._isEnableFeature('localVideoJS')) {
1435
+ return;
1436
+ }
1421
1437
  if (view !== undefined) {
1422
1438
  if (view !== null) {
1423
1439
  let key = this.getKey('local_video', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
@@ -1462,18 +1478,15 @@ class TRTCCloud extends events_1.EventEmitter {
1462
1478
  * @param {TRTCVideoStreamType} streamType - 视频流类型
1463
1479
  */
1464
1480
  startRemoteView(userId, view, streamType) {
1481
+ if (!this._isEnableFeature('remoteVideoJS')) {
1482
+ return;
1483
+ }
1465
1484
  if (streamType === undefined) {
1466
1485
  streamType = this.priorRemoteVideoStreamType;
1467
1486
  }
1468
1487
  if (view !== undefined) {
1469
1488
  if (view !== null) {
1470
- let bindStreamType = streamType;
1471
- if (bindStreamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall) {
1472
- // 如果拉取小流, 绑定 render 时也采用大流, 防止大小流切换后无法找到对应 render 进行渲染
1473
- // 这里的逻辑和 _onRenderFrame 里, 获取 render 是不论小流还是大流, 都采用大流取获取 render 有关
1474
- bindStreamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
1475
- }
1476
- const key = this.getKey(userId, bindStreamType);
1489
+ const key = this.getKey(userId, streamType);
1477
1490
  this._initRender(key, view);
1478
1491
  }
1479
1492
  this.addRemoteVideoRenderCallback(userId);
@@ -1816,6 +1829,9 @@ class TRTCCloud extends events_1.EventEmitter {
1816
1829
  * - TRTCAudioQualityMusic: 音乐模式:采样率:48k
1817
1830
  */
1818
1831
  startLocalAudio(quality) {
1832
+ if (!this._isEnableFeature('localAudioJS')) {
1833
+ return;
1834
+ }
1819
1835
  if (quality === undefined) {
1820
1836
  quality = this.audioQuality;
1821
1837
  }
@@ -2395,35 +2411,6 @@ class TRTCCloud extends events_1.EventEmitter {
2395
2411
  setSubStreamMixVolume(volume) {
2396
2412
  this.rtcCloud.setSubStreamMixVolume(volume);
2397
2413
  }
2398
- /**
2399
- * 8.13 将指定窗口加入屏幕分享的排除列表中,加入排除列表中的窗口不会被分享出去
2400
- *
2401
- * 支持启动屏幕分享前设置过滤窗口,也支持屏幕分享过程中动态添加过滤窗口。
2402
- *
2403
- * @param {String} win - 不希望分享出去的窗口
2404
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
2405
- * - Windows下该方法添加的窗口列表会在退房后清空;Mac下在退出房间时不会自动清空,需要调用一次removeAllExcludedShareWindow()方法清空列表。
2406
- */
2407
- addExcludedShareWindow(win) {
2408
- this.rtcCloud.addExcludedShareWindow(win);
2409
- }
2410
- /**
2411
- * 8.14 将指定窗口从屏幕分享的排除列表中移除
2412
- *
2413
- * @param {String} win - 不希望分享出去的窗口
2414
- * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
2415
- */
2416
- removeExcludedShareWindow(win) {
2417
- this.rtcCloud.removeExcludedShareWindow(win);
2418
- }
2419
- /**
2420
- * 8.15 将所有窗口从屏幕分享的排除列表中移除
2421
- *
2422
- * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
2423
- */
2424
- removeAllExcludedShareWindow() {
2425
- this.rtcCloud.removeAllExcludedShareWindow();
2426
- }
2427
2414
  /////////////////////////////////////////////////////////////////////////////////
2428
2415
  //
2429
2416
  // (九)自定义采集和渲染
@@ -2909,7 +2896,7 @@ class TRTCCloud extends events_1.EventEmitter {
2909
2896
  * 测速结果将会用于优化 SDK 接下来的服务器选择策略,因此推荐您在用户首次通话前先进行一次测速,这将有助于我们选择最佳的服务器。
2910
2897
  * 同时,如果测试结果非常不理想,您可以通过醒目的 UI 提示用户选择更好的网络。
2911
2898
  *
2912
- * 注意:测速过程将产生少量的基础服务费用,详见 [计费概述 > 基础服务](https://cloud.tencent.com/document/product/647/17157#.E5.9F.BA.E7.A1.80.E6.9C.8D.E5.8A.A1) 文档说明。
2899
+ * 注意:测速本身会消耗一定的流量,所以也会产生少量额外的流量费用。
2913
2900
  *
2914
2901
  * @param {Number} sdkAppId - 应用标识
2915
2902
  * @param {String} userId - 用户标识
@@ -2955,9 +2942,6 @@ class TRTCCloud extends events_1.EventEmitter {
2955
2942
  let key = this.getKey('camera_device_test_view', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
2956
2943
  this._destroyRender(key, null);
2957
2944
  this.rtcCloud.stopCameraDeviceTest();
2958
- this.firstVideoFrameList = this.firstVideoFrameList.filter(function (item) {
2959
- return !('' === item.uid && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
2960
- });
2961
2945
  }
2962
2946
  /**
2963
2947
  * 13.5 开始进行麦克风测试
@@ -3168,6 +3152,9 @@ class TRTCCloud extends events_1.EventEmitter {
3168
3152
  },
3169
3153
  setParameter: (param) => {
3170
3154
  return this.rtcCloud.setPluginParameter(pluginId, param);
3155
+ },
3156
+ getParameter: () => {
3157
+ return this.rtcCloud.getPluginParameter(pluginId);
3171
3158
  }
3172
3159
  };
3173
3160
  }
@@ -3223,18 +3210,22 @@ class TRTCCloud extends events_1.EventEmitter {
3223
3210
  }
3224
3211
  if (uid.length == 0) {
3225
3212
  if (this.isExternalRenderEnabled) {
3226
- this.fire(CUSTOM_VIDEO_DATA, {
3227
- uid: '', type, rotation, timestamp,
3228
- pixelformate: this.pixelformate,
3229
- data: { width, height, data }
3230
- });
3213
+ if (this._isEnableFeature('onVideoDataJS')) {
3214
+ this.fire(CUSTOM_VIDEO_DATA, {
3215
+ uid: '', type, rotation, timestamp,
3216
+ pixelformate: this.pixelformate,
3217
+ data: { width, height, data }
3218
+ });
3219
+ }
3231
3220
  }
3232
3221
  else {
3233
- this.fire(CUSTOM_VIDEO_DATA, {
3234
- uid: '', type, rotation, timestamp,
3235
- pixelformate: this.pixelformate,
3236
- data: {}
3237
- });
3222
+ if (this._isEnableFeature('onVideoDataJS')) {
3223
+ this.fire(CUSTOM_VIDEO_DATA, {
3224
+ uid: '', type, rotation, timestamp,
3225
+ pixelformate: this.pixelformate,
3226
+ data: {}
3227
+ });
3228
+ }
3238
3229
  this._onRealRender('local_video', type, width, height, timestamp, rotation, data); //本地社视频返回的是空
3239
3230
  this._onRealRender('camera_device_test_view', type, width, height, timestamp, rotation, data); //摄像头测试
3240
3231
  }
@@ -3247,23 +3238,24 @@ class TRTCCloud extends events_1.EventEmitter {
3247
3238
  }
3248
3239
  else {
3249
3240
  if (this.isExternalRenderEnabled) {
3250
- this.fire(CUSTOM_VIDEO_DATA, {
3251
- uid, type, rotation, timestamp,
3252
- pixelformate: this.pixelformate,
3253
- data: { width, height, data }
3254
- });
3241
+ if (this._isEnableFeature('onVideoDataJS')) {
3242
+ this.fire(CUSTOM_VIDEO_DATA, {
3243
+ uid, type, rotation, timestamp,
3244
+ pixelformate: this.pixelformate,
3245
+ data: { width, height, data }
3246
+ });
3247
+ }
3255
3248
  }
3256
3249
  else {
3257
- this.fire(CUSTOM_VIDEO_DATA, {
3258
- uid: uid, type, rotation, timestamp,
3259
- pixelformate: this.pixelformate,
3260
- data: {}
3261
- });
3250
+ if (this._isEnableFeature('onVideoDataJS')) {
3251
+ this.fire(CUSTOM_VIDEO_DATA, {
3252
+ uid: uid, type, rotation, timestamp,
3253
+ pixelformate: this.pixelformate,
3254
+ data: {}
3255
+ });
3256
+ }
3262
3257
  // 画面不区分大小流,只区分主流和辅流(屏幕分享),这里统一使用主流当做 key
3263
3258
  let streamType = type;
3264
- if (streamType === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSmall) {
3265
- streamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
3266
- }
3267
3259
  this._onRealRender(uid, streamType, width, height, timestamp, rotation, data);
3268
3260
  }
3269
3261
  //回调远程给用户数据
@@ -3462,6 +3454,35 @@ class TRTCCloud extends events_1.EventEmitter {
3462
3454
  _isMacPlatform() {
3463
3455
  return process.platform == 'darwin';
3464
3456
  }
3457
+ _getFeaturesSetting() {
3458
+ const start = Date.now();
3459
+ fetch('https://web.sdk.qcloud.com/trtc/electron/setting/feature.json', {
3460
+ cache: 'no-cache'
3461
+ })
3462
+ .then((response) => {
3463
+ const contentType = response.headers.get('content-type');
3464
+ if (!contentType || !contentType.includes('application/json')) {
3465
+ throw new TypeError("Oops, we haven't got JSON!");
3466
+ }
3467
+ return response.json();
3468
+ }).then(data => {
3469
+ this.features = data;
3470
+ const experimentApi = {
3471
+ 'api': 'setFeatureEnable',
3472
+ 'params': this.features
3473
+ };
3474
+ console.log('_getFeaturesSetting: ', this.features);
3475
+ this.callExperimentalAPI(JSON.stringify(experimentApi));
3476
+ this.emit('onReady', this.features, Date.now() - start);
3477
+ })
3478
+ .catch(error => console.error(error));
3479
+ }
3480
+ _isEnableFeature(featureKey) {
3481
+ if (!this.features || this.features[featureKey] === undefined) {
3482
+ return true;
3483
+ }
3484
+ return this.features[featureKey] === 1;
3485
+ }
3465
3486
  }
3466
3487
  class VideoRenderCallback {
3467
3488
  constructor() {
@@ -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
  * 统计数据
@@ -636,11 +632,11 @@ export declare class TRTCStatistics {
636
632
  gatewayRtt: number;
637
633
  receivedBytes: number;
638
634
  sentBytes: number;
639
- localStatisticsArray: TRTCLocalStatistics[];
635
+ localStatisticsArray: null | TRTCLocalStatistics[];
640
636
  localStatisticsArraySize: number;
641
637
  remoteStatisticsArray: TRTCRemoteStatistics[];
642
638
  remoteStatisticsArraySize: number;
643
- 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();
644
640
  }
645
641
  /**
646
642
  * 音乐参数
@@ -662,7 +658,7 @@ export declare class AudioMusicParam {
662
658
  isShortFile: boolean;
663
659
  startTimeMS: number;
664
660
  endTimeMS: number;
665
- constructor(id?: number, path?: string, loopCount?: number, publish?: boolean, isShortFile?: boolean, startTimeMS?: number, endTimeMS?: number);
661
+ constructor();
666
662
  }
667
663
  /**
668
664
  * 房间切换参数
@@ -679,7 +675,7 @@ export declare class TRTCSwitchRoomParam {
679
675
  strRoomId: string;
680
676
  userSig: string;
681
677
  privateMapKey: string;
682
- constructor(roomId?: number, strRoomId?: string, userSig?: string, privateMapKey?: string);
678
+ constructor();
683
679
  }
684
680
  export interface VideoFramePayload {
685
681
  uid: string;
@@ -697,4 +693,5 @@ export interface PluginInfo {
697
693
  enable: () => number;
698
694
  disable: () => number;
699
695
  setParameter: (param: string) => number;
696
+ getParameter: (paramKey: string) => string;
700
697
  }
@@ -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;
@@ -1206,19 +1202,19 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1206
1202
  *
1207
1203
  */
1208
1204
  class TRTCStatistics {
1209
- constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, gatewayRtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
1210
- this.upLoss = upLoss;
1211
- this.downLoss = downLoss;
1212
- this.appCpu = appCpu;
1213
- this.systemCpu = systemCpu;
1214
- this.rtt = rtt;
1215
- this.gatewayRtt = gatewayRtt;
1216
- this.receivedBytes = receivedBytes;
1217
- this.sentBytes = sentBytes;
1218
- this.localStatisticsArray = localStatisticsArray;
1219
- this.localStatisticsArraySize = localStatisticsArraySize;
1220
- this.remoteStatisticsArray = remoteStatisticsArray;
1221
- 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;
1222
1218
  }
1223
1219
  }
1224
1220
  exports.TRTCStatistics = TRTCStatistics;
@@ -1236,14 +1232,14 @@ exports.TRTCStatistics = TRTCStatistics;
1236
1232
  *
1237
1233
  */
1238
1234
  class AudioMusicParam {
1239
- constructor(id = 0, path = '', loopCount = 0, publish = true, isShortFile = false, startTimeMS = 0, endTimeMS = 0) {
1240
- this.id = id;
1241
- this.path = path;
1242
- this.loopCount = loopCount;
1243
- this.publish = publish;
1244
- this.isShortFile = isShortFile;
1245
- this.startTimeMS = startTimeMS;
1246
- 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;
1247
1243
  }
1248
1244
  }
1249
1245
  exports.AudioMusicParam = AudioMusicParam;
@@ -1258,11 +1254,11 @@ exports.AudioMusicParam = AudioMusicParam;
1258
1254
  *
1259
1255
  */
1260
1256
  class TRTCSwitchRoomParam {
1261
- constructor(roomId = 0, strRoomId = '', userSig = '', privateMapKey = '') {
1262
- this.roomId = roomId;
1263
- this.strRoomId = strRoomId;
1264
- this.userSig = userSig;
1265
- this.privateMapKey = privateMapKey;
1257
+ constructor() {
1258
+ this.roomId = 0;
1259
+ this.strRoomId = '';
1260
+ this.userSig = '';
1261
+ this.privateMapKey = '';
1266
1262
  }
1267
1263
  }
1268
1264
  exports.TRTCSwitchRoomParam = TRTCSwitchRoomParam;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "8.9.102",
3
+ "version": "9.1.100-alpha.2",
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) {