trtc-electron-sdk 11.2.118-beta.0 → 11.2.118-beta.2
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.
|
@@ -41,7 +41,9 @@ class Canvas2dRenderer {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
unbind() {
|
|
44
|
-
this.viewWrapper && this.viewContainer && this.
|
|
44
|
+
if (this.viewWrapper && this.viewContainer && this.viewWrapper.parentElement === this.viewContainer) {
|
|
45
|
+
this.viewContainer.removeChild(this.viewWrapper);
|
|
46
|
+
}
|
|
45
47
|
this.viewContainer = null;
|
|
46
48
|
this.yuv = null;
|
|
47
49
|
}
|
|
@@ -128,7 +130,7 @@ class Canvas2dRenderer {
|
|
|
128
130
|
const tempCtx = tempCanvas.getContext('2d');
|
|
129
131
|
if (tempCtx) {
|
|
130
132
|
tempCtx.putImageData(newImage, 0, 0);
|
|
131
|
-
|
|
133
|
+
const ctx = this.canvas.getContext("2d");
|
|
132
134
|
if (ctx) {
|
|
133
135
|
ctx.drawImage(tempCanvas, 0, 0);
|
|
134
136
|
}
|
|
@@ -87,9 +87,13 @@ class Canvas3dRenderer {
|
|
|
87
87
|
var _a;
|
|
88
88
|
(_a = this.canvas3DRenderer) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
89
89
|
this.canvas3DRenderer = null;
|
|
90
|
-
this.canvas && this.viewWrapper && this.
|
|
90
|
+
if (this.canvas && this.viewWrapper && this.canvas.parentElement === this.viewWrapper) {
|
|
91
|
+
this.viewWrapper.removeChild(this.canvas);
|
|
92
|
+
}
|
|
91
93
|
this.canvas = null;
|
|
92
|
-
this.viewWrapper && this.viewContainer && this.
|
|
94
|
+
if (this.viewWrapper && this.viewContainer && this.viewWrapper.parentElement === this.viewContainer) {
|
|
95
|
+
this.viewContainer.removeChild(this.viewWrapper);
|
|
96
|
+
}
|
|
93
97
|
this.viewContainer = null;
|
|
94
98
|
}
|
|
95
99
|
drawFrame(frameData) {
|
|
@@ -52,7 +52,9 @@ class VideoRenderer {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
unbind() {
|
|
55
|
-
this.viewWrapper && this.viewContainer && this.
|
|
55
|
+
if (this.viewWrapper && this.viewContainer && this.viewWrapper.parentElement === this.viewContainer) {
|
|
56
|
+
this.viewContainer.removeChild(this.viewWrapper);
|
|
57
|
+
}
|
|
56
58
|
this.viewContainer = null;
|
|
57
59
|
}
|
|
58
60
|
drawFrame(frameData) {
|
package/liteav/trtc.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
113
113
|
* @param {Number} warningCode - 警告码
|
|
114
114
|
* @param {String} warningMsg - 警告信息
|
|
115
115
|
*/
|
|
116
|
-
handleOnWarning(warningCode: number, warningMsg: string): void;
|
|
116
|
+
handleOnWarning(warningCode: number, warningMsg: string, extra: number): void;
|
|
117
117
|
/**
|
|
118
118
|
* 已加入房间的回调
|
|
119
119
|
*
|
|
@@ -2238,6 +2238,17 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
2238
2238
|
* - 2 yuvcanvs
|
|
2239
2239
|
*/
|
|
2240
2240
|
setRenderMode(mode?: number): void;
|
|
2241
|
+
/**
|
|
2242
|
+
* 插件管理器初始化接口
|
|
2243
|
+
*
|
|
2244
|
+
* 启动美颜插件管理器,并设置视频在美颜处理时的像素格式和数据传递方式。
|
|
2245
|
+
* @param options 视频预处理参数,非必填。
|
|
2246
|
+
* @param {TRTCVideoPixelFormat} options.pixelFormat - 视频像素格式,默认值:`TRTCVideoPixelFormat_I420`。
|
|
2247
|
+
* - 当数据传递方式为纹理 `TRTCVideoBufferType_Texture` 时,取值必须时 `TRTCVideoPixelFormat_RGBA32` 格式。
|
|
2248
|
+
* @param {TRTCVideoBufferType} options.bufferType - 视频数据传递方式,默认值:`TRTCVideoBufferType_Buffer`。
|
|
2249
|
+
*
|
|
2250
|
+
* @ignore
|
|
2251
|
+
*/
|
|
2241
2252
|
initPluginManager(options?: {
|
|
2242
2253
|
pixelFormat: TRTCVideoPixelFormat;
|
|
2243
2254
|
bufferType?: TRTCVideoBufferType;
|
package/liteav/trtc.js
CHANGED
|
@@ -298,7 +298,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
298
298
|
this.handleOnError(int32_1, string_1);
|
|
299
299
|
break;
|
|
300
300
|
case 'onWarning':
|
|
301
|
-
this.handleOnWarning(int32_1, string_1);
|
|
301
|
+
this.handleOnWarning(int32_1, string_1, int32_2);
|
|
302
302
|
break;
|
|
303
303
|
case 'onEnterRoom':
|
|
304
304
|
this.handleOnEnterRoom(int32_1);
|
|
@@ -479,8 +479,8 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
479
479
|
* @param {Number} warningCode - 警告码
|
|
480
480
|
* @param {String} warningMsg - 警告信息
|
|
481
481
|
*/
|
|
482
|
-
handleOnWarning(warningCode, warningMsg) {
|
|
483
|
-
this.fire('onWarning', warningCode, warningMsg);
|
|
482
|
+
handleOnWarning(warningCode, warningMsg, extra) {
|
|
483
|
+
this.fire('onWarning', warningCode, warningMsg, extra);
|
|
484
484
|
}
|
|
485
485
|
/////////////////////////////////////////////////////////////////////////////////
|
|
486
486
|
//
|
|
@@ -4029,7 +4029,19 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
4029
4029
|
//----------------------------------//
|
|
4030
4030
|
// plugin API -- start
|
|
4031
4031
|
//----------------------------------//
|
|
4032
|
+
/**
|
|
4033
|
+
* 插件管理器初始化接口
|
|
4034
|
+
*
|
|
4035
|
+
* 启动美颜插件管理器,并设置视频在美颜处理时的像素格式和数据传递方式。
|
|
4036
|
+
* @param options 视频预处理参数,非必填。
|
|
4037
|
+
* @param {TRTCVideoPixelFormat} options.pixelFormat - 视频像素格式,默认值:`TRTCVideoPixelFormat_I420`。
|
|
4038
|
+
* - 当数据传递方式为纹理 `TRTCVideoBufferType_Texture` 时,取值必须时 `TRTCVideoPixelFormat_RGBA32` 格式。
|
|
4039
|
+
* @param {TRTCVideoBufferType} options.bufferType - 视频数据传递方式,默认值:`TRTCVideoBufferType_Buffer`。
|
|
4040
|
+
*
|
|
4041
|
+
* @ignore
|
|
4042
|
+
*/
|
|
4032
4043
|
initPluginManager(options) {
|
|
4044
|
+
const defaultPixelFormat = !this._isMacPlatform() ? trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_RGBA32 : trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_BGRA32;
|
|
4033
4045
|
if (options) {
|
|
4034
4046
|
if (options.bufferType && options.bufferType === trtc_define_1.TRTCVideoBufferType.TRTCVideoBufferType_Texture) {
|
|
4035
4047
|
this.videoProcessBufferType = options.bufferType;
|
|
@@ -4041,12 +4053,12 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
4041
4053
|
this.videoProcessPixelFormat = options.pixelFormat;
|
|
4042
4054
|
}
|
|
4043
4055
|
else {
|
|
4044
|
-
this.videoProcessPixelFormat =
|
|
4056
|
+
this.videoProcessPixelFormat = defaultPixelFormat;
|
|
4045
4057
|
}
|
|
4046
4058
|
}
|
|
4047
4059
|
}
|
|
4048
4060
|
else {
|
|
4049
|
-
this.videoProcessPixelFormat =
|
|
4061
|
+
this.videoProcessPixelFormat = defaultPixelFormat;
|
|
4050
4062
|
this.videoProcessBufferType = trtc_define_1.TRTCVideoBufferType.TRTCVideoBufferType_Buffer;
|
|
4051
4063
|
}
|
|
4052
4064
|
this.rtcCloud.initializePluginManager(this.videoProcessPixelFormat, this.videoProcessBufferType);
|