trtc-electron-sdk 9.3.8-beta.3 → 9.3.8-beta.6
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 -0
- package/liteav/trtc.js +11 -2
- package/package.json +1 -1
package/liteav/trtc.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
39
39
|
private audioQuality;
|
|
40
40
|
private bgmId;
|
|
41
41
|
private playAudioEffectIdList;
|
|
42
|
+
private enableRenderFrame;
|
|
42
43
|
constructor();
|
|
43
44
|
/**
|
|
44
45
|
* 创建 TRTCCloud 对象单例
|
|
@@ -1977,6 +1978,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1977
1978
|
createPlugin(pluginId: string): PluginInfo;
|
|
1978
1979
|
setPluginCallback(pluginCb: (pluginId: string, errorCode: number, msg: string) => void): void;
|
|
1979
1980
|
getKey(uid: string, type: TRTCVideoStreamType): string;
|
|
1981
|
+
setEnableRenderFrame(enable: boolean): void;
|
|
1980
1982
|
/**
|
|
1981
1983
|
* 判断是否支持webGL
|
|
1982
1984
|
* @returns {boolean}
|
package/liteav/trtc.js
CHANGED
|
@@ -116,6 +116,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
116
116
|
// 生成一个足够大, 不会与用户输入重复的 id
|
|
117
117
|
this.bgmId = 1 << 29;
|
|
118
118
|
this.playAudioEffectIdList = [];
|
|
119
|
+
this.enableRenderFrame = true;
|
|
119
120
|
this.initEventHandler();
|
|
120
121
|
console.log('constructor render:' + this.renderMode + '|sdk version:' + pkg.version +
|
|
121
122
|
'|native sdk version:' + this.rtcCloud.getSDKVersion());
|
|
@@ -3098,7 +3099,9 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3098
3099
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3099
3100
|
}
|
|
3100
3101
|
this.rtcCloud.addLocalVideoRenderCallback((id, type, width, height, timestamp, rotation, data) => {
|
|
3101
|
-
this.
|
|
3102
|
+
if (this.enableRenderFrame) {
|
|
3103
|
+
this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
|
|
3104
|
+
}
|
|
3102
3105
|
}, this.pixelformate);
|
|
3103
3106
|
}
|
|
3104
3107
|
addRemoteVideoRenderCallback(userid) {
|
|
@@ -3109,7 +3112,9 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3109
3112
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3110
3113
|
}
|
|
3111
3114
|
this.rtcCloud.addRemoteVideoRenderCallback(userid, (id, type, width, height, timestamp, rotation, data) => {
|
|
3112
|
-
this.
|
|
3115
|
+
if (this.enableRenderFrame) {
|
|
3116
|
+
this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
|
|
3117
|
+
}
|
|
3113
3118
|
}, this.pixelformate);
|
|
3114
3119
|
}
|
|
3115
3120
|
//----------------------------------//
|
|
@@ -3180,6 +3185,10 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3180
3185
|
getKey(uid, type) {
|
|
3181
3186
|
return String(uid) + '_' + String(type);
|
|
3182
3187
|
}
|
|
3188
|
+
setEnableRenderFrame(enable) {
|
|
3189
|
+
console.log('setEnableRenderFrame:' + enable);
|
|
3190
|
+
this.enableRenderFrame = enable;
|
|
3191
|
+
}
|
|
3183
3192
|
/**
|
|
3184
3193
|
* 判断是否支持webGL
|
|
3185
3194
|
* @returns {boolean}
|