diff --git a/src/views/kc/jiaoshi/index.vue b/src/views/kc/jiaoshi/index.vue index 5b1db0e..a13560c 100644 --- a/src/views/kc/jiaoshi/index.vue +++ b/src/views/kc/jiaoshi/index.vue @@ -105,7 +105,7 @@ const videoOption = reactive({ muted: true, //静音 playsinline: true, webFullScreen: false, - speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速 + // speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速 autoPlay: false, //自动播放 loop: false, //循环播放 mirror: false, //镜像画面 @@ -174,11 +174,8 @@ function playerVideo(item){ //rtsp://admin:admin@10.250.116.235:8554/live console.log('bVideoRefs ->',bVideoRefs,Object.values(bVideoRefs.value)); - (Object.values(bVideoRefs.value)).forEach((x: any) => { - - console.log(`🚀 ----------------------------------------------🚀`); - console.log(`🚀 ~ file: index.vue:148 ~ playerVideo ~ x:`, x); - console.log(`🚀 ----------------------------------------------🚀`); + (Object.keys(bVideoRefs.value)).forEach((key) => { + console.log(`🚀 ~ file: index.vue:180 ~ key:`, key) // 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'); @@ -186,12 +183,29 @@ function playerVideo(item){ // 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 == '卓智'){ - x.connectFn(`rtsp://${x.ip}/live`,'external') + let videoRef = bVideoRefs.value[key]; + console.log(`🚀 ~ file: index.vue:187 ~ videoRef:`, videoRef) + + let childItem = currentItem.value.child[key]; + console.log(`🚀 ~ file: index.vue:189 ~ childItem:`, childItem) + if(!childItem){ + console.log('无法找到视频链接对象,currentItem.value.child[key] ->',currentItem,key); + return; } + if(childItem.changshang == '奥威亚'){ + videoRef.connectFn(`rtsp://${childItem.ip}/stream/0?config.login=web`,'external') + }else if(childItem.changshang == '卓智'){ + videoRef.connectFn(`rtsp://${childItem.ip}/live`,'external') + }else{ + videoRef.connectFn(`rtsp://${childItem.ip}/stream/0?config.login=web`,'external') + } + }); + + // (Object.values(bVideoRefs.value)).forEach((videoRef: any) => { + + // console.log(`🚀 ~ file: index.vue:148 ~ playerVideo ~ videoRef:`, videoRef); + // }); setTimeout(() => { switchVideoToMain(); },1000); @@ -211,11 +225,7 @@ function calcOtherVideo() :any{ } function switchVideoToMain(){ - - console.log(`🚀 ------------------------------------------------------------------------------------🚀`); - console.log(`🚀 ~ file: index.vue:188 ~ switchVideoToMain ~ switchVideoToMain:`); - console.log(`🚀 ------------------------------------------------------------------------------------🚀`); - + console.log(`🚀 ~ file: index.vue:188 ~ switchVideoToMain ~ switchVideoToMain: 自动切换第一个子界面到主界面`); nextTick(() => { let mainVideo = document.querySelector('#mainVideo'); let firstVideo = document.querySelector('.videoMax video'); @@ -225,6 +235,7 @@ function switchVideoToMain(){ } function bVideoClick(e){ + console.log(`bVideoClick: 切换至主界面`); let mainVideo = document.querySelector('#mainVideo'); let currentVideo = e.srcElement; mainVideo.srcObject = currentVideo.srcObject diff --git a/src/views/site/common/webRTC/video.vue b/src/views/site/common/webRTC/video.vue index d6d87b0..3c778fe 100644 --- a/src/views/site/common/webRTC/video.vue +++ b/src/views/site/common/webRTC/video.vue @@ -47,6 +47,7 @@ nextTick(() => { onMounted(() => { + console.log('连接流!入口'); webRtcServer.value = initWebRtcStreamer(props.videoKey); }) @@ -54,16 +55,19 @@ function getVideo(){ return document.querySelector('#'+props.videoKey) } function initWebRtcStreamerFn(){ + console.log('连接流!'); webRtcServer.value = initWebRtcStreamer(props.videoKey); return webRtcServer.value; } function closeWebRtcStreamerFn(){ + console.log('关闭流!'); closeWebRtcStreamer(webRtcServer.value); webRtcServer.value = null } function connectFn(url:string,type?){ + console.log(`🚀 ~ file: video.vue:67 ~ connectFn ~ url:`, url) // let _path = `rtsp://${url}/stream/0?config.login=web`; // if(type == 'external'){ // }