@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,
59 lines (58 loc) • 2.44 kB
JavaScript
import { defineComponent, computed, watch, createBlock, openBlock, unref, isRef, withCtx, createElementBlock, Fragment, renderList } from "vue";
import { useI18n } from "../../locales/index.mjs";
import TuiSelect from "./base/Select/index.vue.mjs";
import TuiOption from "./base/Option/index.vue.mjs";
import TUIRoomEngine__default, { TUIVideoQuality } from "@tencentcloud/tuiroom-engine-electron";
import { useRoomStore } from "../../stores/room.mjs";
import useGetRoomEngine from "../../hooks/useRoomEngine.mjs";
import { storeToRefs } from "pinia";
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "VideoProfile",
setup(__props) {
const roomEngine = useGetRoomEngine();
const roomStore = useRoomStore();
const { localVideoQuality } = storeToRefs(roomStore);
const { t } = useI18n();
const videoProfileList = computed(() => [
{ label: t("Low Definition"), value: TUIVideoQuality.kVideoQuality_360p },
{
label: t("Standard Definition"),
value: TUIVideoQuality.kVideoQuality_540p
},
{ label: t("High Definition"), value: TUIVideoQuality.kVideoQuality_720p },
{ label: t("Super Definition"), value: TUIVideoQuality.kVideoQuality_1080p }
]);
watch(localVideoQuality, (val) => {
var _a;
(_a = roomEngine.instance) == null ? void 0 : _a.updateVideoQuality({ quality: val });
});
TUIRoomEngine__default.once("ready", () => {
var _a;
(_a = roomEngine.instance) == null ? void 0 : _a.updateVideoQuality({ quality: localVideoQuality.value });
});
return (_ctx, _cache) => {
return openBlock(), createBlock(TuiSelect, {
modelValue: unref(localVideoQuality),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localVideoQuality) ? localVideoQuality.value = $event : null),
placeholder: "placeholder",
class: "select",
teleported: false,
"popper-append-to-body": false
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(Fragment, null, renderList(videoProfileList.value, (item, index) => {
return openBlock(), createBlock(TuiOption, {
key: index,
label: item.label,
value: item.value
}, null, 8, ["label", "value"]);
}), 128))
]),
_: 1
}, 8, ["modelValue"]);
};
}
});
export {
_sfc_main as default
};