From 97dfab42d2736e2e91035aad58ed01fc27ad3a7d Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 06 一月 2026 11:30:30 +0800
Subject: [PATCH] 大屏视频逻辑调整
---
fzzy-igdss-web/src/main/resources/static/security/video-list-dept.js | 97 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 83 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..bf85ba4 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,25 @@
* @param index
*/
function getMedia(index) {
- if(windowsNum == null){
+ if(splitWin === 9){
+ layer.msg("褰撳墠娴佸獟浣撴殏涓嶆敮鎸�9鍒嗗睆鎾斁锛�");
+ return;
+ }
+ 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 +246,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="100%" height="100%" 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 +302,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 +613,7 @@
}
/*============= 瑙嗛鎾斁 ----- 缁撴潫 ===============*/
+
/*============= webRtc瑙嗛鎾斁5 ----- 寮�濮� ===============*/
/**
* 寮�濮嬫挱鏀�
@@ -609,6 +677,7 @@
}
/*============= 瑙嗛鎾斁 ----- 缁撴潫 ===============*/
+
/*============= webRtc瑙嗛鎾斁4 ----- 寮�濮� ===============*/
/**
* 寮�濮嬫挱鏀�
--
Gitblit v1.9.3