@tencentcloud/roomkit-electron-vue3
Version:
<h1 align="center"> TUIRoomKit</h1> Conference (TUIRoomKit) is a product suitable for multi-person audio and video conversation scenarios such as business meetings, webinars, and online education. By integrating this product, you can add room management,
62 lines (61 loc) • 2.21 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const environment = require("../../utils/environment.js");
const room = require("../../constants/room.js");
class BasicBeauty {
constructor(service) {
__publicField(this, "service");
__publicField(this, "basicBeautyPluginReady", false);
__publicField(this, "handleUnmount", async () => {
await this.setBasicBeauty(room.TRTCBeautyStyle.TRTCBeautyStyleNature, 0, 0, 0);
await this.setTestBasicBeauty(
room.TRTCBeautyStyle.TRTCBeautyStyleNature,
0,
0,
0
);
});
this.service = service;
if (environment.isElectron || environment.isWeChat) return;
this.bindEvent();
}
dispose() {
this.service.lifeCycleManager.off("unmount", this.handleUnmount);
}
async initBasicBeauty() {
var _a;
if (!this.basicBeautyPluginReady && ((_a = this.trtcCloud) == null ? void 0 : _a.useBeautyStyle)) {
await this.trtcCloud.useBeautyStyle();
this.basicBeautyPluginReady = true;
}
}
async setBasicBeauty(style, beautyLevel, whitenessLevel, ruddinessLevel) {
await this.initBasicBeauty();
await this.trtcCloud.setBeautyStyle(
style,
beautyLevel,
whitenessLevel,
ruddinessLevel
);
}
async setTestBasicBeauty(style, beautyLevel, whitenessLevel, ruddinessLevel) {
await this.initBasicBeauty();
await this.trtcCloud.callExperimentalAPI(
JSON.stringify({
api: "enableTestBeautyStyle",
params: { style, beautyLevel, whitenessLevel, ruddinessLevel }
})
);
}
get trtcCloud() {
var _a, _b;
return (_b = (_a = this.service.roomEngine) == null ? void 0 : _a.instance) == null ? void 0 : _b.getTRTCCloud();
}
bindEvent() {
this.service.lifeCycleManager.on("unmount", this.handleUnmount);
}
}
exports.BasicBeauty = BasicBeauty;