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(); }