UNPKG

@tencentcloud/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,

54 lines (53 loc) 1.58 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const index = require("../locales/index.js"); const index$1 = require("../components/common/base/MessageBox/index.js"); const Vue = require("vue"); const mediaAbility = require("../utils/mediaAbility.js"); const RTCDetect = require("rtc-detect"); const isSupportTRTC = Vue.ref(true); const detect = new RTCDetect(); detect.isTRTCSupported().then((res) => { isSupportTRTC.value = !!(res == null ? void 0 : res.result); }); function useTRTCDetect() { const { t } = index.useI18n(); async function rtcDetect() { if (!mediaAbility.isGetUserMediaSupported) { index$1.default({ title: t("Note"), message: t( "The current browser does not support capturing audio and video" ), confirmButtonText: t("Sure") }); return; } if (!mediaAbility.isEnumerateDevicesSupported) { index$1.default({ title: t("Note"), message: t( "The current browser does not support getting microphone and camera list" ), confirmButtonText: t("Sure") }); return; } if (!isSupportTRTC.value) { index$1.default({ title: t("Note"), message: t( "The current browser does not support audio and video communication capabilities" ), confirmButtonText: t("Sure") }); } } Vue.onBeforeMount(() => { rtcDetect(); }); return { isSupportTRTC }; } exports.default = useTRTCDetect;