You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
237 lines
7.6 KiB
237 lines
7.6 KiB
|
2 years ago
|
<!DOCTYPE html>
|
||
|
|
|
||
|
|
<head>
|
||
|
|
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11" />
|
||
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||
|
|
<script src="jquery-1.10.2.min.js"></script>
|
||
|
|
<title>video</title>
|
||
|
|
<style>
|
||
|
|
html,
|
||
|
|
body,
|
||
|
|
#map {
|
||
|
|
padding: 0;
|
||
|
|
margin: 0;
|
||
|
|
height: 100%;
|
||
|
|
overflow-x: hidden;
|
||
|
|
overflow-y: hidden;
|
||
|
|
}
|
||
|
|
|
||
|
|
.s_btn {
|
||
|
|
color: white;
|
||
|
|
font-family: Microsoft YaHei;
|
||
|
|
font-size: 18px
|
||
|
|
border: 1px solid #1e7db9;
|
||
|
|
background-color:#497897;
|
||
|
|
box-shadow: 0 1px 2px #8fcaee inset, 0 -1px 0 #497897 inset, 0 -2px 3px #8fcaee inset;
|
||
|
|
background: -webkit-linear-gradient(top, #42a4e0, #2e88c0);
|
||
|
|
background: -moz-linear-gradient(top, #42a4e0, #2e88c0);
|
||
|
|
background: linear-gradient(top, #42a4e0, #2e88c0);
|
||
|
|
}
|
||
|
|
|
||
|
|
#switchspace{
|
||
|
|
font-family: Microsoft YaHei;
|
||
|
|
font-size: 18px;
|
||
|
|
color: white;
|
||
|
|
display:flex;
|
||
|
|
justify-content:space-around;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
<script>
|
||
|
|
var _haslogin = false;
|
||
|
|
var videoUrl = "",
|
||
|
|
thirdsyscode = "",
|
||
|
|
presetid = "",
|
||
|
|
thirdsyscodeArr = [],
|
||
|
|
presetarr = [],
|
||
|
|
pagesum,
|
||
|
|
curpage = 1,
|
||
|
|
playthirdsyscodeArr = [];
|
||
|
|
|
||
|
|
function GetUrlParam(paraName) {
|
||
|
|
var url = window.document.location.href.toString();
|
||
|
|
var arrObj = url.split("?");
|
||
|
|
|
||
|
|
if (arrObj.length > 1) {
|
||
|
|
var arrPara = arrObj[1].split("&");
|
||
|
|
var arr;
|
||
|
|
|
||
|
|
for (var i = 0; i < arrPara.length; i++) {
|
||
|
|
arr = arrPara[i].split("=");
|
||
|
|
|
||
|
|
if (arr != null && arr[0] == paraName) {
|
||
|
|
return arr[1];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return "";
|
||
|
|
} else {
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function playVideoHrv() {
|
||
|
|
thirdsyscodeArr = thirdsyscode.split(",");
|
||
|
|
var templength = thirdsyscodeArr.length;
|
||
|
|
|
||
|
|
if (templength==1){
|
||
|
|
getPreset(thirdsyscode);
|
||
|
|
commonVideoActive.Play(thirdsyscode, "1");
|
||
|
|
}else if (templength>1){
|
||
|
|
commonVideoActive.SetLayout(2);
|
||
|
|
var startindex = (curpage -1)*4
|
||
|
|
var endindex = startindex+4;
|
||
|
|
if(startindex + 4 >templength){
|
||
|
|
endindex = templength;
|
||
|
|
}
|
||
|
|
playthirdsyscodeArr = [];
|
||
|
|
for(i = startindex;i<endindex;i++){
|
||
|
|
playthirdsyscodeArr.push(thirdsyscodeArr[i]);
|
||
|
|
// console.log(i+"::::::"+thirdsyscodeArr[i]);
|
||
|
|
commonVideoActive.SetFocus(i-startindex+1);
|
||
|
|
commonVideoActive.Play(thirdsyscodeArr[i], "1");
|
||
|
|
commonVideoActive.PTZGotoPreset(presetarr[i]);
|
||
|
|
}
|
||
|
|
commonVideoActive.SetFocus(1);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function getPreset(thirdsyscode) {
|
||
|
|
$.ajax({
|
||
|
|
url: "/HiatmpPro/hrv/common/getAllVideoPreset",
|
||
|
|
type: "get",
|
||
|
|
dataType: "json",
|
||
|
|
data: { thirdsyscode: thirdsyscode },
|
||
|
|
success: function(data) {
|
||
|
|
$("#buttonspace").children().remove();
|
||
|
|
var presetbtn = data.videoList;
|
||
|
|
for (var i = 0; i < presetbtn.length; i++) {
|
||
|
|
$("#buttonspace").append("<input type='button' name='commbtn' id='" + presetbtn[i].presetid + "' " +
|
||
|
|
"value='" + presetbtn[i].presetname + "' class='s_btn' ></input>");
|
||
|
|
}
|
||
|
|
|
||
|
|
//预置位调用
|
||
|
|
$(".s_btn").click(function() {
|
||
|
|
if (typeof(this.id) != 'undefined' && this.id != '' && this.id != 'morepreset') {
|
||
|
|
var presetnum = this.id;
|
||
|
|
if (this.id == "resetpreset" || this.id == "allviewpreset") {
|
||
|
|
presetnum = "1";
|
||
|
|
}
|
||
|
|
// alert(presetnum);
|
||
|
|
commonVideoActive.PTZGotoPreset(presetnum);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function initVideoParam() {
|
||
|
|
videoUrl = GetUrlParam("videoService"); //警号
|
||
|
|
thirdsyscode = GetUrlParam("thirdsyscode"); //第三方编号
|
||
|
|
presetid = GetUrlParam("presetid");
|
||
|
|
console.log('chromevideopresetid:' ,presetid);
|
||
|
|
thirdsyscodeArr = thirdsyscode.split(",");
|
||
|
|
presetarr = presetid.split(",");
|
||
|
|
var templength = thirdsyscodeArr.length;
|
||
|
|
if(templength ==1){
|
||
|
|
$("#switchspace").css('display','none');
|
||
|
|
}
|
||
|
|
pagesum = Math.ceil(templength/4);
|
||
|
|
curpage = 1;
|
||
|
|
$("#videosum").html("共"+templength+"路");
|
||
|
|
$("#pagesum").html("共"+pagesum+"页");
|
||
|
|
$("#page").html("1");
|
||
|
|
|
||
|
|
setTimeout(function() {
|
||
|
|
if (_haslogin) { //如果已登录,直接播放
|
||
|
|
commonVideoActive.Play(thirdsyscode, "1");
|
||
|
|
} else {
|
||
|
|
commonVideoActive.GetInstance(videoUrl);
|
||
|
|
}
|
||
|
|
}, 30);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function addone(){
|
||
|
|
if(curpage<pagesum){
|
||
|
|
curpage ++;
|
||
|
|
$("#page").html(curpage);
|
||
|
|
playVideoHrv();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function minusone(){
|
||
|
|
if(curpage>1){
|
||
|
|
curpage --;
|
||
|
|
$("#page").html(curpage);
|
||
|
|
playVideoHrv();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnGetInstance()">
|
||
|
|
if (window.console) {
|
||
|
|
console.log('2.0登录成功');
|
||
|
|
}
|
||
|
|
_haslogin = true;
|
||
|
|
playVideoHrv();
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnGetInstanceEx()">
|
||
|
|
if (window.console) {
|
||
|
|
console.log('2.1登录成功');
|
||
|
|
}
|
||
|
|
_haslogin = true;
|
||
|
|
playVideoHrv();
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnGetInstanceFailed(reason)">
|
||
|
|
if (window.console) {
|
||
|
|
console.log('2.0登录失败');
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnGetInstanceFailedEx(reason)">
|
||
|
|
if (window.console) {
|
||
|
|
console.log('2.1登录失败');
|
||
|
|
}
|
||
|
|
// playVideoHrv();
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnPlay(index, cameraId)">
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnPlayError(index, cameraId)">
|
||
|
|
//alert('播放失败');
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnPTZEvent()">
|
||
|
|
console.log('调用视频预置位');
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnPTZEventFailed()">
|
||
|
|
</script>
|
||
|
|
<script language="javascript" FOR="commonVideoActive" EVENT="OnFocusChanged(IWndIndex)">
|
||
|
|
getPreset(playthirdsyscodeArr[IWndIndex-1])
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<body scroll="no" onload="this.initVideoParam()">
|
||
|
|
<div style='height:100%;width:100%; background-color: #43A9DA; display: flex;flex-direction: column'>
|
||
|
|
<div style='flex:1'>
|
||
|
|
<object id="commonVideoActive" classid="clsid:A8B6BBF3-DA78-4BCB-ABAB-FB0410A463E4" width="100%" height="100%"></object>
|
||
|
|
</div>
|
||
|
|
<div style="height: 100px">
|
||
|
|
<div id="buttonspace"></div>
|
||
|
|
<div id="switchspace">
|
||
|
|
<div>
|
||
|
|
<span id = 'videosum'></span>
|
||
|
|
</div>
|
||
|
|
<div>
|
||
|
|
<input type="button" value="<" onclick="minusone()" style="background-color:#497897;color:white"></input>
|
||
|
|
<span id = ></span>第<span id = 'page'></span><span id =>页</span>
|
||
|
|
<input type="button" value=">" onclick="addone()" style="background-color:#497897;color:white"></input>
|
||
|
|
</div>
|
||
|
|
<div>
|
||
|
|
<span id = 'pagesum'></span>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
|
||
|
|
</html>
|