UNPKG

@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,

79 lines (78 loc) 3.1 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const Vue = require("vue"); const IconButton = require("./base/IconButton.vue.js"); const index$1 = require("./base/MessageBox/index.js"); const SvgIcon = require("./base/SvgIcon.vue.js"); const CameraOnIcon = require("./icons/CameraOnIcon.vue.js"); const CameraOffIcon = require("./icons/CameraOffIcon.vue.js"); const VideoSettingTab = require("./VideoSettingTab.vue.js"); const index = require("../../locales/index.js"); const vClickOutside = require("../../directives/vClickOutside.js"); const mediaAbility = require("../../utils/mediaAbility.js"); const _hoisted_1 = { class: "video-control-container" }; const _sfc_main = /* @__PURE__ */ Vue.defineComponent({ __name: "VideoMediaControl", props: { hasMore: { type: Boolean, default: true }, isMuted: { type: Boolean, default: void 0 }, isDisabled: { type: Boolean, default: false } }, emits: ["click"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { t } = index.useI18n(); const showVideoSettingTab = Vue.ref(false); const isSupportVideoMedia = mediaAbility.isGetUserMediaSupported && mediaAbility.isEnumerateDevicesSupported; const icon = Vue.computed(() => props.isMuted ? CameraOffIcon.default : CameraOnIcon.default); async function handleClickIcon() { if (!isSupportVideoMedia) { index$1.default({ title: t("Note"), message: t("The current browser does not support capturing video"), confirmButtonText: t("Sure") }); return; } emits("click"); showVideoSettingTab.value = false; } function handleMore() { showVideoSettingTab.value = !showVideoSettingTab.value; } function handleHideVideoSettingTab() { if (showVideoSettingTab.value) { showVideoSettingTab.value = false; } } return (_ctx, _cache) => { return Vue.openBlock(), Vue.createElementBlock("div", null, [ Vue.withDirectives((Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [ Vue.createVNode(IconButton.default, { title: Vue.unref(t)("Camera"), "has-more": _ctx.hasMore, disabled: _ctx.isDisabled, "is-not-support": !Vue.unref(isSupportVideoMedia), onClickIcon: handleClickIcon, onClickMore: handleMore }, { default: Vue.withCtx(() => [ Vue.createVNode(SvgIcon.default, { icon: icon.value }, null, 8, ["icon"]) ]), _: 1 }, 8, ["title", "has-more", "disabled", "is-not-support"]), Vue.withDirectives(Vue.createVNode(VideoSettingTab.default, { class: "video-tab", "with-mirror": true }, null, 512), [ [Vue.vShow, showVideoSettingTab.value] ]) ])), [ [Vue.unref(vClickOutside.default), handleHideVideoSettingTab] ]) ]); }; } }); exports.default = _sfc_main;