From aad1f2dd7b10ec03d78d703bc2c31b9e679a82b6 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期一, 05 一月 2026 17:19:23 +0800
Subject: [PATCH] 监管视频逻辑调整

---
 fzzy-igdss-web/src/main/resources/static/security/video-list-dept.js |   93 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 79 insertions(+), 14 deletions(-)

diff --git a/fzzy-igdss-web/src/main/resources/static/security/video-list-dept.js b/fzzy-igdss-web/src/main/resources/static/security/video-list-dept.js
index 2ad4c1b..aff5113 100644
--- a/fzzy-igdss-web/src/main/resources/static/security/video-list-dept.js
+++ b/fzzy-igdss-web/src/main/resources/static/security/video-list-dept.js
@@ -7,6 +7,8 @@
 var playCamera = null;
 var playList = {};
 
+var playTag = "1";  //榛樿鍐呯綉鎾斁
+
 var playUrl1 = null;
 var videoId1 = null;
 let webrtc1;
@@ -45,14 +47,32 @@
 let mediaStream9;
 
 $(function () {
-    layui.use(['layer', 'table'], function () {
+    layui.use(['layer', 'form', 'table'], function () {
         layer = layui.layer;
         table = layui.table;
+        form = layui.form;
+
+        // 鐩戝惉鎾斁鏂瑰紡
+        form.on('select(select_play)', function (obj) {
+            return renderPlayType();
+        });
     });
 
     //鍒濆鍖栨覆鏌撴挱鏀惧垪琛�
     renderList();
 });
+
+/**
+ * 鍒囨崲鎾斁鏂瑰紡
+ */
+function renderPlayType() {
+    playTag = $("#playLan").val();
+
+    //鍐呯綉鎾斁锛岄噸缃悇涓挱鏀剧獥鍙�
+    reloadView(1);
+    reloadView(4);
+    reloadView(9);
+}
 
 /**
  * 娓叉煋鐩戞帶鍒楄〃
@@ -93,16 +113,21 @@
  * @param index
  */
 function getMedia(index) {
-    if(windowsNum == null){
+    if (windowsNum == null) {
         windowsNum = 1;
     }
     playCamera = null;
     var camera = listCamera[index];
     playList[windowsNum] = camera;
 
+    var playType = camera.playType;
+    if (playTag === "1") {
+        //鍐呯綉鎾斁,璧嬪�糤ebRtc鎾斁鏂瑰紡
+        playType = "WEB_RTC";
+    }
     var data = {
         id: camera.id,
-        playType: camera.playType
+        playType: playType
     };
     $.ajax({
         type: 'POST',
@@ -217,11 +242,49 @@
     }
 }
 
-
-
+/**
+ * 鍒ゆ柇鍐呯綉鎾斁杩樻槸澶栫綉鎾斁
+ */
 function startPlay() {
+    if (playTag === "1") {
+        //鍐呯綉鎾斁
+        startPlay1();
+    }
+    if (playTag === "2") {
+        //澶栫綉鎾斁
+        startPlay2();
+    }
+}
 
-    if(windowsNum > splitWin){
+/**
+ * 澶栫綉鎾斁
+ */
+function startPlay2() {
+
+    if (windowsNum > splitWin) {
+        windowsNum = 1;
+    }
+    if (!playCamera) {
+        $("#f" + splitWin + "_d" + windowsNum).html("鏈幏鍙栧埌鎽勫儚澶存挱鏀句俊鎭紒锛�");
+    }
+
+    if (playCamera.playUrl) {
+        var html = '<div class="mask" onclick="selectWin(' + splitWin + ',' + windowsNum + ')"></div>';
+        html += '<iframe src="' + playCamera.playUrl + '" width="99%" height="99%" frameborder="0" allowfullscreen></iframe>';
+        $("#f" + splitWin + "_d" + windowsNum).html(html);
+
+        curCamera = playList[windowsNum];
+    } else {
+        $("#f" + splitWin + "_d" + windowsNum).html("鏈幏鍙栧埌鎽勫儚澶�(" + playCamera.cameraName + ")鎾斁淇℃伅锛侊紒");
+    }
+}
+
+/**
+ * 鍐呯綉鎾斁
+ */
+function startPlay1() {
+
+    if (windowsNum > splitWin) {
         windowsNum = 1;
     }
     if (!playCamera) {
@@ -235,49 +298,49 @@
             playUrl1 = playCamera.playUrl;
             videoId1 = playCamera.cameraId;
             webRtcToPlay1();
-        }else if (windowsNum === 2) {
+        } else if (windowsNum === 2) {
             playUrl2 = null;
             mediaStream2 = null;
             playUrl2 = playCamera.playUrl;
             videoId2 = playCamera.cameraId;
             webRtcToPlay2();
-        }else if (windowsNum === 3) {
+        } else if (windowsNum === 3) {
             playUrl3 = null;
             mediaStream3 = null;
             playUrl3 = playCamera.playUrl;
             videoId3 = playCamera.cameraId;
             webRtcToPlay3();
-        }else if (windowsNum === 4) {
+        } else if (windowsNum === 4) {
             playUrl4 = null;
             mediaStream4 = null;
             playUrl4 = playCamera.playUrl;
             videoId4 = playCamera.cameraId;
             webRtcToPlay4();
-        }else if (windowsNum === 5) {
+        } else if (windowsNum === 5) {
             playUrl5 = null;
             mediaStream5 = null;
             playUrl5 = playCamera.playUrl;
             videoId5 = playCamera.cameraId;
             webRtcToPlay5();
-        }else if (windowsNum === 6) {
+        } else if (windowsNum === 6) {
             playUrl6 = null;
             mediaStream6 = null;
             playUrl6 = playCamera.playUrl;
             videoId6 = playCamera.cameraId;
             webRtcToPlay6();
-        }else if (windowsNum === 7) {
+        } else if (windowsNum === 7) {
             playUrl7 = null;
             mediaStream7 = null;
             playUrl7 = playCamera.playUrl;
             videoId7 = playCamera.cameraId;
             webRtcToPlay7();
-        }else if (windowsNum === 8) {
+        } else if (windowsNum === 8) {
             playUrl8 = null;
             mediaStream8 = null;
             playUrl8 = playCamera.playUrl;
             videoId8 = playCamera.cameraId;
             webRtcToPlay8();
-        }else if (windowsNum === 9) {
+        } else if (windowsNum === 9) {
             playUr9 = null;
             mediaStream9 = null;
             playUrl9 = playCamera.playUrl;
@@ -546,6 +609,7 @@
 }
 
 /*============= 瑙嗛鎾斁 ----- 缁撴潫 ===============*/
+
 /*============= webRtc瑙嗛鎾斁5 ----- 寮�濮� ===============*/
 /**
  * 寮�濮嬫挱鏀�
@@ -609,6 +673,7 @@
 }
 
 /*============= 瑙嗛鎾斁 ----- 缁撴潫 ===============*/
+
 /*============= webRtc瑙嗛鎾斁4 ----- 寮�濮� ===============*/
 /**
  * 寮�濮嬫挱鏀�

--
Gitblit v1.9.3