From fff7d41efa7d1624185f1078f65218982aa03bff Mon Sep 17 00:00:00 2001 From: bai <1643359946@qq.com> Date: Sat, 22 Apr 2023 15:54:58 +0800 Subject: [PATCH] =?UTF-8?q?2023=E5=B9=B44=E6=9C=8822=E6=97=A5=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=92=AD=E6=94=BE=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/kc/jiaoshi/index.vue | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/views/kc/jiaoshi/index.vue b/src/views/kc/jiaoshi/index.vue index 5b1db0e..2d81131 100644 --- a/src/views/kc/jiaoshi/index.vue +++ b/src/views/kc/jiaoshi/index.vue @@ -36,9 +36,9 @@
- - - + + +
@@ -95,6 +95,7 @@ const _document = window.document; const leftList = ref([]); const currentItem = ref({}); const topWidth = ref('0'); +const mainVideoCardBoxTitle = ref(''); const videoOption = reactive({ // width: '800', //播放器高度 @@ -180,12 +181,12 @@ function playerVideo(item){ console.log(`🚀 ~ file: index.vue:148 ~ playerVideo ~ x:`, x); console.log(`🚀 ----------------------------------------------🚀`); // x.connectFn('rtsp://admin:admin@10.250.116.235:8554/live','external') - // if(Number(Number(Math.random()).toFixed(1))*10 >= 5){ - // x.connectFn('rtsp://127.0.0.1:8554/video','external'); - // }else{ - // x.connectFn(`rtsp://${x.ip}/live`,'external') - // } - // return; + if(Number(Number(Math.random()).toFixed(1))*10 >= 5){ + x.connectFn('rtsp://127.0.0.1:8554/video','external'); + }else{ + x.connectFn(`rtsp://${x.ip}/live`,'external') + } + return; if(x.changshang == '奥威亚'){ x.connectFn(`rtsp://${x.ip}/stream/0?config.login=web`,'external') }else if(x.changshang == '卓智'){ @@ -217,8 +218,14 @@ function switchVideoToMain(){ console.log(`🚀 ------------------------------------------------------------------------------------🚀`); nextTick(() => { + let firstBox = document.querySelector('.videoMax'); + let titleBox = firstBox?.querySelector('.ant-card-head-title'); + let title = titleBox?.textContent; + + mainVideoCardBoxTitle.value = title; + let mainVideo = document.querySelector('#mainVideo'); - let firstVideo = document.querySelector('.videoMax video'); + let firstVideo = firstBox.querySelector('video'); mainVideo.srcObject = firstVideo.srcObject mainVideo.play(); }); @@ -227,6 +234,13 @@ function switchVideoToMain(){ function bVideoClick(e){ let mainVideo = document.querySelector('#mainVideo'); let currentVideo = e.srcElement; + + let title = currentVideo?.parentElement?.parentElement?.querySelector('.ant-card-head-title')?.textContent + mainVideoCardBoxTitle.value = title; + console.log(`🚀 --------------------------------------------------------------------🚀`); + console.log(`🚀 ~ file: index.vue:238 ~ bVideoClick ~ currentVideo:`, currentVideo); + console.log(`🚀 --------------------------------------------------------------------🚀`); + mainVideo.srcObject = currentVideo.srcObject mainVideo.play(); }