@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,
114 lines (113 loc) • 5.18 kB
JavaScript
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const DeviceSelect = require("./DeviceSelect.vue.js");
const VideoProfile = require("./VideoProfile.vue.js");
const TuiSwitch = require("./base/TuiSwitch.vue.js");
const basic = require("../../stores/basic.js");
const index = require("../../locales/index.js");
const useRoomEngine = require("../../hooks/useRoomEngine.js");
const TUIRoomEngine = require("@tencentcloud/tuiroom-engine-electron");
const environment = require("../../utils/environment.js");
const pinia = require("pinia");
const _withScopeId = (n) => (Vue.pushScopeId("data-v-58833df9"), n = n(), Vue.popScopeId(), n);
const _hoisted_1 = { class: "video-tab" };
const _hoisted_2 = { class: "item-setting" };
const _hoisted_3 = { class: "title" };
const _hoisted_4 = {
key: 0,
class: "item-setting"
};
const _hoisted_5 = { class: "title" };
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ Vue.createElementVNode("div", { class: "video-preview-container" }, [
/* @__PURE__ */ Vue.createElementVNode("div", {
id: "test-camera-preview",
class: "video-preview"
})
], -1));
const _hoisted_7 = { class: "item-setting" };
const _hoisted_8 = { class: "title" };
const _hoisted_9 = { class: "mirror-container" };
const _hoisted_10 = {
key: 1,
class: "item-setting"
};
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
__name: "VideoSettingTab",
props: {
withPreview: { type: Boolean },
withMore: { type: Boolean },
withMirror: { type: Boolean },
theme: {}
},
setup(__props) {
const roomEngine = useRoomEngine.default();
const props = __props;
const basicStore = basic.useBasicStore();
const { isLocalStreamMirror } = pinia.storeToRefs(basicStore);
Vue.watch(isLocalStreamMirror, async (val) => {
var _a;
const trtcCloud = (_a = roomEngine.instance) == null ? void 0 : _a.getTRTCCloud();
if (!environment.isMobile) {
await (trtcCloud == null ? void 0 : trtcCloud.setLocalRenderParams({
mirrorType: val ? TUIRoomEngine.TRTCVideoMirrorType.TRTCVideoMirrorType_Enable : TUIRoomEngine.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable,
rotation: TUIRoomEngine.TRTCVideoRotation.TRTCVideoRotation0,
fillMode: TUIRoomEngine.TRTCVideoFillMode.TRTCVideoFillMode_Fill
}));
}
});
const { t } = index.useI18n();
function handleMoreCameraSetting() {
basicStore.setShowSettingDialog(true);
basicStore.setActiveSettingTab("video");
}
if (props.withPreview) {
Vue.onMounted(async () => {
var _a, _b;
(_a = roomEngine.instance) == null ? void 0 : _a.startCameraDeviceTest({ view: "test-camera-preview" });
if (environment.isElectron) {
const trtcCloud = (_b = roomEngine.instance) == null ? void 0 : _b.getTRTCCloud();
await (trtcCloud == null ? void 0 : trtcCloud.setLocalRenderParams({
mirrorType: isLocalStreamMirror.value ? TUIRoomEngine.TRTCVideoMirrorType.TRTCVideoMirrorType_Enable : TUIRoomEngine.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable,
rotation: TUIRoomEngine.TRTCVideoRotation.TRTCVideoRotation0,
fillMode: TUIRoomEngine.TRTCVideoFillMode.TRTCVideoFillMode_Fill
}));
}
});
Vue.onUnmounted(() => {
var _a;
(_a = roomEngine.instance) == null ? void 0 : _a.stopCameraDeviceTest();
});
}
return (_ctx, _cache) => {
return Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
Vue.createElementVNode("div", _hoisted_2, [
Vue.createElementVNode("span", _hoisted_3, Vue.toDisplayString(Vue.unref(t)("Camera")), 1),
Vue.createVNode(DeviceSelect.default, { "device-type": "camera" })
]),
_ctx.withPreview ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_4, [
Vue.createElementVNode("span", _hoisted_5, Vue.toDisplayString(Vue.unref(t)("Preview")), 1),
_hoisted_6
])) : Vue.createCommentVNode("", true),
Vue.createElementVNode("div", _hoisted_7, [
Vue.createElementVNode("span", _hoisted_8, Vue.toDisplayString(Vue.unref(t)("Resolution")), 1),
Vue.createVNode(VideoProfile.default)
]),
Vue.createElementVNode("div", _hoisted_9, [
Vue.createElementVNode("span", null, Vue.toDisplayString(Vue.unref(t)("Mirror")), 1),
Vue.createVNode(TuiSwitch.default, {
modelValue: Vue.unref(isLocalStreamMirror),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => Vue.isRef(isLocalStreamMirror) ? isLocalStreamMirror.value = $event : null)
}, null, 8, ["modelValue"])
]),
_ctx.withMore ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_10, [
Vue.createElementVNode("div", {
class: "item",
onClick: handleMoreCameraSetting
}, Vue.toDisplayString(Vue.unref(t)("More Camera Settings")), 1)
])) : Vue.createCommentVNode("", true)
]);
};
}
});
exports.default = _sfc_main;