trtc-electron-sdk 10.3.8-beta.6 → 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.
- package/liteav/trtc.d.ts +2 -1
- package/liteav/trtc.js +28 -13
- package/package.json +1 -1
- package/liteav/trtc.10.0.100-beta.12.d.ts +0 -2036
- package/liteav/trtc.10.0.100-beta.12.js +0 -3789
package/liteav/trtc.d.ts
CHANGED
|
@@ -1940,8 +1940,9 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1940
1940
|
* 该方法测试麦克风是否能正常工作,volume 的取值范围为0 - 100。
|
|
1941
1941
|
*
|
|
1942
1942
|
* @param {Number} interval - 反馈音量提示的时间间隔(ms),建议设置到大于 200 毫秒
|
|
1943
|
+
* @param {Boolean} playback - 是否开启回播麦克风声音,开启后用户测试麦克风时会听到自己的声音。默认值 true
|
|
1943
1944
|
*/
|
|
1944
|
-
startMicDeviceTest(interval: number): void;
|
|
1945
|
+
startMicDeviceTest(interval: number, playback?: boolean): void;
|
|
1945
1946
|
/**
|
|
1946
1947
|
* 13.6 停止麦克风测试
|
|
1947
1948
|
*/
|
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 =
|
|
37
|
-
const DEFAULT_VIDEO_HEIGHT =
|
|
36
|
+
const DEFAULT_VIDEO_WIDTH = 8;
|
|
37
|
+
const DEFAULT_VIDEO_HEIGHT = 8;
|
|
38
38
|
const localVideoBuffer = {
|
|
39
39
|
userId: '',
|
|
40
40
|
buffer: null,
|
|
@@ -1082,7 +1082,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1082
1082
|
handleOnScreenCaptureStarted() {
|
|
1083
1083
|
console.debug('trtc:onScreenCaptureStarted');
|
|
1084
1084
|
this.isScreenCapturing = true;
|
|
1085
|
-
// 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
|
|
1085
|
+
// 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
|
|
1086
1086
|
if (!screenVideoBuffer.buffer) {
|
|
1087
1087
|
screenVideoBuffer.userId = '';
|
|
1088
1088
|
screenVideoBuffer.streamType = this.screenCaptureStreamType;
|
|
@@ -1647,7 +1647,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1647
1647
|
this._initRender(key, view);
|
|
1648
1648
|
}
|
|
1649
1649
|
// view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
|
|
1650
|
-
// view 非 null 时,当然必须创建 Buffer
|
|
1650
|
+
// view 非 null 时,当然必须创建 Buffer
|
|
1651
1651
|
// 只有在 Buffer 为 null 时才新建,否则只能在 handleVideoSizeChange 事件中重新申请 Buffer
|
|
1652
1652
|
if (!localVideoBuffer.buffer) {
|
|
1653
1653
|
localVideoBuffer.streamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
|
|
@@ -1726,7 +1726,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1726
1726
|
this._initRender(key, view);
|
|
1727
1727
|
}
|
|
1728
1728
|
// view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
|
|
1729
|
-
// view 非 null 时,当然必须创建 Buffer
|
|
1729
|
+
// view 非 null 时,当然必须创建 Buffer
|
|
1730
1730
|
const videoBufferInfo = {
|
|
1731
1731
|
userId: userId,
|
|
1732
1732
|
buffer: (0, util_1.allocBuffer)(DEFAULT_VIDEO_WIDTH * DEFAULT_VIDEO_HEIGHT * this.pixelLength, userId, streamType),
|
|
@@ -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 {
|
|
@@ -3367,9 +3367,10 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3367
3367
|
* 该方法测试麦克风是否能正常工作,volume 的取值范围为0 - 100。
|
|
3368
3368
|
*
|
|
3369
3369
|
* @param {Number} interval - 反馈音量提示的时间间隔(ms),建议设置到大于 200 毫秒
|
|
3370
|
+
* @param {Boolean} playback - 是否开启回播麦克风声音,开启后用户测试麦克风时会听到自己的声音。默认值 true
|
|
3370
3371
|
*/
|
|
3371
|
-
startMicDeviceTest(interval) {
|
|
3372
|
-
this.rtcCloud.startMicDeviceTest(interval);
|
|
3372
|
+
startMicDeviceTest(interval, playback = true) {
|
|
3373
|
+
this.rtcCloud.startMicDeviceTest(interval, playback);
|
|
3373
3374
|
}
|
|
3374
3375
|
/**
|
|
3375
3376
|
* 13.6 停止麦克风测试
|
|
@@ -3501,11 +3502,18 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3501
3502
|
this.rtcCloud.addLocalVideoRenderCallback((id, type, width, height, timestamp, rotation, valid) => {
|
|
3502
3503
|
if (this.enableRenderFrame) {
|
|
3503
3504
|
if (valid === 1) {
|
|
3505
|
+
let targetBuffer;
|
|
3504
3506
|
if (this.isScreenCapturing && this.screenCaptureStreamType === type) {
|
|
3505
|
-
|
|
3507
|
+
targetBuffer = screenVideoBuffer;
|
|
3506
3508
|
}
|
|
3507
3509
|
else {
|
|
3508
|
-
|
|
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);
|
|
3509
3517
|
}
|
|
3510
3518
|
}
|
|
3511
3519
|
else {
|
|
@@ -3535,11 +3543,18 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3535
3543
|
if (this.enableRenderFrame) {
|
|
3536
3544
|
if (valid === 1) {
|
|
3537
3545
|
const videoBufferInfo = remoteVideoBufferMap.get(id);
|
|
3546
|
+
let targetBuffer;
|
|
3538
3547
|
if (videoBufferInfo && videoBufferInfo.streamType === type) {
|
|
3539
|
-
|
|
3548
|
+
targetBuffer = videoBufferInfo;
|
|
3540
3549
|
}
|
|
3541
3550
|
else {
|
|
3542
|
-
|
|
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);
|
|
3543
3558
|
}
|
|
3544
3559
|
}
|
|
3545
3560
|
else {
|
|
@@ -3864,7 +3879,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3864
3879
|
renderer = new Render_1.default.RGBRenderer(); // RGBA32 Canvas 2D
|
|
3865
3880
|
}
|
|
3866
3881
|
else if (this.renderMode === 4) {
|
|
3867
|
-
renderer = new Render_1.default.Canvas3DRGBARenderer(); // RGBA canvas 3D
|
|
3882
|
+
renderer = new Render_1.default.Canvas3DRGBARenderer(); // RGBA canvas 3D
|
|
3868
3883
|
}
|
|
3869
3884
|
else if (this.renderMode === 5) {
|
|
3870
3885
|
renderer = new Render_1.default.I420VideoRenderer(); // I420 video(html)
|