UNPKG

roomkit-web-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,

104 lines (103 loc) 4.12 kB
import { defineComponent, ref, onMounted, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, normalizeClass, createVNode, toDisplayString, unref, withCtx, createTextVNode } from "vue"; import SvgIcon from "../../../common/base/SvgIcon.vue.mjs"; import ScreenSharingIcon from "../../../common/icons/ScreenSharingIcon.vue.mjs"; import { TUIButton } from "@tencentcloud/uikit-base-component-vue3"; import Dialog from "../../../common/base/Dialog/index.mjs"; import bus from "../../../../hooks/useMitt.mjs"; import { useI18n } from "../../../../locales/index.mjs"; const _hoisted_1 = { class: "local-screen-info" }; const _hoisted_2 = { class: "text" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", setup(__props) { const { t } = useI18n(); const showStopShareRegion = ref(false); const localScreenContainerRef = ref(); const isMiniRegion = ref(false); function openStopConfirmDialog() { showStopShareRegion.value = true; } function stopScreenSharing() { showStopShareRegion.value = false; bus.emit("ScreenShare:stopScreenShare"); } const resizeObserver = new ResizeObserver(() => { var _a; isMiniRegion.value = ((_a = localScreenContainerRef.value) == null ? void 0 : _a.offsetHeight) <= 200; }); onMounted(() => { resizeObserver.observe(localScreenContainerRef.value); }); onBeforeUnmount(() => { resizeObserver.unobserve(localScreenContainerRef.value); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: "local-screen-container", ref_key: "localScreenContainerRef", ref: localScreenContainerRef }, [ createElementVNode("div", { class: normalizeClass(["local-screen-control-container", { mini: isMiniRegion.value }]) }, [ createElementVNode("div", _hoisted_1, [ createVNode(SvgIcon, { icon: ScreenSharingIcon }), createElementVNode("span", _hoisted_2, toDisplayString(unref(t)("You are sharing the screen...")), 1) ]), createVNode(unref(TUIButton), { color: "red", onClick: openStopConfirmDialog, type: "primary" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(t)("End sharing")), 1) ]), _: 1 }), createVNode(unref(Dialog), { modelValue: showStopShareRegion.value, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => showStopShareRegion.value = $event), width: "420px", title: unref(t)("End sharing"), modal: true, "close-on-click-modal": true, "append-to-room-container": true }, { footer: withCtx(() => [ createElementVNode("span", null, [ createVNode(unref(TUIButton), { onClick: stopScreenSharing, type: "primary", style: { "min-width": "88px" } }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(t)("End sharing")), 1) ]), _: 1 }), createVNode(unref(TUIButton), { onClick: _cache[0] || (_cache[0] = ($event) => showStopShareRegion.value = false), style: { "min-width": "88px" } }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(t)("Cancel")), 1) ]), _: 1 }) ]) ]), default: withCtx(() => [ createElementVNode("span", null, toDisplayString(unref(t)( "Others will no longer see your screen after you stop sharing. Are you sure you want to stop?" )), 1) ]), _: 1 }, 8, ["modelValue", "title"]) ], 2) ], 512); }; } }); export { _sfc_main as default };