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,
48 lines (47 loc) • 1.96 kB
JavaScript
import { defineComponent, onMounted, onUnmounted, openBlock, createElementBlock, createElementVNode, unref, toDisplayString, createCommentVNode, createBlock } from "vue";
import LoadingIcon from "../../../components/common/icons/LoadingIcon.vue.mjs";
import SvgIcon from "../../../components/common/base/SvgIcon.vue.mjs";
import "../../hooks/useAudioDeviceState/index.mjs";
import { useVideoDeviceState } from "../../hooks/useVideoDeviceState/index.mjs";
import { useI18n } from "../../../locales/index.mjs";
import TUIRoomEngine__default from "@tencentcloud/tuiroom-engine-js";
const _hoisted_1 = { class: "video-preview-container" };
const _hoisted_2 = { class: "attention-info" };
const _hoisted_3 = {
key: 0,
class: "off-camera-info"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "VideoPreview",
setup(__props) {
const { t } = useI18n();
const { isCameraTesting, isCameraTestLoading, camera } = useVideoDeviceState();
onMounted(async () => {
TUIRoomEngine__default.once("ready", () => {
camera.startCameraDeviceTest({ view: "video-preview" });
});
});
onUnmounted(async () => {
await camera.stopCameraDeviceTest();
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
_cache[0] || (_cache[0] = createElementVNode("div", {
id: "video-preview",
class: "video-preview"
}, null, -1)),
createElementVNode("div", _hoisted_2, [
!unref(isCameraTesting) && !unref(isCameraTestLoading) ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(unref(t)("Off Camera")), 1)) : createCommentVNode("", true),
unref(isCameraTestLoading) ? (openBlock(), createBlock(SvgIcon, {
key: 1,
icon: LoadingIcon,
class: "loading"
})) : createCommentVNode("", true)
])
]);
};
}
});
export {
_sfc_main as default
};