@tencentcloud/tuiroom-engine-electron 2.4.0-alpha.2 → 2.4.0-alpha.4

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.
@@ -1,128 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TRTCMediaMixingPlugin = require('trtc-electron-sdk/liteav/plugins/media-mixing-plugin');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var TRTCMediaMixingPlugin__default = /*#__PURE__*/_interopDefaultLegacy(TRTCMediaMixingPlugin);
10
-
11
- /******************************************************************************
12
- Copyright (c) Microsoft Corporation.
13
-
14
- Permission to use, copy, modify, and/or distribute this software for any
15
- purpose with or without fee is hereby granted.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
- PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */
25
-
26
- function __awaiter(thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- }
35
-
36
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
37
- var e = new Error(message);
38
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
39
- };
40
-
41
- const logger = console;
42
- exports.TUIMultiSourcePluginEvent = void 0;
43
- (function (TUIMultiSourcePluginEvent) {
44
- // 合图插件异常(比如独立进程异常等)
45
- TUIMultiSourcePluginEvent["onError"] = "onError";
46
- })(exports.TUIMultiSourcePluginEvent || (exports.TUIMultiSourcePluginEvent = {}));
47
- exports.TUIVideoQuality = void 0;
48
- (function (TUIVideoQuality) {
49
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_360p"] = 1] = "kVideoQuality_360p";
50
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_540p"] = 2] = "kVideoQuality_540p";
51
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_720p"] = 3] = "kVideoQuality_720p";
52
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_1080p"] = 4] = "kVideoQuality_1080p";
53
- })(exports.TUIVideoQuality || (exports.TUIVideoQuality = {}));
54
- exports.TUIResolutionMode = void 0;
55
- (function (TUIResolutionMode) {
56
- TUIResolutionMode[TUIResolutionMode["kResolutionMode_Landscape"] = 0] = "kResolutionMode_Landscape";
57
- TUIResolutionMode[TUIResolutionMode["kResolutionMode_Portrait"] = 1] = "kResolutionMode_Portrait";
58
- })(exports.TUIResolutionMode || (exports.TUIResolutionMode = {}));
59
- exports.TUIMediaSourceType = void 0;
60
- (function (TUIMediaSourceType) {
61
- TUIMediaSourceType[TUIMediaSourceType["kCamera"] = 0] = "kCamera";
62
- TUIMediaSourceType[TUIMediaSourceType["kScreen"] = 1] = "kScreen";
63
- TUIMediaSourceType[TUIMediaSourceType["kImage"] = 2] = "kImage";
64
- TUIMediaSourceType[TUIMediaSourceType["kRemoteVideo"] = 3] = "kRemoteVideo";
65
- })(exports.TUIMediaSourceType || (exports.TUIMediaSourceType = {}));
66
- class TUIMediaMixingPlugin {
67
- constructor() {
68
- this.trtcMediaMixingPlugin = new TRTCMediaMixingPlugin__default["default"]();
69
- }
70
- // To do: 事件处理
71
- setMediaServerPath(path) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- logger.log('[TUIMediaMixingPlugin]setMediaServerPath:', path);
74
- return yield this.trtcMediaMixingPlugin.setMediaServerPath(path);
75
- });
76
- }
77
- setDisplayParams(windowID, rect) {
78
- let result = 0;
79
- for (let i = windowID.length - 1; i >= 0; i--) {
80
- result = (result * 256) + windowID[i];
81
- }
82
- logger.log('[TUIMediaMixingPlugin]setDisplayParams:', result, windowID, rect);
83
- this.trtcMediaMixingPlugin.setDisplayParams(result, rect);
84
- }
85
- addMediaSource(mediaSource) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- logger.log('[TUIMediaMixingPlugin]addMediaSource:', mediaSource);
88
- return yield this.trtcMediaMixingPlugin.addMediaSource(mediaSource);
89
- });
90
- }
91
- removeMediaSource(mediaSource) {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- logger.log('[TUIMediaMixingPlugin]removeMediaSource:', mediaSource);
94
- return yield this.trtcMediaMixingPlugin.removeMediaSource(mediaSource);
95
- });
96
- }
97
- updateMediaSource(mediaSource) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- logger.log('[TUIMediaMixingPlugin]updateMediaSource:', mediaSource);
100
- return yield this.trtcMediaMixingPlugin.updateMediaSource(mediaSource);
101
- });
102
- }
103
- setCameraCaptureParam(canmeraID, param) {
104
- logger.log('[TUIMediaMixingPlugin]setCameraCaptureParam:', canmeraID, param);
105
- return this.trtcMediaMixingPlugin.setCameraCaptureParam(canmeraID, param);
106
- }
107
- startPublish() {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- logger.log('[TUIMediaMixingPlugin]startPublish');
110
- return yield this.trtcMediaMixingPlugin.startPublish();
111
- });
112
- }
113
- stopPublish() {
114
- return __awaiter(this, void 0, void 0, function* () {
115
- logger.log('[TUIMediaMixingPlugin]stopPublish');
116
- return yield this.trtcMediaMixingPlugin.stopPublish();
117
- });
118
- }
119
- updatePublishParams(params) {
120
- return __awaiter(this, void 0, void 0, function* () {
121
- logger.log('[TUIMediaMixingPlugin]updatePublishParams:', params);
122
- return yield this.trtcMediaMixingPlugin.updatePublishParams(params);
123
- });
124
- }
125
- }
126
-
127
- exports.TUIMediaMixingPlugin = TUIMediaMixingPlugin;
128
- exports["default"] = TUIMediaMixingPlugin;
@@ -1,87 +0,0 @@
1
- import { TRTCVideoEncParam, TRTCVideoResolution, TRTCVideoResolutionMode, TRTCLocalMediaTranscodingSource, TRTCVideoRotation, TRTCVideoFillMode, TRTCVideoMirrorType, TRTCCameraCaptureMode } from 'trtc-electron-sdk';
2
- export type TUIRect = {
3
- left: number;
4
- top: number;
5
- right: number;
6
- bottom: number;
7
- };
8
- export declare enum TUIMultiSourcePluginEvent {
9
- onError = "onError"
10
- }
11
- export declare enum TUIVideoQuality {
12
- kVideoQuality_360p = 1,
13
- kVideoQuality_540p = 2,
14
- kVideoQuality_720p = 3,
15
- kVideoQuality_1080p = 4
16
- }
17
- export declare enum TUIResolutionMode {
18
- kResolutionMode_Landscape = 0,
19
- kResolutionMode_Portrait = 1
20
- }
21
- export type TUIPublishParam = {
22
- videoQuality: TUIVideoQuality;
23
- resMode: TUIResolutionMode;
24
- videoFps: number;
25
- videoBitrate: number;
26
- audioBitrate: number;
27
- };
28
- export type TUIScreenCaptureSourceInfo = {
29
- type: TUIMediaSourceType;
30
- sourceId: number;
31
- sourceName: string;
32
- isMinimizeWindow: boolean;
33
- isMainScreen: boolean;
34
- rect: TUIRect;
35
- };
36
- export declare enum TUIMediaSourceType {
37
- kCamera = 0,
38
- kScreen = 1,
39
- kImage = 2,
40
- kRemoteVideo = 3
41
- }
42
- export type TUIMediaSource = {
43
- sourceType: TUIMediaSourceType;
44
- sourceId: string;
45
- zOrder: number;
46
- rect: TUIRect;
47
- enableGreenScreen?: boolean;
48
- isSelected?: boolean;
49
- rotation?: TRTCVideoRotation;
50
- fillMode?: TRTCVideoFillMode;
51
- mirrorType?: TRTCVideoMirrorType;
52
- };
53
- export type TUIVideoEncParam = {
54
- videoResolution: TRTCVideoResolution;
55
- resMode: TRTCVideoResolutionMode;
56
- videoFps: number;
57
- videoBitrate: number;
58
- minVideoBitrate: number;
59
- enableAdjustRes: boolean;
60
- };
61
- export type TUILocalMediaTranscodingParams = {
62
- inputSourceList: TUIMediaSource[] | TRTCLocalMediaTranscodingSource[];
63
- videoEncoderParams: TUIVideoEncParam | TRTCVideoEncParam;
64
- canvasColor: number;
65
- };
66
- export type TUICameraCaptureParam = {
67
- /** 摄像头采集偏好 */
68
- mode: TRTCCameraCaptureMode;
69
- /** 采集图像宽度 */
70
- width: number;
71
- /** 采集图像高度 */
72
- height: number;
73
- };
74
- export declare class TUIMediaMixingPlugin {
75
- private trtcMediaMixingPlugin;
76
- constructor();
77
- setMediaServerPath(path: string): Promise<void>;
78
- setDisplayParams(windowID: Uint8Array, rect: TUIRect): void;
79
- addMediaSource(mediaSource: TUIMediaSource): Promise<TUIRect>;
80
- removeMediaSource(mediaSource: TUIMediaSource): Promise<void>;
81
- updateMediaSource(mediaSource: TUIMediaSource): Promise<void>;
82
- setCameraCaptureParam(canmeraID: string, param: TUICameraCaptureParam): void;
83
- startPublish(): Promise<void>;
84
- stopPublish(): Promise<void>;
85
- updatePublishParams(params: TUILocalMediaTranscodingParams): Promise<void>;
86
- }
87
- export default TUIMediaMixingPlugin;
@@ -1,119 +0,0 @@
1
- import TRTCMediaMixingPlugin from 'trtc-electron-sdk/liteav/plugins/media-mixing-plugin';
2
-
3
- /******************************************************************************
4
- Copyright (c) Microsoft Corporation.
5
-
6
- Permission to use, copy, modify, and/or distribute this software for any
7
- purpose with or without fee is hereby granted.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- PERFORMANCE OF THIS SOFTWARE.
16
- ***************************************************************************** */
17
-
18
- function __awaiter(thisArg, _arguments, P, generator) {
19
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20
- return new (P || (P = Promise))(function (resolve, reject) {
21
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
22
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
23
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
24
- step((generator = generator.apply(thisArg, _arguments || [])).next());
25
- });
26
- }
27
-
28
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
29
- var e = new Error(message);
30
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
31
- };
32
-
33
- const logger = console;
34
- var TUIMultiSourcePluginEvent;
35
- (function (TUIMultiSourcePluginEvent) {
36
- // 合图插件异常(比如独立进程异常等)
37
- TUIMultiSourcePluginEvent["onError"] = "onError";
38
- })(TUIMultiSourcePluginEvent || (TUIMultiSourcePluginEvent = {}));
39
- var TUIVideoQuality;
40
- (function (TUIVideoQuality) {
41
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_360p"] = 1] = "kVideoQuality_360p";
42
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_540p"] = 2] = "kVideoQuality_540p";
43
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_720p"] = 3] = "kVideoQuality_720p";
44
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_1080p"] = 4] = "kVideoQuality_1080p";
45
- })(TUIVideoQuality || (TUIVideoQuality = {}));
46
- var TUIResolutionMode;
47
- (function (TUIResolutionMode) {
48
- TUIResolutionMode[TUIResolutionMode["kResolutionMode_Landscape"] = 0] = "kResolutionMode_Landscape";
49
- TUIResolutionMode[TUIResolutionMode["kResolutionMode_Portrait"] = 1] = "kResolutionMode_Portrait";
50
- })(TUIResolutionMode || (TUIResolutionMode = {}));
51
- var TUIMediaSourceType;
52
- (function (TUIMediaSourceType) {
53
- TUIMediaSourceType[TUIMediaSourceType["kCamera"] = 0] = "kCamera";
54
- TUIMediaSourceType[TUIMediaSourceType["kScreen"] = 1] = "kScreen";
55
- TUIMediaSourceType[TUIMediaSourceType["kImage"] = 2] = "kImage";
56
- TUIMediaSourceType[TUIMediaSourceType["kRemoteVideo"] = 3] = "kRemoteVideo";
57
- })(TUIMediaSourceType || (TUIMediaSourceType = {}));
58
- class TUIMediaMixingPlugin {
59
- constructor() {
60
- this.trtcMediaMixingPlugin = new TRTCMediaMixingPlugin();
61
- }
62
- // To do: 事件处理
63
- setMediaServerPath(path) {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- logger.log('[TUIMediaMixingPlugin]setMediaServerPath:', path);
66
- return yield this.trtcMediaMixingPlugin.setMediaServerPath(path);
67
- });
68
- }
69
- setDisplayParams(windowID, rect) {
70
- let result = 0;
71
- for (let i = windowID.length - 1; i >= 0; i--) {
72
- result = (result * 256) + windowID[i];
73
- }
74
- logger.log('[TUIMediaMixingPlugin]setDisplayParams:', result, windowID, rect);
75
- this.trtcMediaMixingPlugin.setDisplayParams(result, rect);
76
- }
77
- addMediaSource(mediaSource) {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- logger.log('[TUIMediaMixingPlugin]addMediaSource:', mediaSource);
80
- return yield this.trtcMediaMixingPlugin.addMediaSource(mediaSource);
81
- });
82
- }
83
- removeMediaSource(mediaSource) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- logger.log('[TUIMediaMixingPlugin]removeMediaSource:', mediaSource);
86
- return yield this.trtcMediaMixingPlugin.removeMediaSource(mediaSource);
87
- });
88
- }
89
- updateMediaSource(mediaSource) {
90
- return __awaiter(this, void 0, void 0, function* () {
91
- logger.log('[TUIMediaMixingPlugin]updateMediaSource:', mediaSource);
92
- return yield this.trtcMediaMixingPlugin.updateMediaSource(mediaSource);
93
- });
94
- }
95
- setCameraCaptureParam(canmeraID, param) {
96
- logger.log('[TUIMediaMixingPlugin]setCameraCaptureParam:', canmeraID, param);
97
- return this.trtcMediaMixingPlugin.setCameraCaptureParam(canmeraID, param);
98
- }
99
- startPublish() {
100
- return __awaiter(this, void 0, void 0, function* () {
101
- logger.log('[TUIMediaMixingPlugin]startPublish');
102
- return yield this.trtcMediaMixingPlugin.startPublish();
103
- });
104
- }
105
- stopPublish() {
106
- return __awaiter(this, void 0, void 0, function* () {
107
- logger.log('[TUIMediaMixingPlugin]stopPublish');
108
- return yield this.trtcMediaMixingPlugin.stopPublish();
109
- });
110
- }
111
- updatePublishParams(params) {
112
- return __awaiter(this, void 0, void 0, function* () {
113
- logger.log('[TUIMediaMixingPlugin]updatePublishParams:', params);
114
- return yield this.trtcMediaMixingPlugin.updatePublishParams(params);
115
- });
116
- }
117
- }
118
-
119
- export { TUIMediaMixingPlugin, TUIMediaSourceType, TUIMultiSourcePluginEvent, TUIResolutionMode, TUIVideoQuality, TUIMediaMixingPlugin as default };
@@ -1,132 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('trtc-electron-sdk/liteav/plugins/media-mixing-plugin')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'trtc-electron-sdk/liteav/plugins/media-mixing-plugin'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TUIMediaMixingPlugin = {}, global.TRTCMediaMixingPlugin));
5
- })(this, (function (exports, TRTCMediaMixingPlugin) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var TRTCMediaMixingPlugin__default = /*#__PURE__*/_interopDefaultLegacy(TRTCMediaMixingPlugin);
10
-
11
- /******************************************************************************
12
- Copyright (c) Microsoft Corporation.
13
-
14
- Permission to use, copy, modify, and/or distribute this software for any
15
- purpose with or without fee is hereby granted.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
- PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */
25
-
26
- function __awaiter(thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- }
35
-
36
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
37
- var e = new Error(message);
38
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
39
- };
40
-
41
- const logger = console;
42
- exports.TUIMultiSourcePluginEvent = void 0;
43
- (function (TUIMultiSourcePluginEvent) {
44
- // 合图插件异常(比如独立进程异常等)
45
- TUIMultiSourcePluginEvent["onError"] = "onError";
46
- })(exports.TUIMultiSourcePluginEvent || (exports.TUIMultiSourcePluginEvent = {}));
47
- exports.TUIVideoQuality = void 0;
48
- (function (TUIVideoQuality) {
49
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_360p"] = 1] = "kVideoQuality_360p";
50
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_540p"] = 2] = "kVideoQuality_540p";
51
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_720p"] = 3] = "kVideoQuality_720p";
52
- TUIVideoQuality[TUIVideoQuality["kVideoQuality_1080p"] = 4] = "kVideoQuality_1080p";
53
- })(exports.TUIVideoQuality || (exports.TUIVideoQuality = {}));
54
- exports.TUIResolutionMode = void 0;
55
- (function (TUIResolutionMode) {
56
- TUIResolutionMode[TUIResolutionMode["kResolutionMode_Landscape"] = 0] = "kResolutionMode_Landscape";
57
- TUIResolutionMode[TUIResolutionMode["kResolutionMode_Portrait"] = 1] = "kResolutionMode_Portrait";
58
- })(exports.TUIResolutionMode || (exports.TUIResolutionMode = {}));
59
- exports.TUIMediaSourceType = void 0;
60
- (function (TUIMediaSourceType) {
61
- TUIMediaSourceType[TUIMediaSourceType["kCamera"] = 0] = "kCamera";
62
- TUIMediaSourceType[TUIMediaSourceType["kScreen"] = 1] = "kScreen";
63
- TUIMediaSourceType[TUIMediaSourceType["kImage"] = 2] = "kImage";
64
- TUIMediaSourceType[TUIMediaSourceType["kRemoteVideo"] = 3] = "kRemoteVideo";
65
- })(exports.TUIMediaSourceType || (exports.TUIMediaSourceType = {}));
66
- class TUIMediaMixingPlugin {
67
- constructor() {
68
- this.trtcMediaMixingPlugin = new TRTCMediaMixingPlugin__default["default"]();
69
- }
70
- // To do: 事件处理
71
- setMediaServerPath(path) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- logger.log('[TUIMediaMixingPlugin]setMediaServerPath:', path);
74
- return yield this.trtcMediaMixingPlugin.setMediaServerPath(path);
75
- });
76
- }
77
- setDisplayParams(windowID, rect) {
78
- let result = 0;
79
- for (let i = windowID.length - 1; i >= 0; i--) {
80
- result = (result * 256) + windowID[i];
81
- }
82
- logger.log('[TUIMediaMixingPlugin]setDisplayParams:', result, windowID, rect);
83
- this.trtcMediaMixingPlugin.setDisplayParams(result, rect);
84
- }
85
- addMediaSource(mediaSource) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- logger.log('[TUIMediaMixingPlugin]addMediaSource:', mediaSource);
88
- return yield this.trtcMediaMixingPlugin.addMediaSource(mediaSource);
89
- });
90
- }
91
- removeMediaSource(mediaSource) {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- logger.log('[TUIMediaMixingPlugin]removeMediaSource:', mediaSource);
94
- return yield this.trtcMediaMixingPlugin.removeMediaSource(mediaSource);
95
- });
96
- }
97
- updateMediaSource(mediaSource) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- logger.log('[TUIMediaMixingPlugin]updateMediaSource:', mediaSource);
100
- return yield this.trtcMediaMixingPlugin.updateMediaSource(mediaSource);
101
- });
102
- }
103
- setCameraCaptureParam(canmeraID, param) {
104
- logger.log('[TUIMediaMixingPlugin]setCameraCaptureParam:', canmeraID, param);
105
- return this.trtcMediaMixingPlugin.setCameraCaptureParam(canmeraID, param);
106
- }
107
- startPublish() {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- logger.log('[TUIMediaMixingPlugin]startPublish');
110
- return yield this.trtcMediaMixingPlugin.startPublish();
111
- });
112
- }
113
- stopPublish() {
114
- return __awaiter(this, void 0, void 0, function* () {
115
- logger.log('[TUIMediaMixingPlugin]stopPublish');
116
- return yield this.trtcMediaMixingPlugin.stopPublish();
117
- });
118
- }
119
- updatePublishParams(params) {
120
- return __awaiter(this, void 0, void 0, function* () {
121
- logger.log('[TUIMediaMixingPlugin]updatePublishParams:', params);
122
- return yield this.trtcMediaMixingPlugin.updatePublishParams(params);
123
- });
124
- }
125
- }
126
-
127
- exports.TUIMediaMixingPlugin = TUIMediaMixingPlugin;
128
- exports["default"] = TUIMediaMixingPlugin;
129
-
130
- Object.defineProperty(exports, '__esModule', { value: true });
131
-
132
- }));
@@ -1,14 +0,0 @@
1
- {
2
- "name": "@tuiroom-engine-electron/media-mixing-plugin",
3
- "version": "0.0.1",
4
- "description": "TUI Room Engine multi-media mixing plugin for Electron.",
5
- "main": "index.js",
6
- "module": "./index.js",
7
- "types": "index.d.ts",
8
- "author": "zackshi <zackshi@tencent.com>",
9
- "keywords": [
10
- "TRTC",
11
- "Room",
12
- "Mixing"
13
- ]
14
- }
@@ -1,68 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var trtcElectronSdk = require('trtc-electron-sdk');
6
- var TRTCVideoEffectPluginManager = require('trtc-electron-sdk/liteav/plugins/video-effect-plugin');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var TRTCVideoEffectPluginManager__default = /*#__PURE__*/_interopDefaultLegacy(TRTCVideoEffectPluginManager);
11
-
12
- /* eslint no-underscore-dangle: "off"*/
13
- const logger = console;
14
- class TUIVideoEffectPlugin {
15
- constructor(pluginId, deviceId, trtcVideoEffectPlugin) {
16
- this._logPrefix = '[TUIVideoEffectPlugin]';
17
- this._pluginId = pluginId;
18
- this._deviceId = deviceId;
19
- this._trtcVideoEffectPlugin = trtcVideoEffectPlugin;
20
- }
21
- get deviceId() {
22
- return this._deviceId;
23
- }
24
- get id() {
25
- return this._pluginId;
26
- }
27
- enable(flag) {
28
- logger.debug(`${this._logPrefix}enable:${flag} ${this._pluginId}`);
29
- this._trtcVideoEffectPlugin.enable(flag);
30
- }
31
- setParameter(param) {
32
- logger.debug(`${this._logPrefix}setParameter:${this._pluginId}`);
33
- this._trtcVideoEffectPlugin.setParameter(param);
34
- }
35
- }
36
- const logPrefix = '[TUIVideoEffectPluginManager]';
37
- const TUIVideoEffectPluginManager = {
38
- setVideoPluginFormat: (bufferType = trtcElectronSdk.TRTCVideoBufferType.TRTCVideoBufferType_Buffer, pixelFormat) => {
39
- logger.debug(`${logPrefix}setVideoPluginFormat bufferType:${bufferType} pixelFormat:${pixelFormat}`);
40
- TRTCVideoEffectPluginManager__default["default"].setVideoPluginFormat(bufferType, pixelFormat);
41
- },
42
- addVideoPlugin: (options) => {
43
- logger.debug(`${logPrefix}addVideoPlugin pluginId:${options.pluginId} deviceId:${options.deviceId} path:${options.path}`);
44
- const trtcVideoEffectPlugin = TRTCVideoEffectPluginManager__default["default"].addVideoPlugin(options);
45
- if (trtcVideoEffectPlugin) {
46
- return new TUIVideoEffectPlugin(options.pluginId, options.deviceId, trtcVideoEffectPlugin);
47
- }
48
- return null;
49
- },
50
- removeVideoPlugin: (pluginId, deviceId) => {
51
- logger.debug(`${logPrefix}removeVideoPlugin pluginId:${pluginId} deviceId:${deviceId}`);
52
- TRTCVideoEffectPluginManager__default["default"].removeVideoPlugin(deviceId, pluginId);
53
- },
54
- setCallback: (callback) => {
55
- TRTCVideoEffectPluginManager__default["default"].setCallback(callback);
56
- },
57
- };
58
- exports.TUIVideoEffectEvents = void 0;
59
- (function (TUIVideoEffectEvents) {
60
- // 3D 引擎资源初始化失败
61
- // 等其他未知错误
62
- TUIVideoEffectEvents["onError"] = "onError";
63
- // 不支持分割
64
- TUIVideoEffectEvents["onNotSupportSegmentation"] = "onNotSupportSegmentation";
65
- })(exports.TUIVideoEffectEvents || (exports.TUIVideoEffectEvents = {}));
66
-
67
- exports.TUIVideoEffectPlugin = TUIVideoEffectPlugin;
68
- exports["default"] = TUIVideoEffectPluginManager;
@@ -1,28 +0,0 @@
1
- import { TRTCVideoBufferType, TRTCVideoPixelFormat } from 'trtc-electron-sdk';
2
- import { TRTCVideoEffectPlugin } from 'trtc-electron-sdk/liteav/plugins/video-effect-plugin';
3
- export declare class TUIVideoEffectPlugin {
4
- private _logPrefix;
5
- private _pluginId;
6
- private _deviceId;
7
- private _trtcVideoEffectPlugin;
8
- constructor(pluginId: string, deviceId: string, trtcVideoEffectPlugin: TRTCVideoEffectPlugin);
9
- get deviceId(): string;
10
- get id(): string;
11
- enable(flag: boolean): void;
12
- setParameter(param: string): void;
13
- }
14
- declare const TUIVideoEffectPluginManager: {
15
- setVideoPluginFormat: (bufferType: TRTCVideoBufferType | undefined, pixelFormat: TRTCVideoPixelFormat) => void;
16
- addVideoPlugin: (options: {
17
- pluginId: string;
18
- deviceId: string;
19
- path: string;
20
- }) => TUIVideoEffectPlugin | null;
21
- removeVideoPlugin: (pluginId: string, deviceId: string) => void;
22
- setCallback: (callback: (pluginId: string, errorCode: number, errorMessage: string) => void) => void;
23
- };
24
- export default TUIVideoEffectPluginManager;
25
- export declare enum TUIVideoEffectEvents {
26
- onError = "onError",
27
- onNotSupportSegmentation = "onNotSupportSegmentation"
28
- }
@@ -1,59 +0,0 @@
1
- import { TRTCVideoBufferType } from 'trtc-electron-sdk';
2
- import TRTCVideoEffectPluginManager from 'trtc-electron-sdk/liteav/plugins/video-effect-plugin';
3
-
4
- /* eslint no-underscore-dangle: "off"*/
5
- const logger = console;
6
- class TUIVideoEffectPlugin {
7
- constructor(pluginId, deviceId, trtcVideoEffectPlugin) {
8
- this._logPrefix = '[TUIVideoEffectPlugin]';
9
- this._pluginId = pluginId;
10
- this._deviceId = deviceId;
11
- this._trtcVideoEffectPlugin = trtcVideoEffectPlugin;
12
- }
13
- get deviceId() {
14
- return this._deviceId;
15
- }
16
- get id() {
17
- return this._pluginId;
18
- }
19
- enable(flag) {
20
- logger.debug(`${this._logPrefix}enable:${flag} ${this._pluginId}`);
21
- this._trtcVideoEffectPlugin.enable(flag);
22
- }
23
- setParameter(param) {
24
- logger.debug(`${this._logPrefix}setParameter:${this._pluginId}`);
25
- this._trtcVideoEffectPlugin.setParameter(param);
26
- }
27
- }
28
- const logPrefix = '[TUIVideoEffectPluginManager]';
29
- const TUIVideoEffectPluginManager = {
30
- setVideoPluginFormat: (bufferType = TRTCVideoBufferType.TRTCVideoBufferType_Buffer, pixelFormat) => {
31
- logger.debug(`${logPrefix}setVideoPluginFormat bufferType:${bufferType} pixelFormat:${pixelFormat}`);
32
- TRTCVideoEffectPluginManager.setVideoPluginFormat(bufferType, pixelFormat);
33
- },
34
- addVideoPlugin: (options) => {
35
- logger.debug(`${logPrefix}addVideoPlugin pluginId:${options.pluginId} deviceId:${options.deviceId} path:${options.path}`);
36
- const trtcVideoEffectPlugin = TRTCVideoEffectPluginManager.addVideoPlugin(options);
37
- if (trtcVideoEffectPlugin) {
38
- return new TUIVideoEffectPlugin(options.pluginId, options.deviceId, trtcVideoEffectPlugin);
39
- }
40
- return null;
41
- },
42
- removeVideoPlugin: (pluginId, deviceId) => {
43
- logger.debug(`${logPrefix}removeVideoPlugin pluginId:${pluginId} deviceId:${deviceId}`);
44
- TRTCVideoEffectPluginManager.removeVideoPlugin(deviceId, pluginId);
45
- },
46
- setCallback: (callback) => {
47
- TRTCVideoEffectPluginManager.setCallback(callback);
48
- },
49
- };
50
- var TUIVideoEffectEvents;
51
- (function (TUIVideoEffectEvents) {
52
- // 3D 引擎资源初始化失败
53
- // 等其他未知错误
54
- TUIVideoEffectEvents["onError"] = "onError";
55
- // 不支持分割
56
- TUIVideoEffectEvents["onNotSupportSegmentation"] = "onNotSupportSegmentation";
57
- })(TUIVideoEffectEvents || (TUIVideoEffectEvents = {}));
58
-
59
- export { TUIVideoEffectEvents, TUIVideoEffectPlugin, TUIVideoEffectPluginManager as default };