diff --git a/src/components/Consultation/components/meetingView.vue b/src/components/Consultation/components/meetingView.vue index aae89c7..869b0ac 100644 --- a/src/components/Consultation/components/meetingView.vue +++ b/src/components/Consultation/components/meetingView.vue @@ -172,6 +172,10 @@ + + + + @@ -729,6 +733,22 @@ const setAudio = (stream) => { }; }); }; + const isFullscreen = ref(false); + const onFullscreenChange = () => { + isFullscreen.value = !!document.fullscreenElement; + }; + const toggleFullscreen = () => { + const el = mainContentRef.value; + if (!document.fullscreenElement) { + if (el && el.requestFullscreen) { + el.requestFullscreen(); + } + } else { + if (document.exitFullscreen) { + document.exitFullscreen(); + } + } + }; // 设备列表变化时 const onDeviceListChange = (mediaDeviceInfo) => { @@ -771,6 +791,7 @@ onMounted(()=>{ // 初始化录屏媒体对象 addVideoOnLoadedMetadataEvnt(); + document.addEventListener('fullscreenchange', onFullscreenChange); }); @@ -778,6 +799,7 @@ onUnmounted(() => { emitter.off('onMediaStream'); emitter.off('onHangup'); removeBroadcastVideoListener(); + document.removeEventListener('fullscreenchange', onFullscreenChange); });