//获取所有视频监督信息 function getVideo_3D() { var camData; var count; $.ajax({ type : "post", url : "../../easyAPI/video/getVideoAndNodes.action", contentType : "charset=utf-8", success : function(data) { camData = data; $.ajax({ type : "post", url : "../../easyAPI/video/countCam.action", contentType : "application/json;charset=utf-8", success : function(data1) { count = data1; showVideo_3D(camData,count); }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("获取视频总数失败!"); } }); }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("获取视频信息失败!"); } }); } //根据摄像头ID获取摄像头详细信息 var pregetvideoid = null; function getVideoById_3D(id) { if(pregetvideoid!==id){ var cameraArgs = JSON.stringify({ "id" : id }); $.ajax({ type : "post", url : "../../easyAPI/video/getVideoById.action", data : cameraArgs, contentType : "application/json;charset=utf-8", success : function(data) { if (data !== undefined) { startVideoConverter(data,null,true,"video"); } }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("根据摄像头ID获取详细信息请求失败!"); } }); pregetvideoid = id; } } //根据摄像头ID获取摄像头并显示投影 function getVideoAndShow(id){ var cameraArgs = JSON.stringify({ "id" : id }); var result; $.ajax({ type : "post", url : "../../easyAPI/video/getVideoById.action", data : cameraArgs, async : false, contentType : "application/json;charset=utf-8", success : function(data) { if (data !== undefined) { startVideoConverter(data,null,true); result = data; } }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("根据摄像头ID获取详细信息请求失败!"); } }); return result; } //根据摄像头ID获取摄像头详细信息并显示视频投影范围 function getVideoScopeById_3D(id) { var cameraArgs = JSON.stringify({ "id" : id }); $.ajax({ type : "post", url : "../../easyAPI/video/getVideoById.action", data : cameraArgs, contentType : "application/json;charset=utf-8", success : function(data) { if (data !== undefined) { createVideoScope(data); } }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("根据摄像头ID获取详细信息请求失败!"); } }); } //启动视频转换进程 function startVideoConverter(node,treeObjList,isinfo,type){ var commandobj = { "id" : node.id, "camRtsp" : node.camRtsp, "camPort" : node.camPort, "camAdd" : "" }; var objvlc = { 'sysType':'vlc', }; var argsvlc = JSON.stringify(objvlc); $.ajax({ type : "post", url : "../../easyAPI/sys/querySysParabyType.action", data : argsvlc, async : false, contentType : "application/json;charset=utf-8", success : function(data) { commandobj.camAdd = data[0].sysContent; var commandArgs = JSON.stringify(commandobj); $.ajax({ type : "post", url : "../../easyAPI/video/startVideoConverter.action", data : commandArgs, async: false, contentType : "application/json;charset=utf-8", success : function(data1) { if(data1){ console.log("启动转换命令发送成功!"); }else{ console.log("转换进程已存在或参数不全!"); } if(treeObjList==null){ if(isinfo){ showInfoVideo_3D(node,type); }else{ var videoElement = createVideoElement(node.camUrl,node.id); createCameraVideo(node,videoElement); } }else{ createVideoContainer(treeObjList,node); } }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("启动转换命令发送失败!!"); } }); }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("ajax请求失败!","请重试!","error"); } }); } //关闭转换进程 function stopVideoConvertor(node){ var commandArgs = JSON.stringify({ "id" : node.id, }); $.ajax({ type : "post", url : "../../easyAPI/video/stopVideoConverter.action", data : commandArgs, async: false, contentType : "application/json;charset=utf-8", success : function(data) { if(data){ console.log("停止转换命令发送成功!"); }else{ console.log("停止转换进程不存在!"); } }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("停止转换命令发送失败!!"); } }); } //视频研判获取所有视频信息 function getCameraAnalyze_3D(){ var camData; var count; $.ajax({ type : "post", url : "../../easyAPI/video/getVideoAndNodes.action", contentType : "charset=utf-8", success : function(data) { camData = data; $.ajax({ type : "post", url : "../../easyAPI/video/countCam.action", contentType : "application/json;charset=utf-8", success : function(data1) { count = data1; showCameraAnalyze_3D(camData,count); }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("获取视频总数请求失败!"); } }); }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("获取视频信息失败!"); }, }); } //清除所有视频转换进程 function clearVideoConverter(){ $.ajax({ type : "post", url : "../../easyAPI/video/clearVideoConverter.action", contentType : "charset=utf-8", success : function(data) { if(data==1){ console.log("清除成功!"); }else{ console.log("清除失败!"); } }, error : function(XMLHttpRequest, textStatus, errorThrown) { console.log("清除命令发送失败!"); }, }); }