index.html
4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>AI视频分析平台</title>
<script src="<%= BASE_URL %>js/kinetic-v5.1.0.min.js"></script>
<script src="<%= BASE_URL %>js/ObjTree.js"></script>
<script src="<%= BASE_URL %>js/jquery.min.js"></script>
<script src="<%= BASE_URL %>js/keymaster.js"></script>
</head>
<body id="theme-name">
<noscript>
<strong></strong>
</noscript>
<div id="app"></div>
</body>
<script>
function connectCamera(szDeviceIp, szUser, szPass, camType) {
var i = 0;
camType = 'ball'
switch (camType) {
case "0":
//console.log("");
break;
case "-1":
// console.log("未找到目标相机");
break;
case "rifle":
//console.log("枪机无云台操作");
break;
case "ball":
i = VionVideo.PtzRegistDev(szDeviceIp, szUser, szPass);
if (i == 1) {
console.log('云台连接成功')
return true;
} else {
//showMessagerInfo("连接云台失败");
return false;
}
break;
default:
i = VionVideo.PtzRegistDev(szDeviceIp, szUser, szPass);
if (i == 1) {
return true;
} else {
//showMessagerInfo("连接云台失败");
return false;
}
break;
}
}
</script>
<script language="javascript" event="VideoCoreEvent(EventType,nParam1,nParam2,szParam3)" for="VionVideo">
if (EventType == 1) {
if (nParam2 != 0) {
//alert("播放失败!");
} else {
}
}
//播放窗口改变事件调用云台控制事件
else if (EventType == 3) {
var curVideoIndex = VionVideo.GetCurSelWnd();
console.log('当前窗口' + curVideoIndex)
var videoInfo = JSON.parse(localStorage.getItem('video' + curVideoIndex));
console.log('相机信息' + videoInfo);
ve.videovid = videoInfo;
//根据树信息返回地址IP 用户名 密码
if (videoInfo) {
var szDeviceIp = videoInfo.vchan_prop.ip,
szUser = videoInfo.vchan_prop.user_name,
szPass = videoInfo.vchan_prop.password;
var camType = '';
if (videoInfo.vchan_prop.is_demo) {
camType = 'ball'
}
var state = connectCamera(szDeviceIp, szUser, szPass, camType);
console.log(state);
}
} else if (EventType == 4) {
//openManualCapture(szParam3);
} else if (EventType == 2) {
//setCamIcon(szParam3, 1);
} else if (EventType == 12) {
jianPanKongzhi(nParam1);
} else if (EventType == 10) {
videoEventHandle.Screenshot(szParam3);
//alert("wwww");
}
//ocx播放窗格切换
else if (EventType == 8) {
//根据拼接定义获取当前窗格数
var tmpArr = szParam3.split(':');
if (tmpArr.length > 0) {
var windowSum = tmpArr[0];
//alert("切换窗格数:" + windowSum);
var ownDefine = tmpArr.length > 1 ? tmpArr[1] : "";
//需要使用子码流播放
if (windowSum >= subNum) {
//alert("当前应使用子码流播放");
//从主码流切换至子码流
if (realVideoNum < subNum) {
//alert("从主码流切换至子码流");
realVideoNum = windowSum;
reSetHasPlayVideos(windowSum, ownDefine, 'SUB');
} else {
realVideoNum = windowSum;
}
}
//需要使用主码流播放
else {
//alert("当前应使用主码流播放");
//从子码流切换至主码流
if (realVideoNum >= subNum) {
//alert("从子码流切换至主码流");
realVideoNum = windowSum;
reSetHasPlayVideos(windowSum, ownDefine, 'MAIN');
} else {
realVideoNum = windowSum;
}
}
}
}
</script>
</html>