修改默认条数

This commit is contained in:
haozq 2024-06-18 10:10:45 +08:00
parent 0e8cbe40a8
commit 23cf859377
5 changed files with 47 additions and 40 deletions

View File

@ -115,7 +115,9 @@ function getWindBox(){
} }
if(playList.length>nowDmoScree){ if(playList.length>nowDmoScree){
console.log(playList[0].windBox) console.log(playList[0].windBox)
destoryVideo(playList[0].flvPlayer) if(playList[0].flvPlayer){
destoryVideo(playList[0].flvPlayer)
}
playList.pop(); playList.pop();
} }
let obj=playList[0] let obj=playList[0]

View File

@ -70,8 +70,8 @@ function oneVideo(that){
}) })
$(that).addClass('checkBtn'); $(that).addClass('checkBtn');
for (let i = 2; i < 5; i++) { for (let i = 2; 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: 45.8%;";
document.getElementById("videoPlayer"+i).style.cssText = "width: 100%;height: 100%;"; document.getElementById("videoPlayer"+i).style.cssText = "width: 100%;height: 90%;";
$('.video'+i+'-dimensions').css("width", "100%"); $('.video'+i+'-dimensions').css("width", "100%");
$('.video'+i+'-dimensions').css("height", "100%"); $('.video'+i+'-dimensions').css("height", "100%");
document.getElementById("windowbox" + i).style.display = "none"; document.getElementById("windowbox" + i).style.display = "none";
@ -81,7 +81,9 @@ function oneVideo(that){
nowDmoScree=1; nowDmoScree=1;
while (playList.length > nowDmoScree) { while (playList.length > nowDmoScree) {
console.log(playList[0].windBox) console.log(playList[0].windBox)
destoryVideo(playList[0].flvPlayer); if(playList[0].flvPlayer){
destoryVideo(playList[0].flvPlayer);
}
playList.pop(); playList.pop();
} }
//播放 //播放
@ -101,7 +103,7 @@ function fourVideo(that){
}) })
$(that).addClass('checkBtn'); $(that).addClass('checkBtn');
for (let i = 1; i < 5; i++) { 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%;"; document.getElementById("videoPlayer"+i).style.cssText = "width: 100%;height: 100%;";
$('.video'+i+'-dimensions').css("width", "100%"); $('.video'+i+'-dimensions').css("width", "100%");
$('.video'+i+'-dimensions').css("height", "100%"); $('.video'+i+'-dimensions').css("height", "100%");
@ -109,20 +111,19 @@ function fourVideo(that){
} }
nowDmoScree=4; nowDmoScree=4;
//console.log(nowDmoScree); console.log(playList)
// if(playList.length>nowDmoScree){
// playList=playList.slice(-nowDmoScree);
// }
while (playList.length > nowDmoScree) { while (playList.length > nowDmoScree) {
console.log(playList[0].windBox) console.log(playList[0].windBox)
destoryVideo(playList[0].flvPlayer); if(playList[0].flvPlayer){
destoryVideo(playList[0].flvPlayer);
}
playList.pop(); playList.pop();
} }
playVideList();
for (let i = 0; i <playList.length ; i++) { // for (let i = 0; i <playList.length ; i++) {
QXPlayVideo(playList[i].puid, '0', playList[i].windBox); // QXPlayVideo(playList[i].puid, '0', playList[i].windBox);
playControl(); // playControl();
} // }
for (var i = 5; i <= 9; i++) { for (var i = 5; i <= 9; i++) {
document.getElementById("windowbox" + i).style.display = "none"; document.getElementById("windowbox" + i).style.display = "none";
} }
@ -132,8 +133,10 @@ function fourVideo(that){
function playVideList(){ function playVideList(){
console.log(playList) console.log(playList)
if(playList.length>nowDmoScree){
playList=playList.slice(-nowDmoScree); while (playList.length > nowDmoScree) {
destoryVideo(playList[0].flvPlayer);
playList.pop();
} }
console.log(playList) console.log(playList)
for (let i = 0; i <playList.length ; i++) { for (let i = 0; i <playList.length ; i++) {

View File

@ -74,15 +74,12 @@ function getQXConnect() {
* @param dom 窗口id * @param dom 窗口id
*/ */
function QXPlayVideo(puId, idx, dom) { function QXPlayVideo(puId, idx, dom) {
//播视频接口 let myPlayer=null;
console.log(flvPlayer);
console.log(dom);
// destoryVideo(flvPlayer);
let url = qxUrl + "stream.flv?puid=" + puId + "&idx=" + idx + "&stream=0&token=" + qxToken; let url = qxUrl + "stream.flv?puid=" + puId + "&idx=" + idx + "&stream=0&token=" + qxToken;
if (flvjs.isSupported()) { if (flvjs.isSupported()) {
let videoElement = document.getElementById(dom); let videoElement = document.getElementById(dom);
if (videoElement) { if (videoElement) {
flvPlayer = flvjs.createPlayer({ let myPlayer = flvjs.createPlayer({
type: 'flv', // => 媒体类型 flv 或 mp4m3u8 type: 'flv', // => 媒体类型 flv 或 mp4m3u8
isLive: true, // => 是否为直播流 isLive: true, // => 是否为直播流
hasAudio: false, // => 是否开启声音 hasAudio: false, // => 是否开启声音
@ -95,19 +92,19 @@ function QXPlayVideo(puId, idx, dom) {
stashInitialSize: 128, // 减少首桢显示等待时长 stashInitialSize: 128, // 减少首桢显示等待时长
statisticsInfoReportInterval: 600 statisticsInfoReportInterval: 600
}); });
flvPlayer.attachMediaElement(videoElement); myPlayer.attachMediaElement(videoElement);
flvPlayer.load(); myPlayer.load();
//init3D(); //init3D();
flvPlayer.on(flvjs.Events.ERROR, (errorType, errorDetail, errorInfo) => { myPlayer.on(flvjs.Events.ERROR, (errorType, errorDetail, errorInfo) => {
if (flvPlayer) { if (myPlayer) {
destoryVideo(flvPlayer); destoryVideo(myPlayer);
videoObject.playState = false; videoObject.playState = false;
} }
}); });
setTimeout(function () { setTimeout(function () {
flvPlayer.play(); myPlayer.play();
}, 200); }, 200);
// flvPlayer.on(flvjs.Events.SCRIPTDATA_ARRIVED, (errorType, errorDetail, errorInfo) => { // flvPlayer.on(flvjs.Events.SCRIPTDATA_ARRIVED, (errorType, errorDetail, errorInfo) => {
// if (flvPlayer) { // if (flvPlayer) {
@ -130,7 +127,7 @@ function QXPlayVideo(puId, idx, dom) {
} }
return flvPlayer; return myPlayer;
} }
} }
function init3D() { function init3D() {

View File

@ -67,9 +67,9 @@
</div> </div>
<div id="pro-risk"> <div id="pro-risk">
<table> <table>
<tr> <!-- <tr>-->
<td colspan="6" id="weekDate">周风险</td> <!-- <td colspan="6" id="weekDate">周风险</td>-->
</tr> <!-- </tr>-->
<tr> <tr>
<td>名称/风险等级</td> <td>名称/风险等级</td>
<td>二级</td> <td>二级</td>
@ -79,7 +79,9 @@
<td>总数</td> <td>总数</td>
</tr> </tr>
<tr> <tr>
<td>周风险</td> <td> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 本周风险 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2024-06-17~2024-06-23
</td>
<td id="twoRiskNum">0</td> <td id="twoRiskNum">0</td>
<td id="threeRiskNum">0</td> <td id="threeRiskNum">0</td>
<td id="fourRiskNum">0</td> <td id="fourRiskNum">0</td>
@ -87,7 +89,9 @@
<td id="totalRiskNum">0</td> <td id="totalRiskNum">0</td>
</tr> </tr>
<tr> <tr>
<td>站班会</td> <td> &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;当日站班会 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(2024-06-18)
</td>
<td id="twoClassNum">0</td> <td id="twoClassNum">0</td>
<td id="threeClassNum">0</td> <td id="threeClassNum">0</td>
<td id="fourClassNum">0</td> <td id="fourClassNum">0</td>

View File

@ -110,12 +110,9 @@
</div> </div>
<div id="center-box"> <div id="center-box">
<div id="video-box"> <div id="video-box">
<div id="balla" class="split split-horizontal"> <div id="balla" class="split split-horizontal" style="margin-top: 20px;">
<div style="margin-left: 46%;margin-top: 3%;" class="toggle-btn">
<button onclick="oneVideo(this)" class="checkBtn">1</button> <div class="layout" style="width: 100%;height: 95%;flex-wrap: wrap;">
<button onclick="fourVideo(this)" class="nocheckBtn">4</button>
</div>
<div class="layout" style="width: 100%;height: 93%;flex-wrap: wrap;">
<div id="windowbox1" class="ballsplit " ondblclick="ballScreenBig('1')" <div id="windowbox1" class="ballsplit " ondblclick="ballScreenBig('1')"
style="width: 100%;height: 100%; position: relative;z-index: 9999999999;pointer-events:auto;"> style="width: 100%;height: 100%; position: relative;z-index: 9999999999;pointer-events:auto;">
<video id="videoPlayer1" class="ball-content" autoplay="autoplay" loop="loop" muted <video id="videoPlayer1" class="ball-content" autoplay="autoplay" loop="loop" muted
@ -137,6 +134,10 @@
controls="controls"></video> controls="controls"></video>
</div> </div>
</div> </div>
<div style="margin-left: 46%;margin-top: -10px;" class="toggle-btn">
<button onclick="oneVideo(this)" class="checkBtn">1</button>
<button onclick="fourVideo(this)" class="nocheckBtn">4</button>
</div>
</div> </div>
</div> </div>
</div> </div>