From 0ba2fe60ea27d849b4f1d1f9b98f7a7e91fe7615 Mon Sep 17 00:00:00 2001
From: haozq <1611483981@qq.com>
Date: Mon, 17 Jun 2024 21:36:39 +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 | 12 +++++++++++-
js/pages/video/videoAjax.js | 14 +++++++++++---
js/pages/video/videoConnect.js | 14 +++++++-------
3 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/js/pages/video/video.js b/js/pages/video/video.js
index f8b03e9..0732c3a 100644
--- a/js/pages/video/video.js
+++ b/js/pages/video/video.js
@@ -31,11 +31,21 @@ layui.config({
puid = puid.substring(0, puid.length - 2);
if (puid) {
parent.layer.msg("视频加载中,请稍候...", { icon: 16, scrollbar: false, time: 1000, });
+ let puidCz=true;
+ for (let i = 0; i < playList.length; i++) {
+ if( playList[i].puid==puid){
+ puidCz=false;
+ }
+ }
+ if(puidCz){
let newobj=getPlay(puid,getWindBox(),0);
playList.push(newobj);
+ playVideList();
+ }
+
console.log("4444");
console.log(playList);
- playVideList();
+
// QXPlayVideo(puid, '0', winDom)
// playControl();
videoObject.devCode = puid;
diff --git a/js/pages/video/videoAjax.js b/js/pages/video/videoAjax.js
index de4bc55..8e0a2de 100644
--- a/js/pages/video/videoAjax.js
+++ b/js/pages/video/videoAjax.js
@@ -34,6 +34,8 @@ function loadVideoTree() {
item.title = '
' + titleName + ''
if(isPlay){
let puid = item.id.replace('QJ', '').split("-")[0];
+
+
playList.push(getPlay(puid,winDom,0));
playVideList();
// QXPlayVideo(puid, '0', winDom)
@@ -98,10 +100,16 @@ function fourVideo(){
}
nowDmoScree=4;
- console.log(nowDmoScree);
- if(playList.length>nowDmoScree){
- playList=playList.slice(-nowDmoScree);
+ //console.log(nowDmoScree);
+ // if(playList.length>nowDmoScree){
+ // playList=playList.slice(-nowDmoScree);
+ // }
+ while (playList.length > nowDmoScree) {
+ console.log(playList[0].windBox)
+ destoryVideo(playList[0].flvPlayer);
+ playList.pop();
}
+
for (let i = 0; i {
- // if (flvPlayer) {
- // //播放失败销毁窗口
- // destoryVideo(flvPlayer);
- // videoObject.playState = false;
- // }
- // });
+ flvPlayer.on(flvjs.Events.ERROR, (errorType, errorDetail, errorInfo) => {
+ if (flvPlayer) {
+ //播放失败销毁窗口
+ destoryVideo(flvPlayer);
+ videoObject.playState = false;
+ }
+ });
setTimeout(function () {