trtc-electron-sdk
Version:
trtc electron sdk
593 lines (592 loc) • 27.6 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TRTCMediaMixingManager = exports.TRTCMediaMixingErrorCode = exports.TRTCMediaMixingEvent = exports.TRTCMediaSourceType = void 0;
const events_1 = require("events");
const trtc_define_1 = require("../../trtc_define");
const utils_1 = require("../../utils");
const logger_1 = __importDefault(require("../../logger"));
const index_1 = __importDefault(require("../../MediaMixingDesigner/index"));
const NodeTRTCEngine = require('../../../build/Release/trtc_electron_sdk.node');
/**
* 媒体源类型
* @enum {Number}
*/
const TRTCMediaSourceType_HACK_JSDOC = {
/** 摄像头 */
kCamera: 0,
/** 屏幕/窗口分享 */
kScreen: 1,
/** 图片 */
kImage: 2,
};
var TRTCMediaSourceType;
(function (TRTCMediaSourceType) {
TRTCMediaSourceType[TRTCMediaSourceType["kCamera"] = 0] = "kCamera";
TRTCMediaSourceType[TRTCMediaSourceType["kScreen"] = 1] = "kScreen";
TRTCMediaSourceType[TRTCMediaSourceType["kImage"] = 2] = "kImage";
})(TRTCMediaSourceType = exports.TRTCMediaSourceType || (exports.TRTCMediaSourceType = {}));
/**
* 媒体源数据
*
* @typedef {Object} TRTCMediaSource
* @property {TRTCMediaSourceType} sourceType 媒体源类型
* @property {String} sourceId 媒体源唯一 ID
* @property {Number} zOrder 媒体源展示层级,取值 0 - 15
* @property {Rect} rect 媒体源显示区域
* @property {Boolean} isSelected 媒体源是否选中,可选属性,默认:false
* @property {TRTCVideoRotation} rotation 媒体源选中角度,可选属性
* @property {TRTCVideoFillMode} fillMode 媒体源显示模式,可选属性,默认 `TRTCVideoFillMode_Fit`
* @property {TRTCVideoMirrorType} mirrorType 媒体源是否镜像,可选属性,默认不镜像
*/
const TRTCMediaSource_HACK_JSDOC = null;
/**
* 媒体源本地混流编码参数
*
* @typedef {Object} TRTCMediaMixingEncParam
* @property {TRTCVideoEncParam} videoEncoderParams 本地混流编码参数
* @property {Number} canvasColor 混流视频背景色,默认值:0x0 代表黑色。格式为十六进制数字,比如:`0x61B9F1` 代表 RGB 颜色(97、158、241)。
*/
const TRTCMediaMixingEncParam_HACK_JSDOC = null;
/**
* @namespace TRTCMediaMixingEvent
* @description 目前只支持 `Windows` 操作系统
*/
var TRTCMediaMixingEvent;
(function (TRTCMediaMixingEvent) {
/**
* @description 媒体源选中事件
*
* @event TRTCMediaMixingEvent#onSourceSelected
* @param {TRTCMediaInfo | null} mediaSource 新选中的媒体源数据,取消选中则为`null`
*/
TRTCMediaMixingEvent["onSourceSelected"] = "onSourceSelected";
/**
* @description 媒体源移动事件
*
* @event TRTCMediaMixingEvent#onSourceMoved
* @param {TRTCMediaInfo} mediaSource 被移动的媒体源
* @param {Rect} rect 移动后的位置、区域数据
*/
TRTCMediaMixingEvent["onSourceMoved"] = "onSourceMoved";
/**
* @description 媒体源尺寸变化事件
*
* @event TRTCMediaMixingEvent#onSourceResized
* @param {TRTCMediaInfo} mediaSource 尺寸变化的媒体源
* @param {Rect} rect 尺寸变化后的位置、区域数据
*/
TRTCMediaMixingEvent["onSourceResized"] = "onSourceResized";
/**
* @description 媒体源鼠标右键事件
*
* @event TRTCMediaMixingEvent#onRightButtonClicked
* @param {TRTCMediaInfo} mediaSource 鼠标右键点击的媒体源
*/
TRTCMediaMixingEvent["onRightButtonClicked"] = "onRightButtonClicked";
})(TRTCMediaMixingEvent = exports.TRTCMediaMixingEvent || (exports.TRTCMediaMixingEvent = {}));
var TRTCMediaMixingErrorCode;
(function (TRTCMediaMixingErrorCode) {
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["Success"] = 0] = "Success";
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["Error"] = -1] = "Error";
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["InvalidParams"] = -2] = "InvalidParams";
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["NotFoundSource"] = -3] = "NotFoundSource";
TRTCMediaMixingErrorCode[TRTCMediaMixingErrorCode["ImageSourceLoadFailed"] = -4] = "ImageSourceLoadFailed";
})(TRTCMediaMixingErrorCode = exports.TRTCMediaMixingErrorCode || (exports.TRTCMediaMixingErrorCode = {}));
/**
* 本地混流管理器
*/
class TRTCMediaMixingManager {
constructor(options) {
this.logPrefix = '[TRTCMediaMixingManager]';
this.mediaMixingDesigner = null;
this.windowID = 0;
this.view = null;
this.resizeObserver = null;
this.sourceList = [];
this.eventEmitter = new events_1.EventEmitter();
this.eventHandler = this.eventHandler.bind(this);
this.nodeMediaMixingPlugin = new NodeTRTCEngine.NodeRemoteMultiSourcePlugin();
this.nodeMediaMixingPlugin.setRemoteMultiSourcePluginCallback(this.eventHandler);
this.deviceManager = options.deviceManager;
this.nodeTRTCCloud = options.nodeTRTCCloud;
this.setMediaServerPath('');
this.publishParams = {
videoEncoderParams: {
videoResolution: trtc_define_1.TRTCVideoResolution.TRTCVideoResolution_1920_1080,
resMode: trtc_define_1.TRTCVideoResolutionMode.TRTCVideoResolutionModeLandscape,
videoFps: 30,
videoBitrate: 3000,
minVideoBitrate: 3000,
enableAdjustRes: true,
},
canvasColor: 0x0
};
this.onSourceSelected = this.onSourceSelected.bind(this);
this.onSourceMoved = this.onSourceMoved.bind(this);
this.onSourceResized = this.onSourceResized.bind(this);
this.onRightButtonClicked = this.onRightButtonClicked.bind(this);
this.onPreviewAreaResize = this.onPreviewAreaResize.bind(this);
this.onVisibilityChange = this.onVisibilityChange.bind(this);
document.addEventListener('visibilitychange', this.onVisibilityChange);
}
destroy() {
document.removeEventListener('visibilitychange', this.onVisibilityChange);
if (this.resizeObserver && this.view) {
this.resizeObserver.unobserve(this.view);
this.resizeObserver.disconnect();
}
this.view = null;
this.windowID = 0;
this.destroyDesigner();
this.nodeTRTCCloud = null;
this.deviceManager = null;
this.nodeMediaMixingPlugin = null;
this.eventEmitter = null;
}
eventHandler(args) {
logger_1.default.log(`${this.logPrefix} event:`, args);
// const key = args[0] as string;
// const data = args[1] as { [key: string]: never };
// To do: 待完善
}
/**
* 设置混流视频预览参数
*
* @param windowID {Number|Uint8Array} - 操作系统层的窗口 ID,Electron 下可以通过 Electron API [BrowserWindow.getNativeWindowHandle()]{@link https://www.electronjs.org/docs/latest/api/browser-window#wingetnativewindowhandle} 接口获取
* @param viewOrRegion {HTMLElement | Rect | null} - 本地混流视频显示位置
* - 传入 HTMLElement 元素,则 SDK 将本地混流视频显示在 HTMLElement 元素内,同时支持点击选中、移动、缩放媒体源,支持触发右键菜单事件。HTMLElement 元素必须是块元素。
* - 传入 Rect 显示区域,则 SDK 将本地混流视频显示在 Rect 指定区域内,不支持点击选中、移动、缩放媒体源,不支持触发右键菜单事件,这些功能您可以在 Web 页面中自行实现。
* - 传入 null 则 SDK 将停止显示本地混流视频。
*
* @example
* // Display in HTML Element
* import TRTCCloud from 'trtc-electron-sdk';
*
* const trtcCloud = TRTCCloud.getTRTCShareInstance({
* isIPCMode: true
* });
*
* const mediaMixingManager = trtcCloud.getMediaMixingManager();
*
* const windowID = 0; // Use Electron API BrowserWindow.getNativeWindowHandle()
* const previewDOM = document.getElementById("preview-local-mixed-media-stream");
* mediaMixingManager.setDisplayParams(windowID, previewDOM);
*
* @example
* // Display in a rectangle section
* import TRTCCloud from 'trtc-electron-sdk';
*
* const trtcCloud = TRTCCloud.getTRTCShareInstance({
* isIPCMode: true
* });
*
* const mediaMixingManager = trtcCloud.getMediaMixingManager();
*
* const windowID = 0; // Use Electron API BrowserWindow.getNativeWindowHandle()
* const previewDOM = document.getElementById("preview-local-mixed-media-stream");
* const domRect = previewDOM.getBoundingClientRect();
* const rect = {
* left: domRect.left * window.devicePixelRatio,
* right: domRect.right * window.devicePixelRatio,
* top: domRect.top * window.devicePixelRatio,
* bottom: domRect.bottom * window.devicePixelRatio
* };
*
* mediaMixingManager.setDisplayParams(windowID, previewDOM);
*/
setDisplayParams(windowID, viewOrRegion) {
logger_1.default.log(`${this.logPrefix}setDisplayParams:`, windowID, viewOrRegion);
let newWindowID = 0;
if (windowID instanceof Uint8Array) {
newWindowID = (0, utils_1.convertUint8ArrayToNumber)(windowID);
}
else {
newWindowID = windowID;
}
this.windowID = newWindowID;
if (newWindowID !== 0 && viewOrRegion !== null) {
if (viewOrRegion instanceof HTMLElement) {
this.destroyDesigner();
this.view = viewOrRegion;
this.setDisplayRect();
this.initResizeObserver();
this.createDesigner();
}
else {
// Rect
this.nodeMediaMixingPlugin.setDisplayParams(newWindowID, viewOrRegion);
}
}
else {
this.destroyDesigner();
this.nodeMediaMixingPlugin.setDisplayParams(newWindowID, { left: 0, right: 0, top: 0, bottom: 0 });
}
}
/**
* 添加媒体源
* @param mediaSource {TRTCMediaSource} - 媒体源信息
* @returns {Promise<Rect>}
*/
addMediaSource(mediaSource) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
logger_1.default.log(`${this.logPrefix}addMediaSource:`, mediaSource);
const index = this.findMediaSourceIndex(mediaSource);
if (index !== -1) {
throw new Error("Media source already existed");
}
const newMediaSource = (0, utils_1.safelyParse)(JSON.stringify(mediaSource));
if (newMediaSource.isSelected) {
const oldSelectedIndex = this.findSelectedMediaSource();
if (oldSelectedIndex !== -1) {
this.unselectMediaSource(oldSelectedIndex);
}
}
const rect = yield this.nodeMediaMixingPlugin.addMediaSource(newMediaSource);
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.addMedia({
id: `${newMediaSource.sourceType}__${newMediaSource.sourceId}`,
rect: newMediaSource.rect,
isSelected: newMediaSource.isSelected || false,
origin: newMediaSource
});
this.sourceList.push(newMediaSource);
return rect;
});
}
/**
* 删除媒体源
* @param mediaSource {TRTCMediaSource} - 媒体源信息
* @returns {Promise<void>}
*/
removeMediaSource(mediaSource) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
logger_1.default.log(`${this.logPrefix}removeMediaSource:`, mediaSource);
const index = this.findMediaSourceIndex(mediaSource);
if (index === -1) {
throw new Error("Not existing media source to remove");
}
yield this.nodeMediaMixingPlugin.removeMediaSource(mediaSource);
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.removeMedia({
id: `${mediaSource.sourceType}__${mediaSource.sourceId}`,
rect: mediaSource.rect,
isSelected: mediaSource.isSelected || false,
origin: (0, utils_1.safelyParse)(JSON.stringify(mediaSource))
});
this.sourceList.splice(index, 1);
});
}
/**
* 更新媒体源
* @param mediaSource {TRTCMediaSource} - 媒体源信息
* @returns {Promise<void>}
*/
updateMediaSource(mediaSource) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
logger_1.default.log(`${this.logPrefix}updateMediaSource:`, mediaSource);
const index = this.findMediaSourceIndex(mediaSource);
if (index === -1) {
throw new Error("Not existing media source to update");
}
const newMediaSource = Object.assign(Object.assign({}, this.sourceList[index]), (0, utils_1.safelyParse)(JSON.stringify(mediaSource)));
if (mediaSource.isSelected) {
const oldSelectedIndex = this.findSelectedMediaSource();
if (oldSelectedIndex !== -1 && oldSelectedIndex !== index) {
this.unselectMediaSource(oldSelectedIndex);
}
}
yield this.nodeMediaMixingPlugin.updateMediaSource(newMediaSource);
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.updateMedia({
id: `${mediaSource.sourceType}__${mediaSource.sourceId}`,
rect: mediaSource.rect,
isSelected: mediaSource.isSelected || false,
origin: (0, utils_1.safelyParse)(JSON.stringify(mediaSource))
});
this.sourceList[index] = newMediaSource;
});
}
/**
* 设置摄像头采集参数
* @param cameraID {string} - 摄像头 ID
* @param params {TRTCCameraCaptureParams} - 摄像头采集参数
*/
setCameraCaptureParam(cameraID, params) {
this.nodeMediaMixingPlugin.setCameraCaptureParam(cameraID, params);
}
/**
* 开始推流
* @returns {Promise<void>}
*/
startPublish() {
return __awaiter(this, void 0, void 0, function* () {
logger_1.default.log(`${this.logPrefix}startPublish`);
return yield this.nodeMediaMixingPlugin.startPublish();
});
}
/**
* 停止推流
* @returns {Promise<void>}
*/
stopPublish() {
return __awaiter(this, void 0, void 0, function* () {
logger_1.default.log(`${this.logPrefix}stopPublish`);
return yield this.nodeMediaMixingPlugin.stopPublish();
});
}
/**
* 更新本地混流编码参数
* @param params {TRTCMediaMixingEncParam} - 推流视频编码参数、背景色等参数
* @returns {Promise<void>}
*/
updatePublishParams(params) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
logger_1.default.log(`${this.logPrefix}updatePublishParams:`, params);
this.publishParams = params;
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.updateOptions({
videoResolution: this.publishParams.videoEncoderParams.videoResolution,
resMode: this.publishParams.videoEncoderParams.resMode
});
return yield this.nodeMediaMixingPlugin.updatePublishParams(params);
});
}
/**
* @private
* 设置服务进程程序路径
*
* 开发模式,默认路径:node_modules\\trtc-electron-sdk\\build\\Release\\liteav_media_server.exe
* 构建模式,默认路径:${resourcesPath}\\liteav_media_server.exe
*
* 如果用户应用有特殊配置,默认路径可能找不到服务进程程序,需要自行传入路径。
*
* @param path {string} - 服务进程程序路径
*
* @returns {Promise<void>}
*/
setMediaServerPath(path) {
return __awaiter(this, void 0, void 0, function* () {
let serverPath = '';
if (path && path.trim() !== '') {
serverPath = path;
}
else {
const { resourcesPath, execPath } = globalThis.process;
if (execPath.endsWith('electron.exe')) {
serverPath = '..\\..\\..\\..\\node_modules\\trtc-electron-sdk\\build\\Release\\liteav_media_server.exe';
}
else {
serverPath = `${resourcesPath}\\liteav_media_server.exe`;
}
}
logger_1.default.log(`${this.logPrefix} server path:${serverPath}`);
return yield this.nodeMediaMixingPlugin.setMediaServerPath(serverPath);
});
}
/**
* 注册事件监听
*
* @param event {TRTCMediaMixingEvent} - 事件名称
* @param func {Function} - 事件回调函数
*/
on(event, func) {
var _a;
(_a = this.eventEmitter) === null || _a === void 0 ? void 0 : _a.on(event, func);
}
/**
* 取消事件监听
*
* @param event {TRTCMediaMixingEvent} - 事件名
* @param func {Function} - 事件回调函数
*/
off(event, func) {
var _a;
(_a = this.eventEmitter) === null || _a === void 0 ? void 0 : _a.off(event, func);
}
initResizeObserver() {
if (this.view) {
this.resizeObserver = new ResizeObserver(this.onPreviewAreaResize);
this.resizeObserver.observe(this.view);
}
}
onPreviewAreaResize(entries) {
logger_1.default.log(`${this.logPrefix}onPreviewAreaResize:`, entries);
for (const entry of entries) {
if (this.windowID && entry.target === this.view) {
this.setDisplayRect();
break;
}
}
}
onVisibilityChange() {
logger_1.default.log(`${this.logPrefix}onVisibilityChange document.hidden:${document.hidden}`);
if (document.hidden) {
this.setDisplayParams(this.windowID, { left: 0, right: 0, top: 0, bottom: 0 });
}
else {
this.setDisplayRect();
}
}
setDisplayRect() {
if (this.windowID && this.view) {
const clientRect = this.view.getBoundingClientRect();
const rect = {
left: clientRect.left * window.devicePixelRatio,
right: clientRect.right * window.devicePixelRatio,
top: clientRect.top * window.devicePixelRatio,
bottom: clientRect.bottom * window.devicePixelRatio,
};
this.nodeMediaMixingPlugin.setDisplayParams(this.windowID, rect);
}
}
createDesigner() {
var _a, _b;
if (this.view) {
this.mediaMixingDesigner = new index_1.default({
view: this.view,
videoResolution: ((_a = this.publishParams) === null || _a === void 0 ? void 0 : _a.videoEncoderParams.videoResolution) || trtc_define_1.TRTCVideoResolution.TRTCVideoResolution_1920_1080,
resMode: ((_b = this.publishParams) === null || _b === void 0 ? void 0 : _b.videoEncoderParams.resMode) || trtc_define_1.TRTCVideoResolutionMode.TRTCVideoResolutionModeLandscape,
canExceedContainer: true,
});
this.listenDesignerEvent();
}
}
destroyDesigner() {
var _a;
if (this.mediaMixingDesigner) {
this.unlistenDesignerEvent();
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.destroy();
this.mediaMixingDesigner = null;
}
}
listenDesignerEvent() {
var _a, _b, _c, _d, _e;
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.on('onError', this.onError);
(_b = this.mediaMixingDesigner) === null || _b === void 0 ? void 0 : _b.on('onSourceSelected', this.onSourceSelected);
(_c = this.mediaMixingDesigner) === null || _c === void 0 ? void 0 : _c.on('onSourceMoved', this.onSourceMoved);
(_d = this.mediaMixingDesigner) === null || _d === void 0 ? void 0 : _d.on('onSourceResized', this.onSourceResized);
(_e = this.mediaMixingDesigner) === null || _e === void 0 ? void 0 : _e.on('onRightButtonClicked', this.onRightButtonClicked);
}
unlistenDesignerEvent() {
var _a, _b, _c, _d, _e;
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.off('onError', this.onError);
(_b = this.mediaMixingDesigner) === null || _b === void 0 ? void 0 : _b.off('onSourceSelected', this.onSourceSelected);
(_c = this.mediaMixingDesigner) === null || _c === void 0 ? void 0 : _c.off('onSourceMoved', this.onSourceMoved);
(_d = this.mediaMixingDesigner) === null || _d === void 0 ? void 0 : _d.off('onSourceResized', this.onSourceResized);
(_e = this.mediaMixingDesigner) === null || _e === void 0 ? void 0 : _e.off('onRightButtonClicked', this.onRightButtonClicked);
}
onError(errorCode, errorMessage) {
logger_1.default.log(`${this.logPrefix}onError:`, errorCode, errorMessage);
}
onSourceSelected(media) {
var _a;
logger_1.default.log(`${this.logPrefix}onSourceSelected:`, media);
if (media === null || media === void 0 ? void 0 : media.origin) {
this.updateMediaSource(Object.assign(Object.assign({}, media.origin), { isSelected: true }));
}
else {
const selected = this.sourceList.find(item => item.isSelected);
if (selected) {
this.updateMediaSource(Object.assign(Object.assign({}, selected), { isSelected: false }));
}
}
(_a = this.eventEmitter) === null || _a === void 0 ? void 0 : _a.emit('onSourceSelected', media ? media.origin : null);
}
onSourceMoved(media, rect) {
var _a;
logger_1.default.log(`${this.logPrefix}onSourceMoved:`, media, rect);
if (media === null || media === void 0 ? void 0 : media.origin) {
this.updateMediaSource(Object.assign(Object.assign({}, media.origin), { rect }));
}
(_a = this.eventEmitter) === null || _a === void 0 ? void 0 : _a.emit('onSourceMoved', media.origin, rect);
}
onSourceResized(media, rect) {
var _a;
logger_1.default.log(`${this.logPrefix}onSourceResized:`, media, rect);
if (media === null || media === void 0 ? void 0 : media.origin) {
this.updateMediaSource(Object.assign(Object.assign({}, media.origin), { rect }));
}
(_a = this.eventEmitter) === null || _a === void 0 ? void 0 : _a.emit('onSourceResized', media.origin, rect);
}
onRightButtonClicked(media) {
var _a;
logger_1.default.log(`${this.logPrefix}onRightButtonClicked:`, media);
(_a = this.eventEmitter) === null || _a === void 0 ? void 0 : _a.emit('onRightButtonClicked', media.origin);
}
isSameMediaSource(mediaSource1, mediaSource2) {
return mediaSource1.sourceId === mediaSource2.sourceId && mediaSource1.sourceType === mediaSource2.sourceType;
}
isMediaSourceExisted(mediaSource) {
return this.sourceList.some(item => this.isSameMediaSource(item, mediaSource));
}
findMediaSourceIndex(mediaSource) {
return this.sourceList.findIndex(item => item.sourceId === mediaSource.sourceId && item.sourceType === mediaSource.sourceType);
}
findSelectedMediaSource() {
let index = -1;
const length = this.sourceList.length;
for (let i = 0; i < length; i++) {
if (this.sourceList[i].isSelected) {
index = i;
break;
}
}
return index;
}
unselectMediaSource(index) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
this.sourceList[index].isSelected = false;
yield this.nodeMediaMixingPlugin.updateMediaSource(this.sourceList[index]);
(_a = this.mediaMixingDesigner) === null || _a === void 0 ? void 0 : _a.updateMedia({
id: `${this.sourceList[index].sourceType}__${this.sourceList[index].sourceId}`,
rect: this.sourceList[index].rect,
isSelected: this.sourceList[index].isSelected || false,
origin: (0, utils_1.safelyParse)(JSON.stringify(this.sourceList[index]))
});
});
}
// ****** 这一部分接口暴露不合理,暂时不对暴露在 API 文档上 **************/
startCameraDeviceTest(windowID, rect) {
var _a;
return ((_a = this.deviceManager) === null || _a === void 0 ? void 0 : _a.startCameraDeviceTest(windowID, rect)) || Promise.reject();
}
stopCameraDeviceTest() {
var _a;
return ((_a = this.deviceManager) === null || _a === void 0 ? void 0 : _a.stopCameraDeviceTest()) || Promise.reject();
}
setCameraTestRenderMirror(mirror) {
var _a;
(_a = this.deviceManager) === null || _a === void 0 ? void 0 : _a.setCameraTestRenderMirror(mirror);
}
setCameraTestDeviceId(cameraId) {
var _a;
(_a = this.deviceManager) === null || _a === void 0 ? void 0 : _a.setCameraTestDeviceId(cameraId);
}
setCameraTestResolution(width, height) {
var _a;
(_a = this.deviceManager) === null || _a === void 0 ? void 0 : _a.setCameraTestResolution(width, height);
}
setCameraTestVideoPluginPath(path) {
var _a;
(_a = this.deviceManager) === null || _a === void 0 ? void 0 : _a.setCameraTestVideoPluginPath(path);
}
setCameraTestVideoPluginParameter(params) {
var _a;
(_a = this.deviceManager) === null || _a === void 0 ? void 0 : _a.setCameraTestVideoPluginParameter(params);
}
}
exports.TRTCMediaMixingManager = TRTCMediaMixingManager;
exports.default = TRTCMediaMixingManager;