sgj
3 天以前 241d327e57cbfe504aa806c61aa22e6205706098
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,38 @@
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();
        });
    });
    //赋值内外网播放
    if (lan) {
        $("#playLan").val(lan)
        playTag = lan;
    }
    //初始化渲染播放列表
    renderList();
});
/**
 * 切换播放方式
 */
function renderPlayType() {
    playTag = $("#playLan").val();
    //内网播放,重置各个播放窗口
    reloadView(1);
    reloadView(4);
    reloadView(9);
}
/**
 * 渲染监控列表
@@ -93,16 +119,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") {
        //内网播放,赋值WebRtc播放方式
        playType = "WEB_RTC";
    }
    var data = {
        id: camera.id,
        playType: camera.playType
        playType: playType
    };
    $.ajax({
        type: 'POST',
@@ -217,11 +252,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 +308,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 +619,7 @@
}
/*============= 视频播放 ----- 结束 ===============*/
/*============= webRtc视频播放5 ----- 开始 ===============*/
/**
 * 开始播放
@@ -609,6 +683,7 @@
}
/*============= 视频播放 ----- 结束 ===============*/
/*============= webRtc视频播放4 ----- 开始 ===============*/
/**
 * 开始播放