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.38 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const SvgIcon = require("../../../common/base/SvgIcon.vue.js");
const ScreenSharingIcon = require("../../../common/icons/ScreenSharingIcon.vue.js");
const uikitBaseComponentVue3 = require("@tencentcloud/uikit-base-component-vue3");
const index$1 = require("../../../common/base/Dialog/index.js");
const useMitt = require("../../../../hooks/useMitt.js");
const index = require("../../../../locales/index.js");
const _hoisted_1 = { class: "local-screen-info" };
const _hoisted_2 = { class: "text" };
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
__name: "index",
setup(__props) {
const { t } = index.useI18n();
const showStopShareRegion = Vue.ref(false);
const localScreenContainerRef = Vue.ref();
const isMiniRegion = Vue.ref(false);
function openStopConfirmDialog() {
showStopShareRegion.value = true;
}
function stopScreenSharing() {
showStopShareRegion.value = false;
useMitt.default.emit("ScreenShare:stopScreenShare");
}
const resizeObserver = new ResizeObserver(() => {
var _a;
isMiniRegion.value = ((_a = localScreenContainerRef.value) == null ? void 0 : _a.offsetHeight) <= 200;
});
Vue.onMounted(() => {
resizeObserver.observe(localScreenContainerRef.value);
});
Vue.onBeforeUnmount(() => {
resizeObserver.unobserve(localScreenContainerRef.value);
});
return (_ctx, _cache) => {
return Vue.openBlock(), Vue.createElementBlock("div", {
class: "local-screen-container",
ref_key: "localScreenContainerRef",
ref: localScreenContainerRef
}, [
Vue.createElementVNode("div", {
class: Vue.normalizeClass(["local-screen-control-container", { mini: isMiniRegion.value }])
}, [
Vue.createElementVNode("div", _hoisted_1, [
Vue.createVNode(SvgIcon.default, { icon: ScreenSharingIcon.default }),
Vue.createElementVNode("span", _hoisted_2, Vue.toDisplayString(Vue.unref(t)("You are sharing the screen...")), 1)
]),
Vue.createVNode(Vue.unref(uikitBaseComponentVue3.TUIButton), {
color: "red",
onClick: openStopConfirmDialog,
type: "primary"
}, {
default: Vue.withCtx(() => [
Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("End sharing")), 1)
]),
_: 1
}),
Vue.createVNode(Vue.unref(index$1.default), {
modelValue: showStopShareRegion.value,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => showStopShareRegion.value = $event),
width: "420px",
title: Vue.unref(t)("End sharing"),
modal: true,
"close-on-click-modal": true,
"append-to-room-container": true
}, {
footer: Vue.withCtx(() => [
Vue.createElementVNode("span", null, [
Vue.createVNode(Vue.unref(uikitBaseComponentVue3.TUIButton), {
onClick: stopScreenSharing,
type: "primary",
style: { "min-width": "88px" }
}, {
default: Vue.withCtx(() => [
Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("End sharing")), 1)
]),
_: 1
}),
Vue.createVNode(Vue.unref(uikitBaseComponentVue3.TUIButton), {
onClick: _cache[0] || (_cache[0] = ($event) => showStopShareRegion.value = false),
style: { "min-width": "88px" }
}, {
default: Vue.withCtx(() => [
Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Cancel")), 1)
]),
_: 1
})
])
]),
default: Vue.withCtx(() => [
Vue.createElementVNode("span", null, Vue.toDisplayString(Vue.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);
};
}
});
exports.default = _sfc_main;