From 0d3af1e3612bf691d11ecaf8b013638808a73d7f Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 29 十月 2024 14:37:08 +0800 Subject: [PATCH] 会议列表状态样式优化 --- src/views/meet/index.vue | 79 +++++++++++++++++++++++++++++++-------- 1 files changed, 63 insertions(+), 16 deletions(-) diff --git a/src/views/meet/index.vue b/src/views/meet/index.vue index 7f9d13d..14a0d0a 100644 --- a/src/views/meet/index.vue +++ b/src/views/meet/index.vue @@ -5,18 +5,23 @@ </template> <script setup> -import {ref, onMounted} from 'vue'; +import {ref, watch, onMounted} from 'vue'; import {useRoute} from 'vue-router'; +import useWebScoket from "@/hooks/useWebScoket.js"; +import {storeToRefs} from 'pinia'; +import {useUserStore} from '@/store/index.js'; const route = useRoute(); const meet = ref(null); +const userStore = useUserStore(); +const {userInfo} = storeToRefs(userStore); const {meetName, id, userName, userCode} = route.query; let jitsiApi = null; onMounted(() => { const width = window.innerWidth; const height = window.innerHeight; - const domain = 'ycl.easyblog.vip:8443/' + id; + const domain = 'www.kgmeet.com:8443/' + id; const options = { roomName: meetName, width: width, @@ -31,6 +36,26 @@ gravatar: { disabled: true }, + // 鎺у埗椤堕儴鏍囬浼氳淇℃伅鏍囩鐨勫彲瑙佹�у拰琛屼负銆� + // 濡傛灉鏍囩鐨� ID 涓嶅湪涓婅堪涓や釜鏁扮粍涓殑浠讳綍涓�涓腑锛屽垯瀹冨湪鏍囬涓婃牴鏈笉鍙銆� + conferenceInfo: { + // 杩欎簺鏍囩涓嶄細涓庡伐鍏风涓�璧烽殣钘忋�� + alwaysVisible: ['recording'], + // 杩欎簺鏍囩灏嗕笌宸ュ叿绠辨寜閽竴璧疯嚜鍔ㄩ殣钘忋�� + autoHide: [ + // 'raised-hands-count', + 'subject', + 'conference-timer', + 'participants-count', + 'e2ee', + 'video-quality', + 'insecure-room', + 'highlight-moment', + 'top-panel-toggle', + ] + }, + ModeratorIndicator: true, + startSilent: false, //绂佺敤鏀瑰悕 readOnlyName: true, //鍙備細鑰呭悕鍗� @@ -41,34 +66,23 @@ disabledDemote: false }, // 鑷畾涔夋寜閽� - // 鑷畾涔夋寜閽� toolbarButtons: [ // 鎽勫儚澶� 'camera', // 鑱婂ぉ 'chat', - // 'closedcaptions', // 鍏变韩 'desktop', 'download', - // 'embedmeeting', - // 'etherpad', - // 'feedback', - // 'filmstrip', 'fullscreen', 'hangup', - // 'help', 'highlight', - // 'invite', 'linktosalesforce', 'livestreaming', 'microphone', 'noisesuppression', - // 'participants-pane', - // 'profile', - // 'raisehand', + 'raisehand', 'recording', - // 'security', 'select-background', 'settings', 'shareaudio', @@ -77,13 +91,23 @@ 'stats', 'tileview', 'toggle-camera', - // 'videoquality', + // 'closedcaptions', + // 'embedmeeting', + // 'etherpad', + // 'feedback', + // 'filmstrip', + // 'help', + // 'invite', + // 'participants-pane', + // 'profile', + // 'security', + 'videoquality', 'whiteboard' ], // 绂佺敤閭�璇� disableInviteFunctions: true, //绂佺敤鍏ㄩ儴闈欓煶 - disableRemoteMute: true, + disableRemoteMute: false, //涓绘寔浜洪�夐」 participantsPane: { enabled: false, @@ -105,6 +129,8 @@ jitsiApi = new JitsiMeetExternalAPI(domain, options); jitsiInit(); + // 杩炴帴webscoket + connect(); }); const jitsiInit = () => { @@ -113,6 +139,27 @@ }); } +const {status, message, error, connect, disconnect, sendMessage} = useWebScoket({ + url: 'wss://www.kgmeet.com:18443/websocket/' + userInfo._rawValue.id, + heartBeatData: 'ping' +}); + +watch( + () => message.value, + (msg) => { + console.log('msg', msg.commend); + if (msg.commend === 'kickOut') { + jitsiApi.executeCommand('hangup'); + } + if (msg.commend === 'mute') { + jitsiApi.executeCommand('toggleAudio'); + } + if (msg.commend === 'openCamera') { + jitsiApi.executeCommand('toggleVideo'); + } + } +); + </script> -- Gitblit v1.8.0