trtc-electron-sdk 9.3.8-alpha.0 → 9.3.8-alpha.1
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 +9 -2
- package/package.json +1 -1
package/liteav/trtc.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
40
40
|
private bgmId;
|
|
41
41
|
private playAudioEffectIdList;
|
|
42
42
|
private features;
|
|
43
|
+
private enableRenderFrame;
|
|
43
44
|
constructor(enableDebug?: boolean);
|
|
44
45
|
/**
|
|
45
46
|
* 创建 TRTCCloud 对象单例
|
|
@@ -1978,6 +1979,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1978
1979
|
createPlugin(pluginId: string): PluginInfo;
|
|
1979
1980
|
setPluginCallback(pluginCb: (pluginId: string, errorCode: number, msg: string) => void): void;
|
|
1980
1981
|
getKey(uid: string, type: TRTCVideoStreamType): string;
|
|
1982
|
+
setEnableRenderFrame(enable: boolean): void;
|
|
1981
1983
|
/**
|
|
1982
1984
|
* 判断是否支持webGL
|
|
1983
1985
|
* @returns {boolean}
|
package/liteav/trtc.js
CHANGED
|
@@ -117,6 +117,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
117
117
|
this.bgmId = 1 << 29;
|
|
118
118
|
this.playAudioEffectIdList = [];
|
|
119
119
|
this.features = null;
|
|
120
|
+
this.enableRenderFrame = true;
|
|
120
121
|
if (enableDebug) {
|
|
121
122
|
this._getFeaturesSetting();
|
|
122
123
|
}
|
|
@@ -3116,7 +3117,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3116
3117
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3117
3118
|
}
|
|
3118
3119
|
this.rtcCloud.addLocalVideoRenderCallback((id, type, width, height, timestamp, rotation, data) => {
|
|
3119
|
-
if (this._isEnableFeature('onRenderLocalFrameJS')) {
|
|
3120
|
+
if (this._isEnableFeature('onRenderLocalFrameJS') && this.enableRenderFrame) {
|
|
3120
3121
|
this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
|
|
3121
3122
|
}
|
|
3122
3123
|
}, this.pixelformate);
|
|
@@ -3129,7 +3130,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3129
3130
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3130
3131
|
}
|
|
3131
3132
|
this.rtcCloud.addRemoteVideoRenderCallback(userid, (id, type, width, height, timestamp, rotation, data) => {
|
|
3132
|
-
if (this._isEnableFeature('onRenderRemoteFrameJS')) {
|
|
3133
|
+
if (this._isEnableFeature('onRenderRemoteFrameJS') && this.enableRenderFrame) {
|
|
3133
3134
|
this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
|
|
3134
3135
|
}
|
|
3135
3136
|
}, this.pixelformate);
|
|
@@ -3144,6 +3145,9 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3144
3145
|
* - 2 yuvcanvs
|
|
3145
3146
|
*/
|
|
3146
3147
|
setRenderMode(mode = 1) {
|
|
3148
|
+
if (!this._isEnableFeature('enableRenderModeJS')) {
|
|
3149
|
+
return;
|
|
3150
|
+
}
|
|
3147
3151
|
if (this.renderMode !== mode) {
|
|
3148
3152
|
this.renderMode = mode;
|
|
3149
3153
|
// 遍历原有的renderer,改为新的渲染模式
|
|
@@ -3220,6 +3224,9 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3220
3224
|
getKey(uid, type) {
|
|
3221
3225
|
return String(uid) + '_' + String(type);
|
|
3222
3226
|
}
|
|
3227
|
+
setEnableRenderFrame(enable) {
|
|
3228
|
+
this.enableRenderFrame = enable;
|
|
3229
|
+
}
|
|
3223
3230
|
/**
|
|
3224
3231
|
* 判断是否支持webGL
|
|
3225
3232
|
* @returns {boolean}
|