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,
74 lines (73 loc) • 2.64 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const room_mic_on = require("../../assets/imgs/room_mic_on.png.js");
const room_mic_off = require("../../assets/imgs/room_mic_off.png.js");
const SvgIcon = require("./base/SvgIcon.vue.js");
const room = require("../../stores/room.js");
const pinia = require("pinia");
const utils = require("../../utils/utils.js");
const MicOnIcon = require("./icons/MicOnIcon.vue.js");
const MicOffIcon = require("./icons/MicOffIcon.vue.js");
const _hoisted_1 = { class: "audio-level-container" };
const _hoisted_2 = {
key: 0,
src: room_mic_on.default,
style: { "width": "24px", "height": "24px" }
};
const _hoisted_3 = {
key: 1,
src: room_mic_off.default,
style: { "width": "24px", "height": "24px" }
};
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
__name: "AudioIcon",
props: {
userId: {},
audioVolume: {},
isMuted: { type: Boolean },
size: {},
isDisabled: { type: Boolean }
},
setup(__props) {
const roomStore = room.useRoomStore();
const { userVolumeObj } = pinia.storeToRefs(roomStore);
const currentAudioVolume = Vue.computed(() => {
if (!utils.isUndefined(props.audioVolume)) {
return props.audioVolume;
}
if (userVolumeObj.value && props.userId) {
return userVolumeObj.value[props.userId];
}
return 0;
});
const props = __props;
Vue.computed(() => props.isMuted ? MicOffIcon.default : MicOnIcon.default);
const audioLevelStyle = Vue.computed(() => {
if (props.isMuted || !currentAudioVolume.value) {
return "";
}
return `height: ${currentAudioVolume.value * 4}%`;
});
return (_ctx, _cache) => {
return Vue.openBlock(), Vue.createElementBlock("div", {
class: Vue.normalizeClass(["audio-icon-container", `${_ctx.size == "small" && "small"}`])
}, [
Vue.createElementVNode("div", _hoisted_1, [
Vue.createElementVNode("div", {
class: "audio-level",
style: Vue.normalizeStyle(audioLevelStyle.value)
}, null, 4)
]),
Vue.createVNode(SvgIcon.default, { class: "audio-icon" }, {
default: Vue.withCtx(() => [
!_ctx.isMuted ? (Vue.openBlock(), Vue.createElementBlock("img", _hoisted_2)) : Vue.createCommentVNode("", true),
_ctx.isMuted ? (Vue.openBlock(), Vue.createElementBlock("img", _hoisted_3)) : Vue.createCommentVNode("", true)
]),
_: 1
})
], 2);
};
}
});
exports.default = _sfc_main;