@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,
47 lines (46 loc) • 1.7 kB
JavaScript
import { defineComponent, ref, onMounted, createElementBlock, openBlock, createElementVNode, normalizeClass, toDisplayString } from "vue";
const _hoisted_1 = { class: "screen-window-previewer" };
const _hoisted_2 = ["width", "height", "data-id"];
const _hoisted_3 = { class: "previewer-name" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "ScreenWindowPreviewer",
props: {
data: {}
},
setup(__props) {
const { data } = __props;
const canvasRef = ref(null);
onMounted(() => {
var _a, _b, _c;
if (canvasRef.value) {
if (((_a = data.thumbBGRA) == null ? void 0 : _a.width) && ((_b = data.thumbBGRA) == null ? void 0 : _b.height) && ((_c = data.thumbBGRA) == null ? void 0 : _c.buffer)) {
const ctx = canvasRef.value.getContext("2d");
if (ctx !== null) {
const img = new ImageData(
new Uint8ClampedArray(data.thumbBGRA.buffer),
data.thumbBGRA.width,
data.thumbBGRA.height
);
ctx.putImageData(img, 0, 0);
}
}
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", _hoisted_1, [
createElementVNode("canvas", {
ref_key: "canvasRef",
ref: canvasRef,
class: normalizeClass([_ctx.data.isMinimizeWindow ? "previewer-mini" : "previewer-canvas"]),
width: _ctx.data.thumbBGRA.width,
height: _ctx.data.thumbBGRA.height,
"data-id": _ctx.data.sourceId
}, null, 10, _hoisted_2),
createElementVNode("div", _hoisted_3, toDisplayString(_ctx.data.sourceName), 1)
]);
};
}
});
export {
_sfc_main as default
};