trtc-electron-sdk 10.3.8-beta.8 → 10.3.8-beta.9

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.
Files changed (2) hide show
  1. package/liteav/trtc.js +21 -7
  2. package/package.json +1 -1
package/liteav/trtc.js CHANGED
@@ -33,8 +33,8 @@ __exportStar(require("./trtc_code"), exports);
33
33
  const CUSTOM_VIDEO_DATA = 'onVideoData';
34
34
  const CAMERA_DEVICE_TEST_VIEW = 'camera_device_test_view';
35
35
  const CAMERA_DEVICE_TEST_ID = 'camera_device_test';
36
- const DEFAULT_VIDEO_WIDTH = 640;
37
- const DEFAULT_VIDEO_HEIGHT = 360;
36
+ const DEFAULT_VIDEO_WIDTH = 8;
37
+ const DEFAULT_VIDEO_HEIGHT = 8;
38
38
  const localVideoBuffer = {
39
39
  userId: '',
40
40
  buffer: null,
@@ -3331,7 +3331,7 @@ class TRTCCloud extends events_1.EventEmitter {
3331
3331
  }
3332
3332
  this.rtcCloud.startCameraDeviceTest((id, type, width, height, timestamp, rotation, valid) => {
3333
3333
  if (this.enableRenderFrame) {
3334
- if (valid === 1) {
3334
+ if (valid === 1 && width === cameraTestVideoBuffer.width && height === cameraTestVideoBuffer.height) {
3335
3335
  this._onRenderFrame(id, type, width, height, timestamp, rotation, cameraTestVideoBuffer.buffer);
3336
3336
  }
3337
3337
  else {
@@ -3502,11 +3502,18 @@ class TRTCCloud extends events_1.EventEmitter {
3502
3502
  this.rtcCloud.addLocalVideoRenderCallback((id, type, width, height, timestamp, rotation, valid) => {
3503
3503
  if (this.enableRenderFrame) {
3504
3504
  if (valid === 1) {
3505
+ let targetBuffer;
3505
3506
  if (this.isScreenCapturing && this.screenCaptureStreamType === type) {
3506
- this._onRenderFrame(id, type, width, height, timestamp, rotation, screenVideoBuffer.buffer);
3507
+ targetBuffer = screenVideoBuffer;
3507
3508
  }
3508
3509
  else {
3509
- this._onRenderFrame(id, type, width, height, timestamp, rotation, localVideoBuffer.buffer);
3510
+ targetBuffer = localVideoBuffer;
3511
+ }
3512
+ if (width === targetBuffer.width && height === targetBuffer.height) {
3513
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, targetBuffer.buffer);
3514
+ }
3515
+ else {
3516
+ this.handleVideoSizeChange(id, type, width, height);
3510
3517
  }
3511
3518
  }
3512
3519
  else {
@@ -3536,11 +3543,18 @@ class TRTCCloud extends events_1.EventEmitter {
3536
3543
  if (this.enableRenderFrame) {
3537
3544
  if (valid === 1) {
3538
3545
  const videoBufferInfo = remoteVideoBufferMap.get(id);
3546
+ let targetBuffer;
3539
3547
  if (videoBufferInfo && videoBufferInfo.streamType === type) {
3540
- this._onRenderFrame(id, type, width, height, timestamp, rotation, videoBufferInfo.buffer);
3548
+ targetBuffer = videoBufferInfo;
3541
3549
  }
3542
3550
  else {
3543
- this._onRenderFrame(id, type, width, height, timestamp, rotation, screenVideoBuffer.buffer);
3551
+ targetBuffer = screenVideoBuffer;
3552
+ }
3553
+ if (width === targetBuffer.width && height === targetBuffer.height) {
3554
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, targetBuffer.buffer);
3555
+ }
3556
+ else {
3557
+ this.handleVideoSizeChange(id, type, width, height);
3544
3558
  }
3545
3559
  }
3546
3560
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "10.3.8-beta.8",
3
+ "version": "10.3.8-beta.9",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",