From 23cf859377b8138548493bead0d546843ca8bbc9 Mon Sep 17 00:00:00 2001 From: haozq <1611483981@qq.com> Date: Tue, 18 Jun 2024 10:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E6=9D=A1?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/pages/video/video.js | 4 +++- js/pages/video/videoAjax.js | 35 ++++++++++++++++++---------------- js/pages/video/videoConnect.js | 21 +++++++++----------- pages/index/index.html | 14 +++++++++----- pages/video/video.html | 13 +++++++------ 5 files changed, 47 insertions(+), 40 deletions(-) diff --git a/js/pages/video/video.js b/js/pages/video/video.js index 0732c3a..e61a7c9 100644 --- a/js/pages/video/video.js +++ b/js/pages/video/video.js @@ -115,7 +115,9 @@ function getWindBox(){ } if(playList.length>nowDmoScree){ console.log(playList[0].windBox) - destoryVideo(playList[0].flvPlayer) + if(playList[0].flvPlayer){ + destoryVideo(playList[0].flvPlayer) + } playList.pop(); } let obj=playList[0] diff --git a/js/pages/video/videoAjax.js b/js/pages/video/videoAjax.js index 529a74b..4cd9b79 100644 --- a/js/pages/video/videoAjax.js +++ b/js/pages/video/videoAjax.js @@ -70,8 +70,8 @@ function oneVideo(that){ }) $(that).addClass('checkBtn'); for (let i = 2; i < 5; i++) { - document.getElementById("windowbox" + i).style.cssText = "width: 48.5%;height: 48.8%;"; - document.getElementById("videoPlayer"+i).style.cssText = "width: 100%;height: 100%;"; + document.getElementById("windowbox" + i).style.cssText = "width: 48.5%;height: 45.8%;"; + document.getElementById("videoPlayer"+i).style.cssText = "width: 100%;height: 90%;"; $('.video'+i+'-dimensions').css("width", "100%"); $('.video'+i+'-dimensions').css("height", "100%"); document.getElementById("windowbox" + i).style.display = "none"; @@ -81,7 +81,9 @@ function oneVideo(that){ nowDmoScree=1; while (playList.length > nowDmoScree) { console.log(playList[0].windBox) - destoryVideo(playList[0].flvPlayer); + if(playList[0].flvPlayer){ + destoryVideo(playList[0].flvPlayer); + } playList.pop(); } //播放 @@ -101,7 +103,7 @@ function fourVideo(that){ }) $(that).addClass('checkBtn'); for (let i = 1; i < 5; i++) { - document.getElementById("windowbox" + i).style.cssText = "width: 48.5%;height: 48.8%;"; + document.getElementById("windowbox" + i).style.cssText = "width: 48.5%;height: 46.8%;"; document.getElementById("videoPlayer"+i).style.cssText = "width: 100%;height: 100%;"; $('.video'+i+'-dimensions').css("width", "100%"); $('.video'+i+'-dimensions').css("height", "100%"); @@ -109,20 +111,19 @@ function fourVideo(that){ } nowDmoScree=4; - //console.log(nowDmoScree); - // if(playList.length>nowDmoScree){ - // playList=playList.slice(-nowDmoScree); - // } + console.log(playList) while (playList.length > nowDmoScree) { console.log(playList[0].windBox) - destoryVideo(playList[0].flvPlayer); + if(playList[0].flvPlayer){ + destoryVideo(playList[0].flvPlayer); + } playList.pop(); } - - for (let i = 0; i nowDmoScree){ - playList=playList.slice(-nowDmoScree); + + while (playList.length > nowDmoScree) { + destoryVideo(playList[0].flvPlayer); + playList.pop(); } console.log(playList) for (let i = 0; i 媒体类型 flv 或 mp4,m3u8 isLive: true, // => 是否为直播流 hasAudio: false, // => 是否开启声音 @@ -95,19 +92,19 @@ function QXPlayVideo(puId, idx, dom) { stashInitialSize: 128, // 减少首桢显示等待时长 statisticsInfoReportInterval: 600 }); - flvPlayer.attachMediaElement(videoElement); - flvPlayer.load(); + myPlayer.attachMediaElement(videoElement); + myPlayer.load(); //init3D(); - flvPlayer.on(flvjs.Events.ERROR, (errorType, errorDetail, errorInfo) => { - if (flvPlayer) { - destoryVideo(flvPlayer); + myPlayer.on(flvjs.Events.ERROR, (errorType, errorDetail, errorInfo) => { + if (myPlayer) { + destoryVideo(myPlayer); videoObject.playState = false; } }); setTimeout(function () { - flvPlayer.play(); + myPlayer.play(); }, 200); // flvPlayer.on(flvjs.Events.SCRIPTDATA_ARRIVED, (errorType, errorDetail, errorInfo) => { // if (flvPlayer) { @@ -130,7 +127,7 @@ function QXPlayVideo(puId, idx, dom) { } - return flvPlayer; + return myPlayer; } } function init3D() { diff --git a/pages/index/index.html b/pages/index/index.html index 37eb0f0..31ad739 100644 --- a/pages/index/index.html +++ b/pages/index/index.html @@ -67,9 +67,9 @@
- - - + + + @@ -79,7 +79,9 @@ - + @@ -87,7 +89,9 @@ - + diff --git a/pages/video/video.html b/pages/video/video.html index 2cdc04b..fbb8150 100644 --- a/pages/video/video.html +++ b/pages/video/video.html @@ -110,12 +110,9 @@
-
-
- - -
-
+
+ +
+
+ + +
周风险
名称/风险等级 二级总数
周风险          本周风险            + (2024-06-17~2024-06-23) + 0 0 00
站班会         当日站班会            + (2024-06-18) + 0 0 0