trtc-electron-sdk 10.3.401 → 10.3.402-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.
@@ -128,7 +128,6 @@ function calcVideoStyle(options = {
128
128
  exports.calcVideoStyle = calcVideoStyle;
129
129
  exports.config = new Config();
130
130
  function allocBuffer(length, userId, streamType) {
131
- console.debug('trtc:alloc buffer:', length, userId, streamType);
132
131
  if (length >= 1) {
133
132
  return Buffer.alloc(length);
134
133
  }
package/liteav/trtc.js CHANGED
@@ -1082,7 +1082,6 @@ class TRTCCloud extends events_1.EventEmitter {
1082
1082
  * @event TRTCCallback#onScreenCaptureStarted
1083
1083
  */
1084
1084
  handleOnScreenCaptureStarted() {
1085
- console.debug('trtc:onScreenCaptureStarted');
1086
1085
  this.isScreenCapturing = true;
1087
1086
  // 只有在 Buffer 为 null 时才新建,否则只能在 onVideoSizeChange 事件中重新申请 Buffer
1088
1087
  if (!screenVideoBuffer.buffer) {
@@ -1093,7 +1092,6 @@ class TRTCCloud extends events_1.EventEmitter {
1093
1092
  screenVideoBuffer.width = DEFAULT_VIDEO_WIDTH;
1094
1093
  screenVideoBuffer.height = DEFAULT_VIDEO_HEIGHT;
1095
1094
  this.rtcCloud.setSubVideoBuffer('', screenVideoBuffer.buffer, screenVideoBuffer.streamType, screenVideoBuffer.width, screenVideoBuffer.height, screenVideoBuffer.pixelFormat);
1096
- console.debug('trtc:onScreenCaptureStarted alloc add screenVideoBuffer', screenVideoBuffer);
1097
1095
  }
1098
1096
  this.fire('onScreenCaptureStarted');
1099
1097
  }
@@ -1122,12 +1120,10 @@ class TRTCCloud extends events_1.EventEmitter {
1122
1120
  * @param {Number} reason - 停止原因,0:表示用户主动停止;1:表示屏幕分享窗口被关闭
1123
1121
  */
1124
1122
  handleOnScreenCaptureStopped(reason) {
1125
- console.debug('trtc:onScreenCaptureStopped', reason);
1126
1123
  if (this.isScreenCapturing) {
1127
1124
  if (screenVideoBuffer.buffer) {
1128
1125
  this.rtcCloud.setSubVideoBuffer('', screenVideoBuffer.buffer, screenVideoBuffer.streamType, 0, 0, screenVideoBuffer.pixelFormat);
1129
1126
  screenVideoBuffer.buffer = null;
1130
- console.debug('trtc:onScreenCaptureStopped delete screenVideoBuffer', screenVideoBuffer);
1131
1127
  }
1132
1128
  this.isScreenCapturing = false;
1133
1129
  }
@@ -1907,7 +1903,7 @@ class TRTCCloud extends events_1.EventEmitter {
1907
1903
  renderer.setContentMode(mode);
1908
1904
  }
1909
1905
  else {
1910
- console.error('trtc:api setLocalViewFillMode failed. the local stream is not exsit.');
1906
+ console.error('trtc:api setLocalViewFillMode failed. the local stream does not exist.');
1911
1907
  }
1912
1908
  }
1913
1909
  /**
@@ -1952,7 +1948,7 @@ class TRTCCloud extends events_1.EventEmitter {
1952
1948
  renderer.setContentMode(mode);
1953
1949
  }
1954
1950
  else {
1955
- console.error('trtc:api setRemoteViewFillMode failed. the remote stream is not exsit.');
1951
+ console.error('trtc:api setRemoteViewFillMode failed. the remote stream does not exist.');
1956
1952
  }
1957
1953
  }
1958
1954
  /**
@@ -2555,7 +2551,7 @@ class TRTCCloud extends events_1.EventEmitter {
2555
2551
  renderer.setContentMode(mode);
2556
2552
  }
2557
2553
  else {
2558
- console.error('trtc:api setRemoteSubStreamViewFillMode failed. the remote sub stream is not exsit.');
2554
+ console.error('trtc:api setRemoteSubStreamViewFillMode failed. the remote sub stream does not exist.');
2559
2555
  }
2560
2556
  }
2561
2557
  /**
@@ -2627,7 +2623,6 @@ class TRTCCloud extends events_1.EventEmitter {
2627
2623
  * @param {Boolean} highlightWindow - 指定是否高亮正在共享的窗口,以及当捕获图像被遮挡时高亮遮挡窗口提示用户移走遮挡
2628
2624
  */
2629
2625
  selectScreenCaptureTarget(source, captureRect, property, deprecatedCaptureRect, captureMouse, highlightWindow) {
2630
- console.debug('trtc:selectScreenCaptureTarget:', source, captureRect, property, deprecatedCaptureRect, captureMouse, highlightWindow);
2631
2626
  if (source.sourceId && captureRect instanceof trtc_define_1.Rect && property instanceof trtc_define_1.TRTCScreenCaptureProperty) {
2632
2627
  const realSource = source;
2633
2628
  return this.rtcCloud.selectScreenCaptureTarget(realSource.type, realSource.sourceId, realSource.sourceName, realSource.isMinimizeWindow, captureRect.left, captureRect.top, captureRect.right, captureRect.bottom, property.enableCaptureMouse, property.enableHighLight, property.enableHighPerformance, property.highLightColor, property.highLightWidth, property.enableCaptureChildWindow);
@@ -2658,7 +2653,6 @@ class TRTCCloud extends events_1.EventEmitter {
2658
2653
  * @param {TRTCVideoEncParam} params 屏幕分享的画面编码参数,可以设置为 null,表示让 SDK 选择最佳的编码参数(分辨率、码率等)。即使在调用 startScreenCapture 时设置 type=TRTCVideoStreamTypeBig,依然可以使用此接口更新屏幕分享的编码参数。
2659
2654
  */
2660
2655
  startScreenCapture(view = null, type = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub, params = null) {
2661
- console.debug('trtc:startScreenCapture:', view, type, params);
2662
2656
  if ((type !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub && type !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig)) {
2663
2657
  type = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub;
2664
2658
  }
@@ -3495,11 +3489,13 @@ class TRTCCloud extends events_1.EventEmitter {
3495
3489
  return;
3496
3490
  }
3497
3491
  this.rtcCloud.addLocalVideoRenderCallback((id, type, width, height, timestamp, rotation) => {
3498
- if (this.isScreenCapturing && this.screenCaptureStreamType === type) {
3499
- this._onRenderFrame(id, type, width, height, timestamp, rotation, screenVideoBuffer.buffer);
3500
- }
3501
- else {
3502
- this._onRenderFrame(id, type, width, height, timestamp, rotation, localVideoBuffer.buffer);
3492
+ if (this.enableRenderFrame) {
3493
+ if (this.isScreenCapturing && this.screenCaptureStreamType === type) {
3494
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, screenVideoBuffer.buffer);
3495
+ }
3496
+ else {
3497
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, localVideoBuffer.buffer);
3498
+ }
3503
3499
  }
3504
3500
  }, this.pixelformate);
3505
3501
  }
@@ -3521,12 +3517,14 @@ class TRTCCloud extends events_1.EventEmitter {
3521
3517
  return;
3522
3518
  }
3523
3519
  this.rtcCloud.addRemoteVideoRenderCallback(userId, (id, type, width, height, timestamp, rotation) => {
3524
- const videoBufferInfo = remoteVideoBufferMap.get(id);
3525
- if (videoBufferInfo && videoBufferInfo.streamType === type) {
3526
- this._onRenderFrame(id, type, width, height, timestamp, rotation, videoBufferInfo.buffer);
3527
- }
3528
- else {
3529
- this._onRenderFrame(id, type, width, height, timestamp, rotation, screenVideoBuffer.buffer);
3520
+ if (this.enableRenderFrame) {
3521
+ const videoBufferInfo = remoteVideoBufferMap.get(id);
3522
+ if (videoBufferInfo && videoBufferInfo.streamType === type) {
3523
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, videoBufferInfo.buffer);
3524
+ }
3525
+ else {
3526
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, screenVideoBuffer.buffer);
3527
+ }
3530
3528
  }
3531
3529
  }, this.pixelformate);
3532
3530
  }
@@ -3619,7 +3617,6 @@ class TRTCCloud extends events_1.EventEmitter {
3619
3617
  }
3620
3618
  });
3621
3619
  }
3622
- console.debug('trtc:Render mode changed to:', this.renderMode);
3623
3620
  }
3624
3621
  }
3625
3622
  //----------------------------------//
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "10.3.401",
3
+ "version": "10.3.402-beta.0",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",
@@ -43,8 +43,8 @@
43
43
  "publish_doc": "node ./scripts/publish-doc.js",
44
44
  "doc": "npm run doc:clean && npm run doc:build",
45
45
  "doc:build": "npm run doc:build-zh && npm run doc:build-en",
46
- "doc:build-zh": "./node_modules/.bin/jsdoc -c ./jsdoc/jsdoc_zh.json && node ./jsdoc/fix-doc_zh.js",
47
- "doc:build-en": "./node_modules/.bin/jsdoc -c ./jsdoc/jsdoc_en.json && node ./jsdoc/fix-doc_en.js",
46
+ "doc:build-zh": "jsdoc -c ./jsdoc/jsdoc_zh.json && node ./jsdoc/fix-doc_zh.js",
47
+ "doc:build-en": "jsdoc -c ./jsdoc/jsdoc_en.json && node ./jsdoc/fix-doc_en.js",
48
48
  "doc:clean": "node ./jsdoc/clean-doc.js",
49
49
  "prerelease": "npm run build && npm run doc && node ./scripts/prerelase.js",
50
50
  "publish_npm": "node scripts/publish-npm.js"