czt
2026-01-05 c25d369c352b959887999da035e019b840d0b75c
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;
@@ -50,49 +52,9 @@
        table = layui.table;
    });
    showDeptSelect();
    //初始化渲染播放列表
    renderList();
});
/**
 * 弹出切换库区列表
 */
function showDeptSelect() {
    if(showDeptList === "N"){
        $("#deptList").css('display', 'none');
    }
    if(showDeptList === "Y"){
        $("#deptList").css('display', 'block');
    }
}
/**
 * 弹出切换库区列表
 */
function showDepotAreaSelect() {
    layer.open({
        type: 2,
        title: '选择库区',
        area: ['400px', '650px'],
        offset: ['50px', '170px'],
        shade: 0,
        content: "/com.fzzy.igds.SelectDept.d",
        closeBtn: 1
    });
}
/**
 *
 * @param id
 * @returns {boolean}
 */
function onDeptAreaChange(id) {
    window.location.href = "./security/video-dept?type=" + type + "&deptId=" + id;
    return true;
}
/**
 * 渲染监控列表
@@ -257,10 +219,60 @@
    }
}
/**
 * 判断内网播放还是外网播放
 */
function startPlay() {
    startPlay1();
}
/**
 * 外网播放
 */
function startPlay1() {
    if(windowsNum > splitWin){
        windowsNum = 1;
    }
    if (!playCamera) {
        $("#f" + splitWin + "_d" + windowsNum).html("未获取到摄像头播放信息!!");
    }
    if (playCamera.playUrl) {
        var divId = "#f" + splitWin + "_d" + windowsNum;
        var html = '<video class="video" id="video' + splitWin + '_' + windowsNum+'" style="width:100%;height: 100%"  controls>';
        $(divId).html(html);
        if (flvjs.isSupported()) {
            var videoElement = document.getElementById("video" + splitWin + '_' + windowsNum);
            var flvPlayer = flvjs.createPlayer({
                type: 'flv',
                isLive: true,
                cors: true,
                url: playCamera.playUrl
            });
            flvPlayer.attachMediaElement(videoElement);
            flvPlayer.load();
            flvPlayer.play();
        }
        // var html = '<video class="video" id="video'+splitWin + "_" + windowsNum+'" autoplay playsinline="true" webkit-playsinline="true" crossorigin="anonymous"';
        // html += 'crossorigin="anonymous" src="blob:'+playCamera.playUrl+'" style="display: none;"></video>';
        // html += '<canvas width="100%" height="100%" style="height: 100%">';
        // $("#f" + splitWin + "_d" + windowsNum).html(html);
        curCamera = playList[windowsNum];
    } else {
        $("#f" + splitWin + "_d" + windowsNum).html("未获取到摄像头(" + playCamera.cameraName + ")播放信息!!");
    }
}
/**
 * 内网播放
 */
function startPlay2() {
    if(windowsNum > splitWin){
        windowsNum = 1;
    }