trtc-electron-sdk 9.3.111-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 +0 -2
- package/liteav/trtc.js +7 -18
- package/package.json +1 -1
package/liteav/trtc.d.ts
CHANGED
|
@@ -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 对象单例
|
|
@@ -2005,6 +2004,5 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
2005
2004
|
_YUV2RGBA(width: number, height: number, buffer: ArrayBufferLike): Uint8ClampedArray;
|
|
2006
2005
|
_BGRA2RGBA(data: ArrayBuffer, width: number, height: number): Uint8ClampedArray;
|
|
2007
2006
|
_isMacPlatform(): boolean;
|
|
2008
|
-
_isLocalUser(uid: string): boolean;
|
|
2009
2007
|
}
|
|
2010
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
|
}
|
|
@@ -420,7 +418,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
420
418
|
*/
|
|
421
419
|
handleOnExitRoom(reason) {
|
|
422
420
|
this.firstVideoFrameList = [];
|
|
423
|
-
this.isStartLocalPreview = false;
|
|
424
421
|
this.fire('onExitRoom', reason);
|
|
425
422
|
}
|
|
426
423
|
/**
|
|
@@ -1426,7 +1423,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1426
1423
|
let key = this.getKey('local_video', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1427
1424
|
this._initRender(key, view);
|
|
1428
1425
|
}
|
|
1429
|
-
this.isStartLocalPreview = true;
|
|
1430
1426
|
this.rtcCloud.startLocalPreview();
|
|
1431
1427
|
this.addLocalVideoRenderCallback();
|
|
1432
1428
|
}
|
|
@@ -1441,9 +1437,8 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1441
1437
|
let key = this.getKey('local_video', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1442
1438
|
this._destroyRender(key, null);
|
|
1443
1439
|
this.rtcCloud.stopLocalPreview();
|
|
1444
|
-
this.
|
|
1445
|
-
|
|
1446
|
-
return !(this._isLocalUser(item.uid) && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1440
|
+
this.firstVideoFrameList = this.firstVideoFrameList.filter(function (item) {
|
|
1441
|
+
return !('' === item.uid && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1447
1442
|
});
|
|
1448
1443
|
}
|
|
1449
1444
|
/**
|
|
@@ -2960,8 +2955,8 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2960
2955
|
let key = this.getKey('camera_device_test_view', trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
2961
2956
|
this._destroyRender(key, null);
|
|
2962
2957
|
this.rtcCloud.stopCameraDeviceTest();
|
|
2963
|
-
this.firstVideoFrameList = this.firstVideoFrameList.filter((item)
|
|
2964
|
-
return !(
|
|
2958
|
+
this.firstVideoFrameList = this.firstVideoFrameList.filter(function (item) {
|
|
2959
|
+
return !('' === item.uid && item.type === trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
2965
2960
|
});
|
|
2966
2961
|
}
|
|
2967
2962
|
/**
|
|
@@ -3220,7 +3215,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3220
3215
|
return this.streams.get(key);
|
|
3221
3216
|
}
|
|
3222
3217
|
_onRenderFrame(uid, type, width, height, timestamp, rotation, data) {
|
|
3223
|
-
const isCurrentLocalUser = this._isLocalUser(uid);
|
|
3224
3218
|
// 由于 mac 监听自定义渲染回调后不会回调 onFirstVideoFrame ,所以在这里自己实现回调 onFirstVideoFrame
|
|
3225
3219
|
if (this._isMacPlatform()) {
|
|
3226
3220
|
setImmediate(() => {
|
|
@@ -3228,14 +3222,12 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3228
3222
|
return uid === item.uid && type === item.type;
|
|
3229
3223
|
});
|
|
3230
3224
|
if (index === -1) {
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
this.firstVideoFrameList.push({ uid: uid, type: type });
|
|
3234
|
-
}
|
|
3225
|
+
this.emit('onFirstVideoFrame', uid, type, width, height);
|
|
3226
|
+
this.firstVideoFrameList.push({ uid: uid, type: type });
|
|
3235
3227
|
}
|
|
3236
3228
|
});
|
|
3237
3229
|
}
|
|
3238
|
-
if (
|
|
3230
|
+
if (uid.length == 0) {
|
|
3239
3231
|
if (this.isExternalRenderEnabled) {
|
|
3240
3232
|
this.fire(CUSTOM_VIDEO_DATA, {
|
|
3241
3233
|
uid: '', type, rotation, timestamp,
|
|
@@ -3476,9 +3468,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3476
3468
|
_isMacPlatform() {
|
|
3477
3469
|
return process.platform == 'darwin';
|
|
3478
3470
|
}
|
|
3479
|
-
_isLocalUser(uid) {
|
|
3480
|
-
return uid === '';
|
|
3481
|
-
}
|
|
3482
3471
|
}
|
|
3483
3472
|
class VideoRenderCallback {
|
|
3484
3473
|
constructor() {
|