diff --git a/supervise-customer-ui/src/api/tobacco/orderCommodity.js b/supervise-customer-ui/src/api/tobacco/orderCommodity.js index 6b811983..bfb948d2 100644 --- a/supervise-customer-ui/src/api/tobacco/orderCommodity.js +++ b/supervise-customer-ui/src/api/tobacco/orderCommodity.js @@ -6,7 +6,7 @@ export default { listPage: function(params) { return request({ baseURL: '/api', - url: '/customer/v1/purchaserequisitionpro/listPage', + url: '/customer/v1/purchaserequisitionstore/listPage', method: 'post', data: params, headers: { @@ -17,7 +17,7 @@ export default { exportExcel: function(params) { return request({ baseURL: '/api', - url: '/customer/v1/purchaserequisitionpro/exportExcel', + url: '/customer/v1/purchaserequisitionstore/exportExcel', method: 'post', responseType: 'blob', // 表明返回服务器返回的数据类型 data: params, diff --git a/supervise-customer-ui/src/api/tobacco/orders.js b/supervise-customer-ui/src/api/tobacco/orders.js index 2066f0ba..0ff9995b 100644 --- a/supervise-customer-ui/src/api/tobacco/orders.js +++ b/supervise-customer-ui/src/api/tobacco/orders.js @@ -6,7 +6,7 @@ export default { listPage: function(params) { return request({ baseURL: '/api', - url: '/customer/v1/purchaserequisition/listPage', + url: '/customer/v1/purchaserequisitiontobacco/listPage', method: 'post', data: params, headers: { @@ -17,7 +17,7 @@ export default { exportExcel: function(params) { return request({ baseURL: '/api', - url: '/customer/v1/purchaserequisition/exportExcel', + url: '/customer/v1/purchaserequisitiontobacco/exportExcel', method: 'post', responseType: 'blob', // 表明返回服务器返回的数据类型 data: params, diff --git a/supervise-message-ui/.env.development b/supervise-message-ui/.env.development index 09337635..572331cf 100644 --- a/supervise-message-ui/.env.development +++ b/supervise-message-ui/.env.development @@ -2,8 +2,8 @@ ENV = 'development' # base api -VUE_APP_BASE_API = '/api' +VUE_APP_BASE_API = '/api/service' ## 配置测试和本地开发时的 接口地址 -VUE_APP_URL = "http://127.0.0.1:8112" +VUE_APP_URL = "http://192.168.3.173:8112" ##VUE_APP_URL = "http://120.46.172.184:8111" diff --git a/supervise-message-ui/src/api/message/mbxx.js b/supervise-message-ui/src/api/message/mbxx.js new file mode 100644 index 00000000..05c971f4 --- /dev/null +++ b/supervise-message-ui/src/api/message/mbxx.js @@ -0,0 +1,50 @@ +import request from '@/utils/request' +// 模板信息 +export default { + // 新增模板消息 + addSave: function(params) { + return request({ + // baseURL: '/api', + url: '/v1/wechattemplate/save', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + // 查询分页列表 + listPage: function(params) { + return request({ + // baseURL: '/api', + url: '/v1/wechattemplate/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + // 初始化 + fetchBySid: function(sid) { + return request({ + url: '/v1/wechattemplate/getTemplateBySid/' + sid, + method: 'get', + }) + }, + // 修改 + updateData: function(data) { + return request({ + url: '/v1/wechattemplate/update', + method: 'post', + data: data + }); + }, + // 删除 + delBySids: function(sid) { + return request({ + url: '/v1/wechattemplate/delete/' + sid, + method: 'delete', + }) + }, +} \ No newline at end of file diff --git a/supervise-message-ui/src/api/portal/Upload.js b/supervise-message-ui/src/api/portal/Upload.js new file mode 100644 index 00000000..7a3d36e6 --- /dev/null +++ b/supervise-message-ui/src/api/portal/Upload.js @@ -0,0 +1,29 @@ +import request from '@/utils/request' +import qs from 'qs' +// 统一请求路径前缀 +const base = process.env.VUE_APP_URL + +// 文件上传接口 +export const uploadFile = process.env.VUE_APP_BASE_API + '/customer/file/upload' + + + +// 上传图片 +// export function imageUpload(data) { +// return request({ +// url: '/portal/file/upload', +// method: 'post', +// data, +// headers: { 'Content-Type': 'multipart/form-data' } +// }) +// } + +// 移除图片 +export function deleteFilesOss(data) { + return request({ + url: '/base/v1/baseVehicleAppendixs/deleteFilesOss', + method: 'post', + data: qs.stringify(data), + // headers: { 'Content-Type': 'multipart/form-data' } + }) +} diff --git a/supervise-message-ui/src/api/portal/areaPicker.js b/supervise-message-ui/src/api/portal/areaPicker.js new file mode 100644 index 00000000..8a2eee36 --- /dev/null +++ b/supervise-message-ui/src/api/portal/areaPicker.js @@ -0,0 +1,34 @@ +import request from '@/utils/request' + +// 获取省/portal/v1/regions/getProvince +export function getProvince(data) { + return request({ + url: '/portal/v1/regions/getProvince',data, + method: 'get', + params:data, + }) +} +// 根据省sid获取该省的所有市 +export function getCity(data) { + return request({ + url: '/portal/v1/regions/getCity', + params:data, + method: 'get', + }) +} +// 根据市sid获取该市的所有县区 +export function getCounty(data) { + return request({ + url: '/portal/v1/regions/getCounty', + method: 'get', + params:data, + }) +} +// // 区域列表(省市县均可用) +// export function selectsList(data) { +// return request({ +// url: '/portal/v1/regions/selectsList', data, +// method: 'post', +// headers: { 'Content-Type': 'application/json' } +// }) +// } diff --git a/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue b/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue index b7c1089a..08b6fffd 100644 --- a/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue +++ b/supervise-message-ui/src/components/uploadFile/upload_yanchejianchaTuBiao.vue @@ -1,222 +1,247 @@ - + \ No newline at end of file diff --git a/supervise-message-ui/src/router/modules/codemenu.js b/supervise-message-ui/src/router/modules/codemenu.js index 439aca82..0770c2c4 100644 --- a/supervise-message-ui/src/router/modules/codemenu.js +++ b/supervise-message-ui/src/router/modules/codemenu.js @@ -48,5 +48,21 @@ const codemenu = [{ noCache: true } }] +}, { + path: '/xxzxydxx', + component: Layout, + redirect: '/mbxx/index', + meta: { + title: '模板消息' + }, + children: [{ + path: '/mbxx/index', + component: () => import('@/views/message/mbxx.vue'), + name: 'XxzxYdxx', + meta: { + title: '模板消息', + noCache: true + } + }] }] export default codemenu diff --git a/supervise-message-ui/src/settings.js b/supervise-message-ui/src/settings.js index 0dc7efda..9f78bf67 100644 --- a/supervise-message-ui/src/settings.js +++ b/supervise-message-ui/src/settings.js @@ -1,6 +1,6 @@ module.exports = { - title: '汇融供应链贷后监管平台 + title: '汇融供应链贷后监管平台', /** * @type {boolean} true | false diff --git a/supervise-message-ui/src/utils/request.js b/supervise-message-ui/src/utils/request.js index 12093fa6..41d3f0e9 100644 --- a/supervise-message-ui/src/utils/request.js +++ b/supervise-message-ui/src/utils/request.js @@ -1,7 +1,13 @@ import axios from 'axios' -import { MessageBox, Message } from 'element-ui' +import { + MessageBox, + Message +} from 'element-ui' import store from '@/store' -import { getToken, getStorage } from '@/utils/auth' +import { + getToken, + getStorage +} from '@/utils/auth' // create an axios instance const service = axios.create({ @@ -49,9 +55,11 @@ service.interceptors.response.use( * You can also judge the status by HTTP Status Code */ response => { + const res = response.data const statusCode = response.status - + console.log("response>>>", response) + console.log("response.data>>>", response.data) // if the custom code is not 20000, it is judged as an error. if (statusCode !== 200) { Message({ @@ -62,7 +70,8 @@ service.interceptors.response.use( }) // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; - if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code === 50014) { + if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code === + 50014) { // to re-login MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', @@ -100,4 +109,4 @@ service.interceptors.response.use( } ) -export default service +export default service \ No newline at end of file diff --git a/supervise-message-ui/src/views/message/mbxx.vue b/supervise-message-ui/src/views/message/mbxx.vue new file mode 100644 index 00000000..2c50a028 --- /dev/null +++ b/supervise-message-ui/src/views/message/mbxx.vue @@ -0,0 +1,261 @@ + + + + diff --git a/supervise-message-ui/src/views/message/mbxxAdd.vue b/supervise-message-ui/src/views/message/mbxxAdd.vue new file mode 100644 index 00000000..ea856d15 --- /dev/null +++ b/supervise-message-ui/src/views/message/mbxxAdd.vue @@ -0,0 +1,310 @@ + + + + + diff --git a/supervise-message-ui/src/views/message/mbxxInfo.vue b/supervise-message-ui/src/views/message/mbxxInfo.vue new file mode 100644 index 00000000..db5bbdcd --- /dev/null +++ b/supervise-message-ui/src/views/message/mbxxInfo.vue @@ -0,0 +1,288 @@ + + + + + \ No newline at end of file diff --git a/supervise-message-ui/vue.config.js b/supervise-message-ui/vue.config.js index 4acce309..68dba461 100644 --- a/supervise-message-ui/vue.config.js +++ b/supervise-message-ui/vue.config.js @@ -6,7 +6,7 @@ function resolve(dir) { return path.join(__dirname, dir) } -const name = defaultSettings.title || '汇融供应链贷后监管平台// page title +const name = defaultSettings.title || '汇融供应链贷后监管平台'// page title // 如果端口设置为80, // 使用管理员权限执行命令行。 diff --git a/supervise-monitor-ui/.env.development b/supervise-monitor-ui/.env.development index da1d55ed..bdfda30b 100644 --- a/supervise-monitor-ui/.env.development +++ b/supervise-monitor-ui/.env.development @@ -5,5 +5,5 @@ ENV = 'development' VUE_APP_BASE_API = '/api' ## 配置测试和本地开发时的 接口地址 -VUE_APP_URL = "http://8.130.39.13:8112" -##VUE_APP_URL = "http://120.46.172.184:8111" +##VUE_APP_URL = "http://8.130.39.13:8112" +VUE_APP_URL = "http://192.168.3.173:8112" diff --git a/supervise-monitor-ui/.eslintignore b/supervise-monitor-ui/.eslintignore index e6529fc0..33963bfb 100644 --- a/supervise-monitor-ui/.eslintignore +++ b/supervise-monitor-ui/.eslintignore @@ -2,3 +2,4 @@ build/*.js src/assets public dist +src/* \ No newline at end of file diff --git a/supervise-monitor-ui/babel.config.js b/supervise-monitor-ui/babel.config.js index c9349132..b0ac7d5a 100644 --- a/supervise-monitor-ui/babel.config.js +++ b/supervise-monitor-ui/babel.config.js @@ -4,6 +4,7 @@ module.exports = { // '@vue/cli-plugin-babel/preset', ['@vue/app', { useBuiltIns: 'entry' }] ], + "ignore" : ["./src/api/hikvision/webVideoCtrl.js"], 'env': { 'development': { // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). diff --git a/supervise-monitor-ui/package.json b/supervise-monitor-ui/package.json index 8ec1fff3..f0a18357 100644 --- a/supervise-monitor-ui/package.json +++ b/supervise-monitor-ui/package.json @@ -33,7 +33,8 @@ "vue-router": "3.0.6", "vuex": "3.1.0", "vuex-persistedstate": "^4.0.0", - "xcrud": "^0.4.19" + "xcrud": "^0.4.19", + "web-control": "^1.0.2" }, "devDependencies": { "@vue/cli-plugin-babel": "4.4.4", @@ -70,4 +71,4 @@ "npm": ">= 3.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/supervise-monitor-ui/public/WebComponentsKit.exe b/supervise-monitor-ui/public/WebComponentsKit.exe new file mode 100644 index 00000000..6d22708d Binary files /dev/null and b/supervise-monitor-ui/public/WebComponentsKit.exe differ diff --git a/supervise-monitor-ui/src/api/hikvision/demo.js b/supervise-monitor-ui/src/api/hikvision/demo.js new file mode 100644 index 00000000..724a6c52 --- /dev/null +++ b/supervise-monitor-ui/src/api/hikvision/demo.js @@ -0,0 +1,2019 @@ +// 初始化插件 + +// 全局保存当前选中窗口 +var g_iWndIndex = 0; //可以不用设置这个变量,有窗口参数的接口中,不用传值,开发包会默认使用当前选择窗口 +$(function () { + // 检查插件是否已经安装过 + var iRet = WebVideoCtrl.I_CheckPluginInstall(); + if (-1 == iRet) { + alert("您还未安装过插件,双击开发包目录里的WebComponentsKit.exe安装!"); + return; + } + + // 初始化插件参数及插入插件 + WebVideoCtrl.I_InitPlugin(500, 300, { + bWndFull: true, //是否支持单窗口双击全屏,默认支持 true:支持 false:不支持 + iPackageType: 2, //2:PS 11:MP4 + iWndowType: 2, + bNoPlugin: true, + cbSelWnd: function (xmlDoc) { + g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10); + var szInfo = "当前选择的窗口编号:" + g_iWndIndex; + showCBInfo(szInfo); + }, + cbDoubleClickWnd: function (iWndIndex, bFullScreen) { + var szInfo = "当前放大的窗口编号:" + iWndIndex; + if (!bFullScreen) { + szInfo = "当前还原的窗口编号:" + iWndIndex; + } + showCBInfo(szInfo); + + // 此处可以处理单窗口的码流切换 + /*if (bFullScreen) { + clickStartRealPlay(1); + } else { + clickStartRealPlay(2); + }*/ + }, + cbEvent: function (iEventType, iParam1, iParam2) { + if (2 == iEventType) {// 回放正常结束 + showCBInfo("窗口" + iParam1 + "回放结束!"); + } else if (-1 == iEventType) { + showCBInfo("设备" + iParam1 + "网络错误!"); + } else if (3001 == iEventType) { + clickStopRecord(g_szRecordType, iParam1); + } + }, + cbRemoteConfig: function () { + showCBInfo("关闭远程配置库!"); + }, + cbInitPluginComplete: function () { + WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin"); + + // 检查插件是否最新 + if (-1 == WebVideoCtrl.I_CheckPluginVersion()) { + alert("检测到新的插件版本,双击开发包目录里的WebComponentsKit.exe升级!"); + return; + } + } + }); + + // 窗口事件绑定 + $(window).bind({ + resize: function () { + var $Restart = $("#restartDiv"); + if ($Restart.length > 0) { + var oSize = getWindowSize(); + $Restart.css({ + width: oSize.width + "px", + height: oSize.height + "px" + }); + } + } + }); + + //初始化日期时间 + var szCurTime = dateFormat(new Date(), "yyyy-MM-dd"); + $("#starttime").val(szCurTime + " 00:00:00"); + $("#endtime").val(szCurTime + " 23:59:59"); +}); + +// 显示操作信息 +function showOPInfo(szInfo, status, xmlDoc) { + var szTip = "
" + dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo; + if (typeof status != "undefined" && status != 200) { + var szStatusString = $(xmlDoc).find("statusString").eq(0).text(); + var szSubStatusCode = $(xmlDoc).find("subStatusCode").eq(0).text(); + if ("" === szSubStatusCode) { + szTip += "(" + status + ", " + szStatusString + ")"; + } else { + szTip += "(" + status + ", " + szSubStatusCode + ")"; + } + } + szTip += "
"; + + $("#opinfo").html(szTip + $("#opinfo").html()); +} + +// 显示回调信息 +function showCBInfo(szInfo) { + szInfo = "
" + dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss") + " " + szInfo + "
"; + $("#cbinfo").html(szInfo + $("#cbinfo").html()); +} + +// 格式化时间 +function dateFormat(oDate, fmt) { + var o = { + "M+": oDate.getMonth() + 1, //月份 + "d+": oDate.getDate(), //日 + "h+": oDate.getHours(), //小时 + "m+": oDate.getMinutes(), //分 + "s+": oDate.getSeconds(), //秒 + "q+": Math.floor((oDate.getMonth() + 3) / 3), //季度 + "S": oDate.getMilliseconds()//毫秒 + }; + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, (oDate.getFullYear() + "").substr(4 - RegExp.$1.length)); + } + for (var k in o) { + if (new RegExp("(" + k + ")").test(fmt)) { + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); + } + } + return fmt; +} + +// 获取窗口尺寸 +function getWindowSize() { + var nWidth = $(this).width() + $(this).scrollLeft(), + nHeight = $(this).height() + $(this).scrollTop(); + + return {width: nWidth, height: nHeight}; +} + +// 打开选择框 0:文件夹 1:文件 +function clickOpenFileDlg(id, iType) { + var szDirPath = WebVideoCtrl.I_OpenFileDlg(iType); + + if (szDirPath != -1 && szDirPath != "" && szDirPath != null) { + $("#" + id).val(szDirPath); + } +} + +// 获取本地参数 +function clickGetLocalCfg() { + var xmlDoc = WebVideoCtrl.I_GetLocalCfg(); + + if (xmlDoc != null) { + $("#netsPreach").val($(xmlDoc).find("BuffNumberType").eq(0).text()); + $("#wndSize").val($(xmlDoc).find("PlayWndType").eq(0).text()); + $("#rulesInfo").val($(xmlDoc).find("IVSMode").eq(0).text()); + $("#captureFileFormat").val($(xmlDoc).find("CaptureFileFormat").eq(0).text()); + $("#packSize").val($(xmlDoc).find("PackgeSize").eq(0).text()); + $("#recordPath").val($(xmlDoc).find("RecordPath").eq(0).text()); + $("#downloadPath").val($(xmlDoc).find("DownloadPath").eq(0).text()); + $("#previewPicPath").val($(xmlDoc).find("CapturePath").eq(0).text()); + $("#playbackPicPath").val($(xmlDoc).find("PlaybackPicPath").eq(0).text()); + $("#devicePicPath").val($(xmlDoc).find("DeviceCapturePath").eq(0).text()); + $("#playbackFilePath").val($(xmlDoc).find("PlaybackFilePath").eq(0).text()); + $("#protocolType").val($(xmlDoc).find("ProtocolType").eq(0).text()); + + showOPInfo("本地配置获取成功!"); + } else { + showOPInfo("本地配置获取失败!"); + } +} + +// 设置本地参数 +function clickSetLocalCfg() { + var arrXml = [], + szInfo = ""; + + arrXml.push(""); + arrXml.push("" + $("#packSize").val() + ""); + arrXml.push("" + $("#wndSize").val() + ""); + arrXml.push("" + $("#netsPreach").val() + ""); + arrXml.push("" + $("#recordPath").val() + ""); + arrXml.push("" + $("#previewPicPath").val() + ""); + arrXml.push("" + $("#playbackFilePath").val() + ""); + arrXml.push("" + $("#playbackPicPath").val() + ""); + arrXml.push("" + $("#devicePicPath").val() + ""); + arrXml.push("" + $("#downloadPath").val() + ""); + arrXml.push("" + $("#rulesInfo").val() + ""); + arrXml.push("" + $("#captureFileFormat").val() + ""); + arrXml.push("" + $("#protocolType").val() + ""); + arrXml.push(""); + + var iRet = WebVideoCtrl.I_SetLocalCfg(arrXml.join("")); + + if (0 == iRet) { + szInfo = "本地配置设置成功!"; + } else { + szInfo = "本地配置设置失败!"; + } + showOPInfo(szInfo); +} + +// 窗口分割数 +function changeWndNum(iType) { + iType = parseInt(iType, 10); + WebVideoCtrl.I_ChangeWndNum(iType); +} + +// 登录 +function clickLogin() { + var szIP = $("#loginip").val(), + szPort = $("#port").val(), + szUsername = $("#username").val(), + szPassword = $("#password").val(); + + if ("" == szIP || "" == szPort) { + return; + } + + var szDeviceIdentify = szIP + "_" + szPort; + + var iRet = WebVideoCtrl.I_Login(szIP, 1, szPort, szUsername, szPassword, { + success: function (xmlDoc) { + showOPInfo(szDeviceIdentify + " 登录成功!"); + + $("#ip").prepend(""); + setTimeout(function () { + $("#ip").val(szDeviceIdentify); + getChannelInfo(); + getDevicePort(); + }, 10); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 登录失败!", status, xmlDoc); + } + }); + + if (-1 == iRet) { + showOPInfo(szDeviceIdentify + " 已登录过!"); + } +} + +// 退出 +function clickLogout() { + var szDeviceIdentify = $("#ip").val(), + szInfo = ""; + + if (null == szDeviceIdentify) { + return; + } + + var iRet = WebVideoCtrl.I_Logout(szDeviceIdentify); + if (0 == iRet) { + szInfo = "退出成功!"; + + $("#ip option[value='" + szDeviceIdentify + "']").remove(); + getChannelInfo(); + getDevicePort(); + } else { + szInfo = "退出失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); +} + +// 获取设备信息 +function clickGetDeviceInfo() { + var szDeviceIdentify = $("#ip").val(); + + if (null == szDeviceIdentify) { + return; + } + + WebVideoCtrl.I_GetDeviceInfo(szDeviceIdentify, { + success: function (xmlDoc) { + var arrStr = []; + arrStr.push("设备名称:" + $(xmlDoc).find("deviceName").eq(0).text() + "\r\n"); + arrStr.push("设备ID:" + $(xmlDoc).find("deviceID").eq(0).text() + "\r\n"); + arrStr.push("型号:" + $(xmlDoc).find("model").eq(0).text() + "\r\n"); + arrStr.push("设备序列号:" + $(xmlDoc).find("serialNumber").eq(0).text() + "\r\n"); + arrStr.push("MAC地址:" + $(xmlDoc).find("macAddress").eq(0).text() + "\r\n"); + arrStr.push("主控版本:" + $(xmlDoc).find("firmwareVersion").eq(0).text() + " " + $(xmlDoc).find("firmwareReleasedDate").eq(0).text() + "\r\n"); + arrStr.push("编码版本:" + $(xmlDoc).find("encoderVersion").eq(0).text() + " " + $(xmlDoc).find("encoderReleasedDate").eq(0).text() + "\r\n"); + + showOPInfo(szDeviceIdentify + " 获取设备信息成功!"); + alert(arrStr.join("")); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 获取设备信息失败!", status, xmlDoc); + } + }); +} + +// 获取通道 +function getChannelInfo() { + var szDeviceIdentify = $("#ip").val(), + oSel = $("#channels").empty(); + + if (null == szDeviceIdentify) { + return; + } + + // 模拟通道 + WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, { + async: false, + success: function (xmlDoc) { + var oChannels = $(xmlDoc).find("VideoInputChannel"); + + $.each(oChannels, function (i) { + var id = $(this).find("id").eq(0).text(), + name = $(this).find("name").eq(0).text(); + if ("" == name) { + name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1)); + } + oSel.append(""); + }); + showOPInfo(szDeviceIdentify + " 获取模拟通道成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 获取模拟通道失败!", status, xmlDoc); + } + }); + // 数字通道 + WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, { + async: false, + success: function (xmlDoc) { + var oChannels = $(xmlDoc).find("InputProxyChannelStatus"); + + $.each(oChannels, function (i) { + var id = $(this).find("id").eq(0).text(), + name = $(this).find("name").eq(0).text(), + online = $(this).find("online").eq(0).text(); + if ("false" == online) {// 过滤禁用的数字通道 + return true; + } + if ("" == name) { + name = "IPCamera " + (i < 9 ? "0" + (i + 1) : (i + 1)); + } + oSel.append(""); + }); + showOPInfo(szDeviceIdentify + " 获取数字通道成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 获取数字通道失败!", status, xmlDoc); + } + }); + // 零通道 + WebVideoCtrl.I_GetZeroChannelInfo(szDeviceIdentify, { + async: false, + success: function (xmlDoc) { + var oChannels = $(xmlDoc).find("ZeroVideoChannel"); + + $.each(oChannels, function (i) { + var id = $(this).find("id").eq(0).text(), + name = $(this).find("name").eq(0).text(); + if ("" == name) { + name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : (i + 1)); + } + if ("true" == $(this).find("enabled").eq(0).text()) {// 过滤禁用的零通道 + oSel.append(""); + } + }); + showOPInfo(szDeviceIdentify + " 获取零通道成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 获取零通道失败!", status, xmlDoc); + } + }); +} + +// 获取端口 +function getDevicePort() { + var szDeviceIdentify = $("#ip").val(); + + if (null == szDeviceIdentify) { + return; + } + + var oPort = WebVideoCtrl.I_GetDevicePort(szDeviceIdentify); + if (oPort != null) { + $("#deviceport").val(oPort.iDevicePort); + $("#rtspport").val(oPort.iRtspPort); + + showOPInfo(szDeviceIdentify + " 获取端口成功!"); + } else { + showOPInfo(szDeviceIdentify + " 获取端口失败!"); + } +} + +// 获取数字通道 +function clickGetDigitalChannelInfo() { + var szDeviceIdentify = $("#ip").val(), + iAnalogChannelNum = 0; + + $("#digitalchannellist").empty(); + + if (null == szDeviceIdentify) { + return; + } + + // 模拟通道 + WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, { + async: false, + success: function (xmlDoc) { + iAnalogChannelNum = $(xmlDoc).find("VideoInputChannel").length; + }, + error: function () { + + } + }); + + // 数字通道 + WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, { + async: false, + success: function (xmlDoc) { + var oChannels = $(xmlDoc).find("InputProxyChannelStatus"); + + $.each(oChannels, function () { + var id = parseInt($(this).find("id").eq(0).text(), 10), + ipAddress = $(this).find("ipAddress").eq(0).text(), + srcInputPort = $(this).find("srcInputPort").eq(0).text(), + managePortNo = $(this).find("managePortNo").eq(0).text(), + online = $(this).find("online").eq(0).text(), + proxyProtocol = $(this).find("proxyProtocol").eq(0).text(); + + var objTr = $("#digitalchannellist").get(0).insertRow(-1); + var objTd = objTr.insertCell(0); + objTd.innerHTML = (id - iAnalogChannelNum) < 10 ? "D0" + (id - iAnalogChannelNum) : "D" + (id - iAnalogChannelNum); + objTd = objTr.insertCell(1); + objTd.width = "25%"; + objTd.innerHTML = ipAddress; + objTd = objTr.insertCell(2); + objTd.width = "15%"; + objTd.innerHTML = srcInputPort; + objTd = objTr.insertCell(3); + objTd.width = "20%"; + objTd.innerHTML = managePortNo; + objTd = objTr.insertCell(4); + objTd.width = "15%"; + objTd.innerHTML = "true" == online ? "在线" : "离线"; + objTd = objTr.insertCell(5); + objTd.width = "25%"; + objTd.innerHTML = proxyProtocol; + }); + showOPInfo(szDeviceIdentify + " 获取数字通道成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 没有数字通道!", status, xmlDoc); + } + }); +} + +// 开始预览 +function clickStartRealPlay(iStreamType) { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szDeviceIdentify = $("#ip").val(), + iRtspPort = parseInt($("#rtspport").val(), 10), + iChannelID = parseInt($("#channels").val(), 10), + bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false, + szInfo = ""; + + if ("undefined" === typeof iStreamType) { + iStreamType = parseInt($("#streamtype").val(), 10); + } + + if (null == szDeviceIdentify) { + return; + } + + var startRealPlay = function () { + WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, { + iRtspPort: iRtspPort, + iStreamType: iStreamType, + iChannelID: iChannelID, + bZeroChannel: bZeroChannel, + success: function () { + szInfo = "开始预览成功!"; + showOPInfo(szDeviceIdentify + " " + szInfo); + }, + error: function (status, xmlDoc) { + if (403 === status) { + szInfo = "设备不支持Websocket取流!"; + } else { + szInfo = "开始预览失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); + } + }); + }; + + if (oWndInfo != null) {// 已经在播放了,先停止 + WebVideoCtrl.I_Stop({ + success: function () { + startRealPlay(); + } + }); + } else { + startRealPlay(); + } +} + +// 停止预览 +function clickStopRealPlay() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_Stop({ + success: function () { + szInfo = "停止预览成功!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + szInfo = "停止预览失败!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 打开声音 +function clickOpenSound() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + var allWndInfo = WebVideoCtrl.I_GetWindowStatus(); + // 循环遍历所有窗口,如果有窗口打开了声音,先关闭 + for (var i = 0, iLen = allWndInfo.length; i < iLen; i++) { + oWndInfo = allWndInfo[i]; + if (oWndInfo.bSound) { + WebVideoCtrl.I_CloseSound(oWndInfo.iIndex); + break; + } + } + + var iRet = WebVideoCtrl.I_OpenSound(); + + if (0 == iRet) { + szInfo = "打开声音成功!"; + } else { + szInfo = "打开声音失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 关闭声音 +function clickCloseSound() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + var iRet = WebVideoCtrl.I_CloseSound(); + if (0 == iRet) { + szInfo = "关闭声音成功!"; + } else { + szInfo = "关闭声音失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 设置音量 +function clickSetVolume() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + iVolume = parseInt($("#volume").val(), 10), + szInfo = ""; + + if (oWndInfo != null) { + var iRet = WebVideoCtrl.I_SetVolume(iVolume); + if (0 == iRet) { + szInfo = "音量设置成功!"; + } else { + szInfo = "音量设置失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 抓图 +function clickCapturePic() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + var xmlDoc = WebVideoCtrl.I_GetLocalCfg(); + var szCaptureFileFormat = "0"; + if (xmlDoc != null) { + szCaptureFileFormat = $(xmlDoc).find("CaptureFileFormat").eq(0).text(); + } + + var szChannelID = $("#channels").val(); + var szPicName = oWndInfo.szDeviceIdentify + "_" + szChannelID + "_" + new Date().getTime(); + + szPicName += ("0" === szCaptureFileFormat) ? ".jpg": ".bmp"; + + var iRet = WebVideoCtrl.I_CapturePic(szPicName, { + bDateDir: true //是否生成日期文件 + }); + if (0 == iRet) { + szInfo = "抓图成功!"; + } else { + szInfo = "抓图失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 开始录像 +var g_szRecordType = ""; +function clickStartRecord(szType) { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + g_szRecordType = szType; + + if (oWndInfo != null) { + var szChannelID = $("#channels").val(), + szFileName = oWndInfo.szDeviceIdentify + "_" + szChannelID + "_" + new Date().getTime(); + + WebVideoCtrl.I_StartRecord(szFileName, { + bDateDir: true, //是否生成日期文件 + success: function () { + if ('realplay' === szType) { + szInfo = "开始录像成功!"; + } else if ('playback' === szType) { + szInfo = "开始剪辑成功!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + if ('realplay' === szType) { + szInfo = "开始录像失败!"; + } else if ('playback' === szType) { + szInfo = "开始剪辑失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 停止录像 +function clickStopRecord(szType, iWndIndex) { + if ("undefined" === typeof iWndIndex) { + iWndIndex = g_iWndIndex; + } + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_StopRecord({ + success: function () { + if ('realplay' === szType) { + szInfo = "停止录像成功!"; + } else if ('playback' === szType) { + szInfo = "停止剪辑成功!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + if ('realplay' === szType) { + szInfo = "停止录像失败!"; + } else if ('playback' === szType) { + szInfo = "停止剪辑失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 获取对讲通道 +function clickGetAudioInfo() { + var szDeviceIdentify = $("#ip").val(); + + if (null == szDeviceIdentify) { + return; + } + + WebVideoCtrl.I_GetAudioInfo(szDeviceIdentify, { + success: function (xmlDoc) { + var oAudioChannels = $(xmlDoc).find("TwoWayAudioChannel"), + oSel = $("#audiochannels").empty(); + $.each(oAudioChannels, function () { + var id = $(this).find("id").eq(0).text(); + + oSel.append(""); + }); + showOPInfo(szDeviceIdentify + " 获取对讲通道成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 获取对讲通道失败!", status, xmlDoc); + } + }); +} + +// 开始对讲 +function clickStartVoiceTalk() { + var szDeviceIdentify = $("#ip").val(), + iAudioChannel = parseInt($("#audiochannels").val(), 10), + szInfo = ""; + + if (null == szDeviceIdentify) { + return; + } + + if (isNaN(iAudioChannel)) { + alert("请选择对讲通道!"); + return; + } + + var iRet = WebVideoCtrl.I_StartVoiceTalk(szDeviceIdentify, iAudioChannel); + + if (0 == iRet) { + szInfo = "开始对讲成功!"; + } else { + szInfo = "开始对讲失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); +} + +// 停止对讲 +function clickStopVoiceTalk() { + var szDeviceIdentify = $("#ip").val(), + iRet = WebVideoCtrl.I_StopVoiceTalk(), + szInfo = ""; + + if (null == szDeviceIdentify) { + return; + } + + if (0 == iRet) { + szInfo = "停止对讲成功!"; + } else { + szInfo = "停止对讲失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); +} + +// 启用电子放大 +function clickEnableEZoom() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + var iRet = WebVideoCtrl.I_EnableEZoom(); + if (0 == iRet) { + szInfo = "启用电子放大成功!"; + } else { + szInfo = "启用电子放大失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 禁用电子放大 +function clickDisableEZoom() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + var iRet = WebVideoCtrl.I_DisableEZoom(); + if (0 == iRet) { + szInfo = "禁用电子放大成功!"; + } else { + szInfo = "禁用电子放大失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 启用3D放大 +function clickEnable3DZoom() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + var iRet = WebVideoCtrl.I_Enable3DZoom(); + if (0 == iRet) { + szInfo = "启用3D放大成功!"; + } else { + szInfo = "启用3D放大失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 禁用3D放大 +function clickDisable3DZoom() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + var iRet = WebVideoCtrl.I_Disable3DZoom(); + if (0 == iRet) { + szInfo = "禁用3D放大成功!"; + } else { + szInfo = "禁用3D放大失败!"; + } + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } +} + +// 全屏 +function clickFullScreen() { + WebVideoCtrl.I_FullScreen(true); +} + +// PTZ控制 9为自动,1,2,3,4,5,6,7,8为方向PTZ +var g_bPTZAuto = false; +function mouseDownPTZControl(iPTZIndex) { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false, + iPTZSpeed = $("#ptzspeed").val(); + + if (bZeroChannel) {// 零通道不支持云台 + return; + } + + if (oWndInfo != null) { + if (9 == iPTZIndex && g_bPTZAuto) { + iPTZSpeed = 0;// 自动开启后,速度置为0可以关闭自动 + } else { + g_bPTZAuto = false;// 点击其他方向,自动肯定会被关闭 + } + + WebVideoCtrl.I_PTZControl(iPTZIndex, false, { + iPTZSpeed: iPTZSpeed, + success: function (xmlDoc) { + if (9 == iPTZIndex && g_bPTZAuto) { + showOPInfo(oWndInfo.szDeviceIdentify + " 停止云台成功!"); + } else { + showOPInfo(oWndInfo.szDeviceIdentify + " 开启云台成功!"); + } + if (9 == iPTZIndex) { + g_bPTZAuto = !g_bPTZAuto; + } + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 开启云台失败!", status, xmlDoc); + } + }); + } +} + +// 方向PTZ停止 +function mouseUpPTZControl() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(1, true, { + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 停止云台成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 停止云台失败!", status, xmlDoc); + } + }); + } +} + +// 设置预置点 +function clickSetPreset() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + iPresetID = parseInt($("#preset").val(), 10); + + if (oWndInfo != null) { + WebVideoCtrl.I_SetPreset(iPresetID, { + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 设置预置点成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 设置预置点失败!", status, xmlDoc); + } + }); + } +} + +// 调用预置点 +function clickGoPreset() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + iPresetID = parseInt($("#preset").val(), 10); + + if (oWndInfo != null) { + WebVideoCtrl.I_GoPreset(iPresetID, { + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调用预置点成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调用预置点失败!", status, xmlDoc); + } + }); + } +} + +// 搜索录像 +var g_iSearchTimes = 0; +function clickRecordSearch(iType) { + var szDeviceIdentify = $("#ip").val(), + iChannelID = parseInt($("#channels").val(), 10), + bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false, + iStreamType = parseInt($("#record_streamtype").val(), 10), + szStartTime = $("#starttime").val(), + szEndTime = $("#endtime").val(); + + if (null == szDeviceIdentify) { + return; + } + + if (bZeroChannel) {// 零通道不支持录像搜索 + return; + } + + if (0 == iType) {// 首次搜索 + $("#searchlist").empty(); + g_iSearchTimes = 0; + } + + WebVideoCtrl.I_RecordSearch(szDeviceIdentify, iChannelID, szStartTime, szEndTime, { + iStreamType: iStreamType, + iSearchPos: g_iSearchTimes * 40, + success: function (xmlDoc) { + if ("MORE" === $(xmlDoc).find("responseStatusStrg").eq(0).text()) { + + for(var i = 0, nLen = $(xmlDoc).find("searchMatchItem").length; i < nLen; i++) { + var szPlaybackURI = $(xmlDoc).find("playbackURI").eq(i).text(); + if(szPlaybackURI.indexOf("name=") < 0) { + break; + } + var szStartTime = $(xmlDoc).find("startTime").eq(i).text(); + var szEndTime = $(xmlDoc).find("endTime").eq(i).text(); + var szFileName = szPlaybackURI.substring(szPlaybackURI.indexOf("name=") + 5, szPlaybackURI.indexOf("&size=")); + + var objTr = $("#searchlist").get(0).insertRow(-1); + var objTd = objTr.insertCell(0); + objTd.id = "downloadTd" + i; + objTd.innerHTML = g_iSearchTimes * 40 + (i + 1); + objTd = objTr.insertCell(1); + objTd.width = "30%"; + objTd.innerHTML = szFileName; + objTd = objTr.insertCell(2); + objTd.width = "30%"; + objTd.innerHTML = (szStartTime.replace("T", " ")).replace("Z", ""); + objTd = objTr.insertCell(3); + objTd.width = "30%"; + objTd.innerHTML = (szEndTime.replace("T", " ")).replace("Z", ""); + objTd = objTr.insertCell(4); + objTd.width = "10%"; + objTd.innerHTML = "下载"; + $("#downloadTd" + (i + g_iSearchTimes * 40)).data("fileName", szFileName); + $("#downloadTd" + (i + g_iSearchTimes * 40)).data("playbackURI", szPlaybackURI); + } + + g_iSearchTimes++; + clickRecordSearch(1);// 继续搜索 + } else if ("OK" === $(xmlDoc).find("responseStatusStrg").eq(0).text()) { + var iLength = $(xmlDoc).find("searchMatchItem").length; + for(var i = 0; i < iLength; i++) { + var szPlaybackURI = $(xmlDoc).find("playbackURI").eq(i).text(); + if(szPlaybackURI.indexOf("name=") < 0) { + break; + } + var szStartTime = $(xmlDoc).find("startTime").eq(i).text(); + var szEndTime = $(xmlDoc).find("endTime").eq(i).text(); + var szFileName = szPlaybackURI.substring(szPlaybackURI.indexOf("name=") + 5, szPlaybackURI.indexOf("&size=")); + + var objTr = $("#searchlist").get(0).insertRow(-1); + var objTd = objTr.insertCell(0); + objTd.id = "downloadTd" + i; + objTd.innerHTML = g_iSearchTimes * 40 + (i + 1); + objTd = objTr.insertCell(1); + objTd.width = "30%"; + objTd.innerHTML = szFileName; + objTd = objTr.insertCell(2); + objTd.width = "30%"; + objTd.innerHTML = (szStartTime.replace("T", " ")).replace("Z", ""); + objTd = objTr.insertCell(3); + objTd.width = "30%"; + objTd.innerHTML = (szEndTime.replace("T", " ")).replace("Z", ""); + objTd = objTr.insertCell(4); + objTd.width = "10%"; + objTd.innerHTML = "下载"; + $("#downloadTd" + (i + g_iSearchTimes * 40)).data("fileName", szFileName); + $("#downloadTd" + (i + g_iSearchTimes * 40)).data("playbackURI", szPlaybackURI); + } + showOPInfo(szDeviceIdentify + " 搜索录像文件成功!"); + } else if("NO MATCHES" === $(xmlDoc).find("responseStatusStrg").eq(0).text()) { + setTimeout(function() { + showOPInfo(szDeviceIdentify + " 没有录像文件!"); + }, 50); + } + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 搜索录像文件失败!", status, xmlDoc); + } + }); +} + +// 开始回放 +function clickStartPlayback() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szDeviceIdentify = $("#ip").val(), + iRtspPort = parseInt($("#rtspport").val(), 10), + iStreamType = parseInt($("#record_streamtype").val(), 10), + bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false, + iChannelID = parseInt($("#channels").val(), 10), + szStartTime = $("#starttime").val(), + szEndTime = $("#endtime").val(), + szInfo = "", + bChecked = $("#transstream").prop("checked"), + iRet = -1; + + if (null == szDeviceIdentify) { + return; + } + + if (bZeroChannel) {// 零通道不支持回放 + return; + } + + var startPlayback = function () { + if (bChecked) {// 启用转码回放 + var oTransCodeParam = { + TransFrameRate: "14",// 0:全帧率,5:1,6:2,7:4,8:6,9:8,10:10,11:12,12:16,14:15,15:18,13:20,16:22 + TransResolution: "1",// 255:Auto,3:4CIF,2:QCIF,1:CIF + TransBitrate: "19"// 2:32K,3:48K,4:64K,5:80K,6:96K,7:128K,8:160K,9:192K,10:224K,11:256K,12:320K,13:384K,14:448K,15:512K,16:640K,17:768K,18:896K,19:1024K,20:1280K,21:1536K,22:1792K,23:2048K,24:3072K,25:4096K,26:8192K + }; + WebVideoCtrl.I_StartPlayback(szDeviceIdentify, { + iRtspPort: iRtspPort, + iStreamType: iStreamType, + iChannelID: iChannelID, + szStartTime: szStartTime, + szEndTime: szEndTime, + oTransCodeParam: oTransCodeParam, + success: function () { + szInfo = "开始回放成功!"; + showOPInfo(szDeviceIdentify + " " + szInfo); + }, + error: function (status, xmlDoc) { + if (403 === status) { + szInfo = "设备不支持Websocket取流!"; + } else { + szInfo = "开始回放失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); + } + }); + } else { + WebVideoCtrl.I_StartPlayback(szDeviceIdentify, { + iRtspPort: iRtspPort, + iStreamType: iStreamType, + iChannelID: iChannelID, + szStartTime: szStartTime, + szEndTime: szEndTime, + success: function () { + szInfo = "开始回放成功!"; + showOPInfo(szDeviceIdentify + " " + szInfo); + }, + error: function (status, xmlDoc) { + if (403 === status) { + szInfo = "设备不支持Websocket取流!"; + } else { + szInfo = "开始回放失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); + } + }); + } + }; + + if (oWndInfo != null) {// 已经在播放了,先停止 + WebVideoCtrl.I_Stop({ + success: function () { + startPlayback(); + } + }); + } else { + startPlayback(); + } +} + +// 停止回放 +function clickStopPlayback() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_Stop({ + success: function () { + szInfo = "停止回放成功!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + szInfo = "停止回放失败!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 开始倒放 +function clickReversePlayback() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szDeviceIdentify = $("#ip").val(), + iRtspPort = parseInt($("#rtspport").val(), 10), + iStreamType = parseInt($("#record_streamtype").val(), 10), + bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false, + iChannelID = parseInt($("#channels").val(), 10), + szStartTime = $("#starttime").val(), + szEndTime = $("#endtime").val(), + szInfo = ""; + + if (null == szDeviceIdentify) { + return; + } + + if (bZeroChannel) {// 零通道不支持倒放 + return; + } + + var reversePlayback = function () { + var iRet = WebVideoCtrl.I_ReversePlayback(szDeviceIdentify, { + iRtspPort: iRtspPort, + iStreamType: iStreamType, + iChannelID: iChannelID, + szStartTime: szStartTime, + szEndTime: szEndTime + }); + + if (0 == iRet) { + szInfo = "开始倒放成功!"; + } else { + szInfo = "开始倒放失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); + }; + + if (oWndInfo != null) {// 已经在播放了,先停止 + WebVideoCtrl.I_Stop({ + success: function () { + reversePlayback(); + } + }); + } else { + reversePlayback(); + } +} + +// 单帧 +function clickFrame() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_Frame({ + success: function () { + szInfo = "单帧播放成功!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + szInfo = "单帧播放失败!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 暂停 +function clickPause() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_Pause({ + success: function () { + szInfo = "暂停成功!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + szInfo = "暂停失败!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 恢复 +function clickResume() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_Resume({ + success: function () { + szInfo = "恢复成功!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + szInfo = "恢复失败!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 慢放 +function clickPlaySlow() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_PlaySlow({ + success: function () { + szInfo = "慢放成功!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + szInfo = "慢放失败!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// 快放 +function clickPlayFast() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex), + szInfo = ""; + + if (oWndInfo != null) { + WebVideoCtrl.I_PlayFast({ + success: function () { + szInfo = "快放成功!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + }, + error: function () { + szInfo = "快放失败!"; + showOPInfo(oWndInfo.szDeviceIdentify + " " + szInfo); + } + }); + } +} + +// OSD时间 +function clickGetOSDTime() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + var szTime = WebVideoCtrl.I_GetOSDTime({ + success: function (szOSDTime) { + $("#osdtime").val(szOSDTime); + showOPInfo(oWndInfo.szDeviceIdentify + " 获取OSD时间成功!"); + }, + error: function () { + showOPInfo(oWndInfo.szDeviceIdentify + " 获取OSD时间失败!"); + } + }); + } +} + +// 下载录像 +var g_iDownloadID = -1; +var g_tDownloadProcess = 0; +function clickStartDownloadRecord(i) { + var szDeviceIdentify = $("#ip").val(), + szChannelID = $("#channels").val(), + szFileName = $("#downloadTd" + i).data("fileName"), + szPlaybackURI = $("#downloadTd" + i).data("playbackURI"); + + if (null == szDeviceIdentify) { + return; + } + + g_iDownloadID = WebVideoCtrl.I_StartDownloadRecord(szDeviceIdentify, szPlaybackURI, szFileName, { + bDateDir: true //是否生成日期文件 + }); + + if (g_iDownloadID < 0) { + var iErrorValue = WebVideoCtrl.I_GetLastError(); + if (34 == iErrorValue) { + showOPInfo(szDeviceIdentify + " 已下载!"); + } else if (33 == iErrorValue) { + showOPInfo(szDeviceIdentify + " 空间不足!"); + } else { + showOPInfo(szDeviceIdentify + " 下载失败!"); + } + } else { + $("
").appendTo("body"); + g_tDownloadProcess = setInterval("downProcess(" + i + ")", 1000); + } +} +// 下载进度 +function downProcess() { + var iStatus = WebVideoCtrl.I_GetDownloadStatus(g_iDownloadID); + if (0 == iStatus) { + $("#downProcess").css({ + width: $("#searchlist").width() + "px", + height: "100px", + lineHeight: "100px", + left: $("#searchdiv").offset().left + "px", + top: $("#searchdiv").offset().top + "px" + }); + var iProcess = WebVideoCtrl.I_GetDownloadProgress(g_iDownloadID); + if (iProcess < 0) { + clearInterval(g_tDownloadProcess); + g_tDownloadProcess = 0; + g_iDownloadID = -1; + } else if (iProcess < 100) { + $("#downProcess").text(iProcess + "%"); + } else { + $("#downProcess").text("100%"); + setTimeout(function () { + $("#downProcess").remove(); + }, 1000); + + WebVideoCtrl.I_StopDownloadRecord(g_iDownloadID); + + showOPInfo("录像下载完成!"); + clearInterval(g_tDownloadProcess); + g_tDownloadProcess = 0; + g_iDownloadID = -1; + } + } else { + WebVideoCtrl.I_StopDownloadRecord(g_iDownloadID); + + clearInterval(g_tDownloadProcess); + g_tDownloadProcess = 0; + g_iDownloadID = -1; + } +} + +// 导出配置文件 +function clickExportDeviceConfig() { + var szDeviceIdentify = $("#ip").val(), + szInfo = ""; + + if (null == szDeviceIdentify) { + return; + } + + var iRet = WebVideoCtrl.I_ExportDeviceConfig(szDeviceIdentify); + + if (0 == iRet) { + szInfo = "导出配置文件成功!"; + } else { + szInfo = "导出配置文件失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); +} + +// 导入配置文件 +function clickImportDeviceConfig() { + var szDeviceIdentify = $("#ip").val(), + szFileName = $("#configFile").val(); + + if (null == szDeviceIdentify) { + return; + } + + if ("" == szFileName) { + alert("请选择配置文件!"); + return; + } + + var iRet = WebVideoCtrl.I_ImportDeviceConfig(szDeviceIdentify, szFileName); + + if (0 == iRet) { + WebVideoCtrl.I_Restart(szDeviceIdentify, { + success: function (xmlDoc) { + $("
重启中...
").appendTo("body"); + var oSize = getWindowSize(); + $("#restartDiv").css({ + width: oSize.width + "px", + height: oSize.height + "px", + lineHeight: oSize.height + "px", + left: 0, + top: 0 + }); + setTimeout("reconnect('" + szDeviceIdentify + "')", 20000); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 重启失败!", status, xmlDoc); + } + }); + } else { + showOPInfo(szDeviceIdentify + " 导入失败!"); + } +} + +// 重连 +function reconnect(szDeviceIdentify) { + WebVideoCtrl.I_Reconnect(szDeviceIdentify, { + success: function (xmlDoc) { + $("#restartDiv").remove(); + }, + error: function (status, xmlDoc) { + if (401 == status) {// 无插件方案,重启后session已失效,程序执行登出,从已登录设备中删除 + $("#restartDiv").remove(); + clickLogout(); + } else { + setTimeout(function () {reconnect(szDeviceIdentify);}, 5000); + } + } + }); +} + +// 开始升级 +var g_tUpgrade = 0; +function clickStartUpgrade(szDeviceIdentify) { + var szDeviceIdentify = $("#ip").val(), + szFileName = $("#upgradeFile").val(); + + if (null == szDeviceIdentify) { + return; + } + + if ("" == szFileName) { + alert("请选择升级文件!"); + return; + } + + var iRet = WebVideoCtrl.I_StartUpgrade(szDeviceIdentify, szFileName); + if (0 == iRet) { + g_tUpgrade = setInterval("getUpgradeStatus('" + szDeviceIdentify + "')", 1000); + } else { + showOPInfo(szDeviceIdentify + " 升级失败!"); + } +} + +// 获取升级状态 +function getUpgradeStatus(szDeviceIdentify) { + var iStatus = WebVideoCtrl.I_UpgradeStatus(); + if (iStatus == 0) { + var iProcess = WebVideoCtrl.I_UpgradeProgress(); + if (iProcess < 0) { + clearInterval(g_tUpgrade); + g_tUpgrade = 0; + showOPInfo(szDeviceIdentify + " 获取进度失败!"); + return; + } else if (iProcess < 100) { + if (0 == $("#restartDiv").length) { + $("
").appendTo("body"); + var oSize = getWindowSize(); + $("#restartDiv").css({ + width: oSize.width + "px", + height: oSize.height + "px", + lineHeight: oSize.height + "px", + left: 0, + top: 0 + }); + } + $("#restartDiv").text(iProcess + "%"); + } else { + WebVideoCtrl.I_StopUpgrade(); + clearInterval(g_tUpgrade); + g_tUpgrade = 0; + + $("#restartDiv").remove(); + + WebVideoCtrl.I_Restart(szDeviceIdentify, { + success: function (xmlDoc) { + $("
重启中...
").appendTo("body"); + var oSize = getWindowSize(); + $("#restartDiv").css({ + width: oSize.width + "px", + height: oSize.height + "px", + lineHeight: oSize.height + "px", + left: 0, + top: 0 + }); + setTimeout("reconnect('" + szDeviceIdentify + "')", 20000); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 重启失败!", status, xmlDoc); + } + }); + } + } else if (iStatus == 1) { + WebVideoCtrl.I_StopUpgrade(); + showOPInfo(szDeviceIdentify + " 升级失败!"); + clearInterval(g_tUpgrade); + g_tUpgrade = 0; + } else if (iStatus == 2) { + mWebVideoCtrl.I_StopUpgrade(); + showOPInfo(szDeviceIdentify + " 语言不匹配!"); + clearInterval(g_tUpgrade); + g_tUpgrade = 0; + } else { + mWebVideoCtrl.I_StopUpgrade(); + showOPInfo(szDeviceIdentify + " 获取状态失败!"); + clearInterval(g_tUpgrade); + g_tUpgrade = 0; + } +} + +// 检查插件版本 +function clickCheckPluginVersion() { + var iRet = WebVideoCtrl.I_CheckPluginVersion(); + if (0 == iRet) { + alert("您的插件版本已经是最新的!"); + } else { + alert("检测到新的插件版本!"); + } +} + +// 远程配置库 +function clickRemoteConfig() { + var szDeviceIdentify = $("#ip").val(), + iDevicePort = parseInt($("#deviceport").val(), 10) || "", + szInfo = ""; + + if (null == szDeviceIdentify) { + return; + } + + var iRet = WebVideoCtrl.I_RemoteConfig(szDeviceIdentify, { + iDevicePort: iDevicePort, + iLan: 1 + }); + + if (-1 == iRet) { + szInfo = "调用远程配置库失败!"; + } else { + szInfo = "调用远程配置库成功!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); +} + +function clickRestoreDefault() { + var szDeviceIdentify = $("#ip").val(), + szMode = "basic"; + WebVideoCtrl.I_RestoreDefault(szDeviceIdentify, szMode, { + timeout: 30000, + success: function (xmlDoc) { + $("#restartDiv").remove(); + showOPInfo(szDeviceIdentify + " 恢复默认参数成功!"); + //恢复完成后需要重启 + WebVideoCtrl.I_Restart(szDeviceIdentify, { + success: function (xmlDoc) { + $("
重启中...
").appendTo("body"); + var oSize = getWindowSize(); + $("#restartDiv").css({ + width: oSize.width + "px", + height: oSize.height + "px", + lineHeight: oSize.height + "px", + left: 0, + top: 0 + }); + setTimeout("reconnect('" + szDeviceIdentify + "')", 20000); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 重启失败!", status, xmlDoc); + } + }); + }, + error: function (status, xmlDoc) { + showOPInfo(szDeviceIdentify + " 恢复默认参数失败!", status, xmlDoc); + } + }); +} + +function PTZZoomIn() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(10, false, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调焦+成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调焦+失败!", status, xmlDoc); + } + }); + } +} + +function PTZZoomout() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(11, false, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调焦-成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调焦-失败!", status, xmlDoc); + } + }); + } +} + +function PTZZoomStop() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(11, true, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调焦停止成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 调焦停止失败!", status, xmlDoc); + } + }); + } +} + +function PTZFocusIn() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(12, false, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦+成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦+失败!", status, xmlDoc); + } + }); + } +} + +function PTZFoucusOut() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(13, false, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦-成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦-失败!", status, xmlDoc); + } + }); + } +} + +function PTZFoucusStop() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(12, true, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦停止成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 聚焦停止失败!", status, xmlDoc); + } + }); + } +} + +function PTZIrisIn() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(14, false, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 光圈+成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 光圈+失败!", status, xmlDoc); + } + }); + } +} + +function PTZIrisOut() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(15, false, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 光圈-成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 光圈-失败!", status, xmlDoc); + } + }); + } +} + +function PTZIrisStop() { + var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex); + + if (oWndInfo != null) { + WebVideoCtrl.I_PTZControl(14, true, { + iWndIndex: g_iWndIndex, + success: function (xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 光圈停止成功!"); + }, + error: function (status, xmlDoc) { + showOPInfo(oWndInfo.szDeviceIdentify + " 光圈停止失败!", status, xmlDoc); + } + }); + } +} + +// 切换模式 +function changeIPMode(iType) { + var arrPort = [0, 7071, 80]; + + $("#serverport").val(arrPort[iType]); +} + +// 获取设备IP +function clickGetDeviceIP() { + var iDeviceMode = parseInt($("#devicemode").val(), 10), + szAddress = $("#serveraddress").val(), + iPort = parseInt($("#serverport").val(), 10) || 0, + szDeviceID = $("#deviceid").val(), + szDeviceInfo = ""; + + szDeviceInfo = WebVideoCtrl.I_GetIPInfoByMode(iDeviceMode, szAddress, iPort, szDeviceID); + + if ("" == szDeviceInfo) { + showOPInfo("设备IP和端口解析失败!"); + } else { + showOPInfo("设备IP和端口解析成功!"); + + var arrTemp = szDeviceInfo.split("-"); + $("#loginip").val(arrTemp[0]); + $("#deviceport").val(arrTemp[1]); + } +} + +// 启用多边形绘制 +var g_bEnableDraw = false; +function clickEnableDraw() { + var iRet = WebVideoCtrl.I_SetPlayModeType(6);// 多边形模式 + + if (0 === iRet) { + g_bEnableDraw = true; + + showOPInfo("启用绘制成功!"); + } else { + showOPInfo("启用绘制失败!"); + } +} + +// 禁用多边形绘制 +function clickDisableDraw() { + var iRet = WebVideoCtrl.I_SetPlayModeType(0);// 预览模式 + if (0 === iRet) { + g_bEnableDraw = false; + + showOPInfo("禁用绘制成功!"); + } else { + showOPInfo("禁用绘制失败!"); + } +} + +// 添加图形 +function clickAddSnapPolygon() { + if (!g_bEnableDraw) { + return; + } + + var szId = $("#snapId").val(); + var szName = encodeString($("#snapName").val()); + + var szInfo = ""; + szInfo += ""; + szInfo += ""; + szInfo += "" + szId + ""; // [1, 32] + szInfo += "1"; + szInfo += "17"; // [MinClosed, 17] + szInfo += "4"; // [4, 17] + szInfo += "#" + szId + "#" + szName + ""; + szInfo += "false"; + szInfo += "02550"; + szInfo += ""; + szInfo += ""; + szInfo += ""; + + var iRet = WebVideoCtrl.I_SetSnapPolygonInfo(g_iWndIndex, szInfo); + if (0 === iRet) { + showOPInfo("窗口" + g_iWndIndex + "添加图形成功!"); + } else if (-1 === iRet) { + showOPInfo("窗口" + g_iWndIndex + "添加图形失败!"); + } else if (-2 === iRet) { + alert("参数错误!"); + } else if (-3 === iRet) { + alert("图形个数达到上限!"); + } else if (-4 === iRet) { + alert("图形ID已存在!"); + } + WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, 2); +} + +// 删除图形 +function clickDelSnapPolygon() { + if (!g_bEnableDraw) { + return; + } + + var szId = $("#snapId").val(); + + var iIndex = getSnapPolygon(szId); + if (iIndex != -1) { + var oXML = getSnapPolygon(); + $(oXML).find("SnapPolygon").eq(iIndex).remove(); + + var szInfo = toXMLStr(oXML); + + WebVideoCtrl.I_ClearSnapInfo(g_iWndIndex); + WebVideoCtrl.I_SetSnapPolygonInfo(g_iWndIndex, szInfo); + WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, 3); + } else { + alert("图形ID不存在!"); + } +} + +// 编辑图形 +function clickEditSnapPolygon() { + if (!g_bEnableDraw) { + return; + } + + var iRet = WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, 3); + if (0 === iRet) { + showOPInfo("窗口" + g_iWndIndex + "编辑图形成功!"); + } else { + showOPInfo("窗口" + g_iWndIndex + "编辑图形失败!"); + } +} + +// 停止编辑 +function clickStopSnapPolygon() { + if (!g_bEnableDraw) { + return; + } + + var iRet = WebVideoCtrl.I_SetSnapDrawMode(g_iWndIndex, -1); + if (0 === iRet) { + showOPInfo("窗口" + g_iWndIndex + "停止编辑成功!"); + } else { + showOPInfo("窗口" + g_iWndIndex + "停止编辑失败!"); + } +} + +function getSnapPolygon(szId) { + var szInfo = WebVideoCtrl.I_GetSnapPolygonInfo(g_iWndIndex); + var oXML = loadXML(szInfo); + + if (typeof szId === "undefined") { + return oXML; + } else { + var iIndex = -1; + + var aNodeList = $(oXML).find("SnapPolygon"); + if (aNodeList.length > 0) { + $.each(aNodeList, function (i) { + if ($(this).find("id").text() === szId) { + iIndex = i; + return false; + } + }); + } + + return iIndex; + } +} + +// 获取图形,保存到自己数据库中 +function clickGetSnapPolygon() { + if (!g_bEnableDraw) { + return; + } + + var szInfo = WebVideoCtrl.I_GetSnapPolygonInfo(g_iWndIndex); + + alert(szInfo); +} + +// 设置图形,页面打开时可以设置以前设置过的图形 +function clickSetSnapPolygon() { + if (!g_bEnableDraw) { + return; + } + + WebVideoCtrl.I_ClearSnapInfo(g_iWndIndex); + + var szInfo = ""; + szInfo += ""; + szInfo += ""; + szInfo += "1"; + szInfo += "1"; + szInfo += "#1#设置1"; + szInfo += "true"; + szInfo += "02550"; + szInfo += ""; + szInfo += "0.7379030.229730"; + szInfo += "0.9475810.804054"; + szInfo += "0.3629030.777027"; + szInfo += ""; + szInfo += ""; + szInfo += ""; + szInfo += "2"; + szInfo += "1"; + szInfo += "#2#设置2"; + szInfo += "true"; + szInfo += "02550"; + szInfo += ""; + szInfo += "0.4516130.216216"; + szInfo += "0.4475810.729730"; + szInfo += "0.1169350.554054"; + szInfo += ""; + szInfo += ""; + szInfo += ""; + + var iRet = WebVideoCtrl.I_SetSnapPolygonInfo(g_iWndIndex, szInfo); + if (0 === iRet) { + showOPInfo("窗口" + g_iWndIndex + "设置图形成功!"); + } else if (-1 === iRet) { + showOPInfo("窗口" + g_iWndIndex + "设置图形失败!"); + } else if (-2 === iRet) { + alert("参数错误!"); + } else if (-3 === iRet) { + alert("图形个数达到上限!"); + } else if (-4 === iRet) { + alert("图形ID已存在!"); + } +} + +// 清空图形 +function clickDelAllSnapPolygon() { + if (!g_bEnableDraw) { + return; + } + + var iRet = WebVideoCtrl.I_ClearSnapInfo(g_iWndIndex); + if (0 === iRet) { + showOPInfo("窗口" + g_iWndIndex + "清空图形成功!"); + } else { + showOPInfo("窗口" + g_iWndIndex + "清空图形失败!"); + } +} + +// 设备抓图 +function clickDeviceCapturePic() { + var szInfo = ""; + var szDeviceIdentify = $("#ip").val(); + var bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false; + var iChannelID = parseInt($("#channels").val(), 10); + var iResolutionWidth = parseInt($("#resolutionWidth").val(), 10); + var iResolutionHeight = parseInt($("#resolutionHeight").val(), 10); + + if (null == szDeviceIdentify) { + return; + } + + if (bZeroChannel) {// 零通道不支持设备抓图 + return; + } + + var szPicName = szDeviceIdentify + "_" + iChannelID + "_" + new Date().getTime(); + var iRet = WebVideoCtrl.I_DeviceCapturePic(szDeviceIdentify, iChannelID, szPicName, { + bDateDir: true, //是否生成日期文件 + iResolutionWidth: iResolutionWidth, + iResolutionHeight: iResolutionHeight + }); + + if (0 == iRet) { + szInfo = "设备抓图成功!"; + } else { + szInfo = "设备抓图失败!"; + } + showOPInfo(szDeviceIdentify + " " + szInfo); +} + +function loadXML(szXml) { + if(null == szXml || "" == szXml) { + return null; + } + + var oXmlDoc = null; + + if (window.DOMParser) { + var oParser = new DOMParser(); + oXmlDoc = oParser.parseFromString(szXml, "text/xml"); + } else { + oXmlDoc = new ActiveXObject("Microsoft.XMLDOM"); + oXmlDoc.async = false; + oXmlDoc.loadXML(szXml); + } + + return oXmlDoc; +} + +function toXMLStr(oXmlDoc) { + var szXmlDoc = ""; + + try { + var oSerializer = new XMLSerializer(); + szXmlDoc = oSerializer.serializeToString(oXmlDoc); + } catch (e) { + try { + szXmlDoc = oXmlDoc.xml; + } catch (e) { + return ""; + } + } + if (szXmlDoc.indexOf("" + szXmlDoc; + } + + return szXmlDoc; +} + +function encodeString(str) { + if (str) { + return str.replace(/&/g, '&').replace(//g, '>'); + } else { + return ""; + } +} \ No newline at end of file diff --git a/supervise-monitor-ui/src/api/hikvision/hkVideo.js b/supervise-monitor-ui/src/api/hikvision/hkVideo.js new file mode 100644 index 00000000..c5bb4984 --- /dev/null +++ b/supervise-monitor-ui/src/api/hikvision/hkVideo.js @@ -0,0 +1,430 @@ +import { Message } from "element-ui"; + +var webVideoCtrl = window.WebVideoCtrl; +var $ = window.$; +/** + * 初始化 + * @param {number} iWndowType 分屏类型:1 - 1*1,2 - 2*2,3 - 3*3,4 - 4*4,默认值1,单画面 + * @param {number} width 插件的宽度(单位为”px”, 100%表示撑满插件容器) + * @param {number} height 插件的高度(单位为”px”, 100%表示撑满插件容器) + * @returns null + */ +let init = (iWndowType, width, height) => { + // 检查浏览器是否支持无插件 + if (!webVideoCtrl.I_SupportNoPlugin()) { + Message.warning( + "当前浏览器不支持无插件预览监控视频,已自动切换成插件模式,如果还未安装插件请安装" + ); + // 检查插件是否已经安装 + const isInstall = webVideoCtrl.I_CheckPluginInstall(); + if (isInstall == -1) { + Message.warning( + "您还未安装过插件,请先下载WebComponentsKit.exe双击安装!" + ); + return; + } + } + // 初始化插件 + webVideoCtrl.I_InitPlugin(width, height, { + szColorProperty: + "plugin-background:ffffff; sub-background:00000; sub-border:D0DAE4; sub-border-select:409EFF", // 表示插件的背景颜色,插件子窗口的背景颜色,窗口边框的颜色,窗口边框选中后的颜色 + iWndowType, + bNoPlugin: true, // 支持无插件 + cbSelWnd: (xmlDoc) => { + let iWndIndex = parseInt($(xmlDoc)?.find("SelectWnd").eq(0).text(), 10); + console.log("当前选择的窗口编号:" + iWndIndex); + }, + cbDoubleClickWnd: (iWndIndex, bFullScreen) => { + let szInfo = "当前放大的窗口编号:" + iWndIndex; + if (!bFullScreen) { + szInfo = "当前还原的窗口编号:" + iWndIndex; + } + console.log(szInfo); + }, // 无插件模式不起效 + cbInitPluginComplete: () => { + // 嵌入播放插件 + webVideoCtrl.I_InsertOBJECTPlugin("divPlugin"); + console.log("初始化成功--------"); + resize(); + // 检查插件是否最新 + if (webVideoCtrl.I_CheckPluginVersion() == -1) { + Message.warning("检测到新的插件版本,双击WebComponentsKit.exe升级!"); + return; + } + // login( + // global.hk_ip, // 设备的 IP 地址或者普通域名 + // global.hk_prototocol,// http 协议,1 表示 http 协议 2 表示 https 协议 + // global.hk_port,//登录设备的 http/https 端口号,根据 iPrototocol 选择传入不同的端口 + // global.hk_username,//登录用户名称 + // global.hk_password//用户密码 + // ); + + login( + "192.168.3.175", // 设备的 IP 地址或者普通域名 + "1",// http 协议,1 表示 http 协议 2 表示 https 协议 + "80",//登录设备的 http/https 端口号,根据 iPrototocol 选择传入不同的端口 + "admin",//登录用户名称 + "Yxt123456"//用户密码 + ); + }, // 插件初始化完成回调,必须要定义 + }); +}; + +let destroy = () => {}; + +/** + * 调整大小 + */ +let resize = () => { + webVideoCtrl.I_Resize($("#divPlugin").width(), $("#divPlugin").height()); +}; + +/** + * 登录 + * @param {string} ip 设备的 IP 地址或者普通域名 + * @param {number} prototocol http 协议,1 表示 http 协议 2 表示 https 协议 + * @param {number} port 登录设备的 http/https 端口号,根据 iPrototocol 选择传入不同的端口 + * @param {string} userName 登录用户名称 + * @param {string} password 用户密码 + */ +let login = (ip, prototocol, port, userName, password) => { + webVideoCtrl.I_Login(ip, prototocol, port, userName, password, { + async: true, // http 交互方式,true 表示异步,false 表示同步 + cgi: 1, // CGI 协议选择,1 表示 ISAPI,2 表示 PSIA,如果不传这个参数,会自动选择一种设备支持的协议. + // 登录成功回调 + success: (xmlDoc) => { + console.log("login success-----------", xmlDoc); + // getAnalogChannelInfo(`${ip}_${port}`, { + // async: true, + // success: (analogChannelInfo) => { + // let analogCameras = analysisAnalogChannelInfo(analogChannelInfo); + // console.log( + // "获取模拟通道----------", + // analogChannelInfo, + // analogCameras + // ); + // }, + // error: (statusA, xmlDocA) => { + // console.log("获取模拟通道 error-----------", statusA, xmlDocA); + // }, + // }); + getDigitalChannelInfo(`${ip}_${port}`, { + async: true, + success: (digitalChannelInfo) => { + let digitalCameras = analysisDigitalChannelInfo(digitalChannelInfo); + console.log( + "获取数字通道----------", + digitalChannelInfo, + digitalCameras + ); + }, + error: (statusD, xmlDocD) => { + console.log("获取数字通道 error-----------", statusD, xmlDocD); + }, + }); + // getZeroChannelInfo(`${ip}_${port}`, { + // async: true, + // success: (zeroChannelInfo) => { + // let zeroCameras = analysisZeroChannelInfo(zeroChannelInfo); + // console.log("获取零通道----------", zeroChannelInfo, zeroCameras); + // }, + // error: (statusZ, xmlDocZ) => { + // console.log("获取零通道 error-----------", statusZ, xmlDocZ); + // }, + // }); + }, + // 失败函数回调 + error: () => { + console.log("login error-----------"); + }, + }); +}; + +/** + * 登出 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @returns 成功返回 0,失败返回-1 + */ +let logout = (deviceIdentify) => { + return webVideoCtrl.I_Logout(deviceIdentify); +}; + +/** + * 获取设备基本信息 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @param {*} options 可选参数对象: + * * async http 交互方式,true 表示异步,false 表示同步; + * * success 成功回调函数,有一个参数,表示返回的 XML 内容。; + * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空) + */ +let getDeviceInfo = (deviceIdentify, options) => { + webVideoCtrl.I_GetDeviceInfo(deviceIdentify, options); +}; + +/** + * 获取模拟通道 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @param {*} options 可选参数对象: + * * async http 交互方式,true 表示异步,false 表示同步; + * * success 成功回调函数,有一个参数,表示返回的 XML 内容。; + * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空) + */ +let getAnalogChannelInfo = (deviceIdentify, options) => { + webVideoCtrl.I_GetAnalogChannelInfo(deviceIdentify, options); +}; + +/** + * 解析模拟通道XML内容 + * @param {XMLDocument} xmlDoc XML内容 + * @returns cameraList: 监控列表 + */ +let analysisAnalogChannelInfo = (xmlDoc) => { + let cameraList = []; + let channels = $(xmlDoc)?.find("VideoInputChannel"); + $.each(channels, (i, channel) => { + let id = $(channel).find("id").eq(0).text(); + let name = $(channel).find("name").eq(0).text(); + if (name == "") { + name = "Camera " + (i < 9 ? "0" + (i + 1) : i + 1); + } + cameraList.push({ + id, + name, + }); + }); + return cameraList; +}; + +/** + * 获取数字通道 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @param {*} options 可选参数对象: + * * async http 交互方式,true 表示异步,false 表示同步; + * * success 成功回调函数,有一个参数,表示返回的 XML 内容。; + * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空) + */ +let getDigitalChannelInfo = (deviceIdentify, options) => { + webVideoCtrl.I_GetDigitalChannelInfo(deviceIdentify, options); +}; + +/** + * 解析数字通道XML内容 + * @param {XMLDocument} xmlDoc XML内容 + * @param {boolean} filterOnline 是否过滤禁用的数字通道 + * @returns cameraList: 监控列表 + */ +let analysisDigitalChannelInfo = (xmlDoc, filterOnline) => { + let cameraList = []; + let channels = $(xmlDoc)?.find("InputProxyChannelStatus"); + + $.each(channels, (i, channel) => { + let id = $(channel).find("id").eq(0).text(); + let name = $(channel).find("name").eq(0).text(); + let online = $(channel).find("online").eq(0).text(); + if (filterOnline && online == "false") { + // 过滤禁用的数字通道 + return true; + } + if (name == "") { + name = "IPCamera " + (i < 9 ? "0" + (i + 1) : i + 1); + } + cameraList.push({ + id, + name, + online, + }); + }); + return cameraList; +}; + +/** + * 获取零通道 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @param {*} options 可选参数对象: + * * async http 交互方式,true 表示异步,false 表示同步; + * * success 成功回调函数,有一个参数,表示返回的 XML 内容。; + * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空) + */ +let getZeroChannelInfo = (deviceIdentify, options) => { + webVideoCtrl.I_GetZeroChannelInfo(deviceIdentify, options); +}; + +/** + * 解析零通道XML内容 + * @param {XMLDocument} xmlDoc XML内容 + * @param {boolean} filterEnabled 是否过滤禁用的零通道 + * @returns cameraList: 监控列表 + */ +let analysisZeroChannelInfo = (xmlDoc, filterEnabled) => { + let cameraList = []; + let channels = $(xmlDoc)?.find("ZeroVideoChannel"); + + $.each(channels, (i, channel) => { + let id = $(channel).find("id").eq(0).text(); + let name = $(channel).find("name").eq(0).text(); + if (name == "") { + name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : i + 1); + } + let enabled = $(channel).find("enabled").eq(0).text(); + if (filterEnabled && enabled == "false") { + // 过滤禁用的零通道 + return true; + } + cameraList.push({ + id, + name, + enabled, + }); + }); + return cameraList; +}; + +/** + * 录像搜索 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @param {string} channelId 通道 ID + * @param {string} startTime 开始时间:如:2013-12-23 00:00:00 + * @param {string} endTime 结束时间:如:2013-12-23 23:59:59 + * @param {*} options 可选参数对象: + * * async http 交互方式,true 表示异步,false 表示同步 + * * iSearchPos 搜索录像的位置(默认为 0),0 表示返回结果的第 0-40 条,40 表示 40-80 条,依次类推 + * * success 成功回调函数,有一个参数,表示返回的 XML 内容。 + * * error 失败回调函数,有两个参数,第一个是 http 状态码,第二个是设备返回的 XML(可能为空) + * * iStreamType 码流类型 1-主码流,2-子码流,默认主码流 + */ +let recordSearch = (deviceIdentify, channelId, startTime, endTime, options) => { + webVideoCtrl.I_RecordSearch( + deviceIdentify, + channelId, + startTime, + endTime, + options + ); +}; + +/** + * 开始预览 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @param {*} options 可选参数对象: + * * iWndIndex 播放窗口,如果不传,则默认使用当前选择窗口播放(默认选中窗口 0) + * * iStreamType 码流类型 1-主码流,2-子码流,默认使用主码流预览 + * * iChannelID 播放通道号,默认通道 1 + * * bZeroChannel 是否播放零通道,默认为 false + * * iPort RTSP 端口号,可以选择传入,如果不传,开发包会自动判断设备的 RTSP 端口 + * * success 成功回调函数 + * * error 失败回调函数 + */ +let startRealPlay = (deviceIdentify, options) => { + webVideoCtrl.I_StartRealPlay(deviceIdentify, options); +}; + +/** + * 开始回放 + * @param {string} deviceIdentify 设备标识(IP_Port) + * @param {*} options 可选参数对象: + * * iWndIndex 播放窗口,如果不传,则默认使用当前选择窗口播放(默认选中窗口 0) + * * iStreamType 码流类型 1-主码流,2-子码流,默认使用主码流预览 + * * szStartTime 开始时间,默认为当天 00:00:00,格式如:2013-12-23 00:00:00 + * * szEndTime 结束时间,默认为当天 23:59:59,格式如:2013-12-23 23:59:59 + * * iChannelID 播放通道号,默认通道 1 + * * iPort RTSP 端口号,可以选择传入,如果不传,开发包会自动判断设备的 RTSP 端口 + * * oTransCodeParam 转码回放参数对象,传入此参数,将按照此对象中的编码参数进行转码回放(转码回放需要设备支持,如果不支持,则不要传入这个参数)。 + * * iStreamType 码流类型 1-主码流,2-子码流,默认主码流 + * * success 成功回调函数 + * * error 失败回调函数 + */ +let startPlayBack = (deviceIdentify, options) => { + webVideoCtrl.I_StartPlayback(deviceIdentify, options); +}; + +/** + * 停止播放 + * @param {*} options 可选参数对象: + * * iWndIndex 播放窗口号,可不传,表示操作当前选中窗口 + * * success 成功回调函数 + * * error 失败回调函数 + */ +let stopPlay = (options) => { + webVideoCtrl.I_Stop(options); +}; + +/** + * 暂停 + * @param {*} options 可选参数对象: + * * iWndIndex 播放窗口号,可不传,表示操作当前选中窗口 + * * success 成功回调函数 + * * error 失败回调函数 + */ +let pause = (options) => { + webVideoCtrl.I_Pause(options); +}; + +/** + * 打开声音 + * @param {number} iWndIndex 播放窗口号,可不传,表示操作当前选中窗口 + * @returns 成功返回 0,失败返回-1 + */ +let openSound = (iWndIndex) => { + return webVideoCtrl.I_OpenSound(iWndIndex); +}; + +/** + * 关闭声音 + * @param {number} iWndIndex 播放窗口号,可不传,表示操作当前选中窗口 + * @returns 成功返回 0,失败返回-1 + */ +let closeSound = (iWndIndex) => { + return webVideoCtrl.I_CloseSound(iWndIndex); +}; + +/** + * 设置音量 + * @param {number} iVolume 音量大小 + * @param {number} iWndIndex 播放窗口号,可不传,表示操作当前选中窗口 + * @returns 成功返回 0,失败返回-1 + */ +let setVolume = (iVolume, iWndIndex) => { + return webVideoCtrl.I_SetVolume(iVolume, iWndIndex); +}; + +/** + * 修改画面分割类型 + * @param {number} iWndType 画面分割类型:1- 1*1,2- 2*2,3- 3*3,4- 4*4,5- 5*5,6- 6*6,7- 7*7,8- 8*8 + * @returns 成功返回 0,失败返回-1 + */ +let changeWndNum = (iWndType) => { + return webVideoCtrl.I_ChangeWndNum(iWndType); +}; + +/** + * 全屏播放 + * @param {boolean} full 是否全屏:true-全屏 false-退出全屏 + */ +let fullScreen = (full) => { + webVideoCtrl.I_FullScreen(full); +}; + +export default { + init, + destroy, + resize, + login, + logout, + getDeviceInfo, + getAnalogChannelInfo, + analysisAnalogChannelInfo, + getDigitalChannelInfo, + analysisDigitalChannelInfo, + getZeroChannelInfo, + analysisZeroChannelInfo, + recordSearch, + startRealPlay, + startPlayBack, + stopPlay, + pause, + openSound, + closeSound, + setVolume, + changeWndNum, + fullScreen, +}; diff --git a/supervise-monitor-ui/src/api/hikvision/jquery-1.7.1.min.js b/supervise-monitor-ui/src/api/hikvision/jquery-1.7.1.min.js new file mode 100644 index 00000000..835d77d5 --- /dev/null +++ b/supervise-monitor-ui/src/api/hikvision/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,t2=/(trident.*rv:)([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i0&& b[1].indexOf("trident")>-1){b[1]="msie"}return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/supervise-monitor-ui/src/api/hikvision/webVideoCtrl.js b/supervise-monitor-ui/src/api/hikvision/webVideoCtrl.js new file mode 100644 index 00000000..db7c5bf5 --- /dev/null +++ b/supervise-monitor-ui/src/api/hikvision/webVideoCtrl.js @@ -0,0 +1,4379 @@ +! +function(e) { + if (!e.WebVideoCtrl) { + var t = function() { + function t() { + this.id = this.createUUID() + } + + var r = "100%", + s = "100%", + o = "", + i = "", + a = { + szContainerID: "", + szColorProperty: "", + szOcxClassId: "clsid:FDF0038A-CF64-4634-81AB-80F0A7946D6C", + szMimeTypes: "application/webvideo-plugin-kit", + szBasePath: "", + iWndowType: 1, + iPlayMode: 2, + bWndFull: !0, + iPackageType: 2, + bDebugMode: !1, + bNoPlugin: !0, + cbSelWnd: null, + myCbSelWnd: null, + cbDoubleClickWnd: null, + cbEvent: null, + cbRemoteConfig: null, + cbInitPluginComplete: null + }, + c = null, + u = 0, + l = !1, + d = [], + p = [], + P = null, + h = null, + I = null, + f = null, + m = this, + C = null, + S = 1, + v = 2, + y = 200, + g = 0, + x = 1, + D = 2, + z = 3, + T = 4, + b = 5, + A = 6, + M = 0, + R = 2, + L = 3, + q = 21, + G = -1, + W = 0, + X = "IPCamera", + w = "IPDome", + H = "IPZoom", + k = + "3,0,6,23,0,6,27,3,3,611,1,3,62,5,2,81,0,5,59"; + GetSelectWndInfo = function(e) { + // console.log("GetSelectWndInfo", e); + if (re()) { + u = e; + var t = []; + t.push(""), + t.push("" + e + ""), + t.push(""), + a.cbSelWnd && a.cbSelWnd(f.loadXML(t.join(""))) + } else { + var r = f.loadXML2(e); + // console.log("37", r); + if (n.$XML(r).find("SelectWnd", !0).length > 0) { + u = parseInt(n.$XML(r).find("SelectWnd").eq(0).text(), 10), + null === C && U(); + var t = []; + t.push(""), + t.push("" + u + ""), + t.push(""), + a.cbSelWnd && a.cbSelWnd(f.loadXML2(t.join(""))), + a.myCbSelWnd && a.myCbSelWnd(t.join("")) + } else if (n.$XML(r).find("DoubleClickWnd", !0).length > 0) { + var s = parseInt(n.$XML(r).find("DoubleClickWnd").eq(0).text(), 10); + l = "0" === n.$XML(r).find("IsFullScreen").eq(0).text(), + a.cbDoubleClickWnd && a.cbDoubleClickWnd(s, l) + } + } + }, + e.WindowDblClick = function(e) { + l = e, + a.cbDoubleClickWnd && a.cbDoubleClickWnd(u, l) + }, + e.ZoomInfoCallback = function(e) { + var t = m.findWndIndexByIndex(u); + if (-1 != t) { + var n = p[t]; + if (t = m.findDeviceIndexByIP(n.szDeviceIdentify), -1 != t) { + var r = d[t]; + r.oProtocolInc.set3DZoom(r, n, e, { + success: function(e) {}, + error: function() {} + }) + } + } + }, + PluginEventHandler = function(e, t, n) { + re() ? a.cbEvent && a.cbEvent(n, t, "") : (_( + "插件事件:PluginEventHandler iEventType:%s iParam1: %s, iParam2: %s", e, t, n), M == e || R == e ? m + .I_Stop(t) : q == e ? m.I_StopRecord(t) : L == e && m.I_StopVoiceTalk(), a.cbEvent && a.cbEvent(e, t, n) + ) + }, + GetHttpInfo = function(e, t, n) { + _("http响应返回:http状态:%s, http数据:%s", e, t), + ue.prototype.processCallback(e, t) + }, + e.RemoteConfigInfo = function(e) { + a.cbRemoteConfig && a.cbRemoteConfig(e) + }, + e.KeyBoardEventInfo = function(e) { + 100 === parseInt(e, 10) && (l = !1, a.cbDoubleClickWnd && a.cbDoubleClickWnd(u, l)) + }; + var _ = function() { + if (a.bDebugMode) { + var e = E(arguments); + P._alert(e) + } + }, + E = function() { + console.log("arguments>>>>", arguments) + for (var e = arguments[0], t = 1; t < arguments.length; t++) e = e.replace("%s", arguments[t]); + console.log("E>>>>", e) + return e + }, + Z = function(e) { + var t = e.indexOf(":"); + return t > -1 ? e.substring(0, t) : e + }, + B = function(e) { + return "undefined" == typeof e + }, + N = function(e) { + return "[object Object]" === Object.prototype.toString.call(e) + }, + F = function() { + var e = ""; + if (f.browser().msie) e = ""; + else + for (var t = navigator.mimeTypes.length, + n = 0; t > n; n++) navigator.mimeTypes[n].type.toLowerCase() == a.szMimeTypes && (e = + ""); + return e + }, + U = function() { + if (!re() && null !== c) { + var e = c.HWP_GetLocalConfig(); + C = f.loadXML2(e); + // console.log("92 C", C, e); + } + }, + V = function(e) { + m.I_GetDeviceInfo(e.szIP, { + success: function(t) { + e.szDeviceType = n.$XML(t).find("deviceType").eq(0).text() + } + }), + m.I_GetAnalogChannelInfo(e.szIP, { + success: function(t) { + e.iAnalogChannelNum = n.$XML(t).find("VideoInputChannel", !0).length + } + }), + m.I_GetAudioInfo(e.szIP, { + success: function(t) { + var r = n.$XML(t).find("audioCompressionType", !0); + if (r.length > 0) { + var s = n.$XML(r).eq(0).text(), + o = 0; + "G.711ulaw" == s ? o = 1 : "G.711alaw" == s ? o = 2 : "G.726" == s ? o = 3 : "MP2L2" == s || + "MPEL2" == s ? o = 4 : "G.722.1" == s ? o = 0 : "AAC" == s ? o = 5 : "PCM" == s && (o = 6), + e.iAudioType = o + } + "" !== n.$XML(t).find("audioBitRate").eq(0).text() ? e.m_iAudioBitRate = 1e3 * parseInt(n.$XML(t) + .find("audioBitRate").eq(0).text(), 10) : e.m_iAudioBitRate = 0, + "" !== n.$XML(t).find("audioSamplingRate").eq(0).text() ? e.m_iAudioSamplingRate = 1e3 * + parseInt(n.$XML(t).find("audioSamplingRate").eq(0).text(), 10) : e.m_iAudioSamplingRate = 0 + } + }) + }, + j = function(e) { + e.bSupportWebsocket = !1, + e.bSupportSubStreamPlayback = !1, + e.oProtocolInc.getSystemCapa(e, { + success: function(t) { + var r = n.$XML(t).find("NetworkCap").eq(0).find("isSupportWebsocket", !0); + r.length > 0 && (e.bSupportWebsocket = "true" === n.$XML(t).find("NetworkCap").eq(0).find( + "isSupportWebsocket").eq(0).text()), + r = n.$XML(t).find("RacmCap").eq(0).find("isSupportMainAndSubRecord", !0), + r.length > 0 && (e.bSupportSubStreamPlayback = "true" === n.$XML(t).find("RacmCap").eq(0).find( + "isSupportMainAndSubRecord").eq(0).text()) + } + }) + }, + O = function() { + var e = a.bWndFull ? 1 : 0; + c.HWP_SetCanFullScreen(e), + c.HWP_SetPackageType(a.iPackageType) + }, + J = function(e) { + var t = -1, + n = -1, + r = -1, + s = null; + if (ee(e)) s = K(e), + t = s.iRtspPort, + r = s.iDevicePort; + else { + for (var o = Q(e), i = !1, a = 0; a < o.length; a++) + if (o[a].ipv4 == e.szIP || o[a].ipv6 == e.szIP) { + i = !0; + break + } + i ? s = K(e) : (s = Y(e), -1 == s.iRtspPort && -1 == s.iDevicePort && (s = K(e))), + t = s.iRtspPort, + n = s.iHttpPort, + r = s.iDevicePort + } + return s + }, + K = function(e) { + var t = -1, + r = -1, + s = -1; + return e.oProtocolInc.getPortInfo(e, { + async: !1, + success: function(e) { + var o = n.$XML(e).find("AdminAccessProtocol", !0); + t = 554; + for (var i = 0, + a = o.length; a > i; i++) "rtsp" === n.$XML(o).eq(i).find("protocol").eq(0).text() + .toLowerCase() && (t = parseInt(n.$XML(o).eq(i).find("portNo").eq(0).text(), 10)), + "http" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (r = parseInt(n.$XML( + o).eq(i).find("portNo").eq(0).text(), 10)), + "dev_manage" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (s = parseInt(n + .$XML(o).eq(i).find("portNo").eq(0).text(), 10)) + }, + error: function() { + t = -1, + r = -1, + s = -1 + } + }), { + iRtspPort: t, + iHttpPort: r, + iDevicePort: s + } + }, + Y = function(e) { + var t = -1, + r = -1, + s = -1; + return e.oProtocolInc.getUPnPPortStatus(e, { + async: !1, + success: function(e) { + for (var o = n.$XML(e).find("portStatus", !0), i = 0, a = o.length; a > i; i++) "rtsp" == n.$XML( + o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (t = parseInt(n.$XML(o).eq(i) + .find("externalPort").eq(0).text(), 10)), + "http" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (r = parseInt(n + .$XML(o).eq(i).find("externalPort").eq(0).text(), 10)), + "admin" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (s = parseInt(n + .$XML(o).eq(i).find("externalPort").eq(0).text(), 10)) + }, + error: function() { + t = -1, + r = -1, + s = -1 + } + }), { + iRtspPort: t, + iHttpPort: r, + iDevicePort: s + } + }, + Q = function(e) { + var t = []; + return e.oProtocolInc.getNetworkBond(e, { + async: !1, + success: function(r) { + "true" == n.$XML(r).find("enabled").eq(0).text() ? t.push({ + ipv4: n.$XML(r).find("ipAddress").eq(0).text(), + ipv6: n.$XML(r).find("ipv6Address").eq(0).text() + }) : e.oProtocolInc.getNetworkInterface(e, { + async: !1, + success: function(e) { + for (var r = n.$XML(e).find("NetworkInterface", !0), s = 0, o = r.length; o > s; s++) { + t.push({ + ipv4: n.$XML(e).find("ipAddress").eq(0).text(), + ipv6: n.$XML(e).find("ipv6Address").eq(0).text() + }); + break + } + }, + error: function() {} + }) + }, + error: function() { + + e.oProtocolInc.getNetworkInterface(e, { + async: !1, + success: function(e) { + + for (var r = n.$XML(e).find("NetworkInterface", !0), s = 0, o = r.length; o > s; s++) { + t.push({ + ipv4: n.$XML(e).find("ipAddress").eq(0).text(), + ipv6: n.$XML(e).find("ipv6Address").eq(0).text() + }); + break + } + }, + error: function() {} + }) + } + }), + t + }, + ee = function(e) { + var t = !1; + return e.oProtocolInc.getPPPoEStatus(e, { + async: !1, + success: function(e) { + t = n.$XML(e).find("ipAddress", !0).length > 0 ? !0 : n.$XML(e).find("ipv6Address", !0).length > 0 + }, + error: function() { + t = !1 + } + }), + t + }, + te = function(e) { + + e.oStreamCapa.bObtained || e.oProtocolInc instanceof le && e.oProtocolInc.getSDKCapa(e, { + async: !1, + success: function(t) { + + e.oStreamCapa.bObtained = !0, + e.oStreamCapa.bSupportShttpPlay = "true" === n.$XML(t).find("isSupportHttpPlay").eq(0).text(), + e.oStreamCapa.bSupportShttpPlayback = "true" === n.$XML(t).find("isSupportHttpPlayback").eq(0) + .text(), + e.oStreamCapa.bSupportShttpsPlay = "true" === n.$XML(t).find("isSupportHttpsPlay").eq(0).text(), + e.oStreamCapa.bSupportShttpsPlayback = "true" === n.$XML(t).find("isSupportHttpsPlayback").eq(0) + .text(), + e.oStreamCapa.bSupportShttpPlaybackTransCode = "true" === n.$XML(t).find( + "isSupportHttpTransCodePlayback").eq(0).text(), + e.oStreamCapa.bSupportShttpsPlaybackTransCode = "true" === n.$XML(t).find( + "isSupportHttpsTransCodePlayback").eq(0).text(), + n.$XML(t).find("ipChanBase", !0).length > 0 && (e.oStreamCapa.iIpChanBase = parseInt(n.$XML(t) + .find("ipChanBase").eq(0).text(), 10)) + }, + error: function() { + e.oStreamCapa.bObtained = !0 + } + }) + }, + ne = function(e) { + var t = { + TransFrameRate: "", + TransResolution: "", + TransBitrate: "" + }; + if (f.extend(t, e), "" == t.TransFrameRate || "" == t.TransResolution || "" == t.TransBitrate) return ""; + var n = []; + return n.push(""), + n.push(""), + n.push("" + t.TransFrameRate + ""), + n.push("" + t.TransResolution + ""), + n.push("" + t.TransBitrate + ""), + n.push(""), + n.join("") + }, + re = function() { + if (a.bNoPlugin) { + var e = f.browser(); + return !!(e.chrome && parseInt(e.version, 10) > 45 || e.mozilla && parseInt(e.version, 10) > 52) + } + return !1 + }, + se = function(e) { + console.log("location.hostname>>>>>>>>>>>>>", location.hostname) + console.log("location.port>>>>>>>>>>>>>", location.port) + // var t = location.hostname, + // n = location.port || "80"; + var t = "192.168.3.175", + n = "80"; + + return /^(http|https):\/\/([^\/]+)(.+)$/.test(e) && (e = e.replace(RegExp.$2, t + ":" + n)), + f.cookie("webVideoCtrlProxy", RegExp.$2, { + raw: !0 + }), + e + + }, + oe = function() { + var e = ""; + // console.log("224"); + return e += "", + e += "4", + e += "Invalid Operation", + e += "notSupport", + e += "", + f.loadXML(e) + }; + this.I_InitPlugin = function(t, n, o) { + if (r = t, s = n, f.extend(a, o), re()) { + var i = f.getDirName(); + i && ("object" == typeof exports && "undefined" != typeof module || ("function" == typeof define && define + .amd ? require([i + "/jsPlugin-1.0.0.min.js"], + function(t) { + e.JSPlugin = t.JSPlugin, + o.cbInitPluginComplete && o.cbInitPluginComplete() + }) : f.loadScript(i + "/jsPlugin-1.0.0.min.js", + function() { + o.cbInitPluginComplete && o.cbInitPluginComplete() + }))), + addEventListener("resize", + function() { + null !== c && c.JS_Resize(r, s) + }), + B(document.fullScreen) ? B(document.webkitIsFullScreen) ? B(document.mozFullScreen) || document + .addEventListener("mozfullscreenchange", + function(t) { + var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1; + l && !n && e.KeyBoardEventInfo(100) + }) : document.addEventListener("webkitfullscreenchange", + function(t) { + var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1; + l && !n && e.KeyBoardEventInfo(100) + }) : document.addEventListener("fullscreenchange", + function(t) { + var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1; + l && !n && e.KeyBoardEventInfo(100) + }), + addEventListener("unload", + function() { + null !== c && c.JS_DestroyWorker() + }) + } else o.cbInitPluginComplete && o.cbInitPluginComplete() + }, + this.I_InsertOBJECTPlugin = function(t) { + if (B(t) || (a.szContainerID = t), null == document.getElementById(a.szContainerID)) return -1; + if (null != document.getElementById(o) || 0 != document.getElementsByName(o).length) return -1; + if (re()) { + var n = { + szId: t, + iType: 1, + iWidth: r, + iHeight: s, + iMaxSplit: 4, + iCurrentSplit: a.iWndowType, + szBasePath: f.getDirName() + }, + u = a.szColorProperty; + if ("" != u) { + for (var l = {}, + d = u.split(";"), p = "", P = 0, h = d.length; h > P; P++) p = d[P], + p.indexOf("sub-background") > -1 ? l.background = p.split(":")[1] : p.indexOf("sub-border-select") > - + 1 ? l.borderSelect = p.split(":")[1] : p.indexOf("sub-border") > -1 && (l.border = p.split(":")[1]); + n.oStyle = l + } + c = new JSPlugin(n) + } else document.getElementById(a.szContainerID).innerHTML = F(), + c = f.browser().msie ? document.getElementById(o) : document.getElementsByName(i)[0]; + return null == c && null == c.object ? -1 : ("object" == typeof e.attachEvent && f.browser().msie && (c + .attachEvent("GetSelectWndInfo", GetSelectWndInfo), c.attachEvent("ZoomInfoCallback", + ZoomInfoCallback), c.attachEvent("GetHttpInfo", GetHttpInfo), c.attachEvent("PluginEventHandler", + PluginEventHandler), c.attachEvent("RemoteConfigInfo", RemoteConfigInfo), c.attachEvent( + "KeyBoardEventInfo", KeyBoardEventInfo)), U(), 0) + }, + this.I_WriteOBJECT_XHTML = function() { + return re() ? -1 : (document.writeln(F()), c = f.browser().msie ? document.getElementById(o) : document + .getElementsByName(i)[0], null == c && null == c.object ? -1 : ("object" == typeof e.attachEvent && f + .browser().msie && (c.attachEvent("GetSelectWndInfo", GetSelectWndInfo), c.attachEvent( + "ZoomInfoCallback", ZoomInfoCallback), c.attachEvent("GetHttpInfo", GetHttpInfo), c.attachEvent( + "PluginEventHandler", PluginEventHandler), c.attachEvent("RemoteConfigInfo", RemoteConfigInfo), c + .attachEvent("KeyBoardEventInfo", KeyBoardEventInfo)), U(), 0)) + }, + this.I_OpenFileDlg = function(e) { + var t = ""; + if (re()) return t; + if (t = c.HWP_OpenFileBrowser(e, ""), null == t) return ""; + if (1 == e) { + if (t.length > 100) return -1 + } else if (t.length > 130) return -1; + return t + }, + this.I_GetLocalCfg = function() { + var e = null; + if (re()) return e; + var t = c.HWP_GetLocalConfig(), + r = []; + + return C = f.loadXML(t), + r.push(""), + r.push("" + n.$XML(C).find("ProtocolType").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PackgeSize").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PlayWndType").eq(0).text() + ""), + r.push("" + n.$XML(C).find("BuffNumberType").eq(0).text() + ""), + r.push("" + n.$XML(C).find("RecordPath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("CapturePath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PlaybackFilePath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PlaybackPicPath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("DeviceCapturePath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("DownloadPath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("IVSMode").eq(0).text() + ""), + r.push("" + n.$XML(C).find("CaptureFileFormat").eq(0).text() + ""), + r.push(""), + e = f.loadXML(r.join("")) + }, + this.I_SetLocalCfg = function(e) { + if (re()) return -1; + // console.log("227"); + var t = f.loadXML(e), + r = !1; + // console.log("285 t", t, e); + return n.$XML(C).find("ProtocolType").eq(0).text(n.$XML(t).find("ProtocolType").eq(0).text()), + n.$XML(C).find("PackgeSize").eq(0).text(n.$XML(t).find("PackgeSize").eq(0).text()), + n.$XML(C).find("PlayWndType").eq(0).text(n.$XML(t).find("PlayWndType").eq(0).text()), + n.$XML(C).find("BuffNumberType").eq(0).text(n.$XML(t).find("BuffNumberType").eq(0).text()), + n.$XML(C).find("RecordPath").eq(0).text(n.$XML(t).find("RecordPath").eq(0).text()), + n.$XML(C).find("CapturePath").eq(0).text(n.$XML(t).find("CapturePath").eq(0).text()), + n.$XML(C).find("PlaybackFilePath").eq(0).text(n.$XML(t).find("PlaybackFilePath").eq(0).text()), + n.$XML(C).find("DeviceCapturePath").eq(0).text(n.$XML(t).find("DeviceCapturePath").eq(0).text()), + n.$XML(C).find("PlaybackPicPath").eq(0).text(n.$XML(t).find("PlaybackPicPath").eq(0).text()), + n.$XML(C).find("DownloadPath").eq(0).text(n.$XML(t).find("DownloadPath").eq(0).text()), + n.$XML(C).find("IVSMode").eq(0).text(n.$XML(t).find("IVSMode").eq(0).text()), + n.$XML(C).find("CaptureFileFormat").eq(0).text(n.$XML(t).find("CaptureFileFormat").eq(0).text()), + r = c.HWP_SetLocalConfig(f.toXMLStr(C)), + r ? 0 : -1 + }; + var ie = function(e, t, n, r, s, o, i) { + var a = { + protocol: t, + success: null, + error: null + }; + f.extend(a, i), + f.extend(a, { + success: function(a) { + var c = new ae; + c.szIP = e, + 2 == t ? (c.szHttpProtocol = "https://", c.iHttpsPort = n) : (c.szHttpProtocol = "http://", c + .iHttpPort = n), + c.iCGIPort = n, + c.szDeviceIdentify = e + "_" + n, + c.szAuth = r, + c.iDeviceProtocol = s, + c.oProtocolInc = o, + d.push(c), + _("使用%s协议登录成功", s), + V(c), + O(), + j(c), + i.success && i.success(a) + }, + error: function(e, t) { + i.error && i.error(e, t) + } + }), + o.login(e, n, r, a) + }; + this.I_Login = function(t, r, s, o, i, a) { + var c = t + "_" + s, + u = this.findDeviceIndexByIP(c); + if (-1 != u) return _("设备已经登录过"), + -1; + var l = h, + p = S; + if (B(a.cgi) || (S == a.cgi ? (l = h, p = S) : (l = I, p = v)), re()) + if (S == p) { + var P = { + success: null, + error: null + }; + f.extend(P, { + success: function(c) { + var u = { + success: null, + error: null + }; + f.extend(u, { + success: function(o) { + var i = new ae; + i.szIP = t, + 2 == r ? (i.szHttpProtocol = "https://", i.iHttpsPort = s) : (i.szHttpProtocol = + "http://", i.iHttpPort = s), + i.iCGIPort = s, + i.szDeviceIdentify = t + "_" + s, + i.szAuth = n.$XML(o).find("sessionID").eq(0).text(), + i.iDeviceProtocol = p, + i.oProtocolInc = l, + d.push(i), + _("使用%s协议登录成功", p), + V(i), + j(i), + i.sessionFailed = 0, + i.sesstionTimer = setInterval(function() { + l.sessionHeartbeat(i, + function() { + i.sessionFailed = 0 + }, + function() { + i.sessionFailed++, + i.sessionFailed >= 5 && (clearInterval(i.sesstionTimer), e + .PluginEventHandler(G, i.szDeviceIdentify)) + }) + }, + 3e4), + a.success && a.success(o) + }, + error: function(e, t) { + a.error && a.error(e, t) + } + }), + l.sessionLogin(t, r, s, o, i, c, u) + }, + error: function(e, t) { + a.error && a.error(e, t) + } + }), + l.getSessionCap(t, r, s, o, P) + } else a.error && a.error(403, oe()); + else { + var m = ""; + if (S == p) { + m = f.Base64.encode(":" + o + ":" + i); + var P = { + success: null, + error: null + }; + f.extend(P, a), + f.extend(P, { + error: function(e, n) { + m = f.Base64.encode(o + ":" + i), + p = S, + l = h; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function() { + if (!B(a.cgi)) return void(a.error && a.error(e, n)); + m = f.Base64.encode(":" + o + ":" + i), + p = v, + l = I; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function(e, n) { + m = f.Base64.encode(o + ":" + i), + p = v, + l = I; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function() { + a.error && a.error(e, n) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, P) + } else { + m = f.Base64.encode(":" + o + ":" + i), + p = v, + l = I; + var P = { + success: null, + error: null + }; + f.extend(P, a), + f.extend(P, { + error: function(e, n) { + m = f.Base64.encode(o + ":" + i), + p = v, + l = I; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function() { + a.error && a.error(e, n) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, P) + } + } + }, + this.I_Logout = function(e) { + var t = this.findDeviceIndexByIP(e); + if (-1 != t) { + if (re()) { + var n = d[t]; + clearInterval(n.sesstionTimer), + n.oProtocolInc.sessionLogout(n, {}) + } + return d.splice(t, 1), + 0 + } + return -1 + }, + this.I_GetAudioInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if (-1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getAudioInfo(r, s) + } + }, + this.I_GetDeviceInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if (-1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getDeviceInfo(r, s) + } + }, + this.I_GetAnalogChannelInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if (-1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getAnalogChannelInfo(r, s) + } + }, + this.I_GetDigitalChannelInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if (-1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getDigitalChannelInfo(r, s) + } + }, + this.I_GetZeroChannelInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if (-1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getZeroChannelInfo(r, s) + } + }, + this.I_StartRealPlay = function(e, t) { + var r = this.findDeviceIndexByIP(e), + s = "", + o = "", + i = -1, + a = 0, + c = 0, + l = !1, + P = { + iWndIndex: u, + iStreamType: 1, + iChannelID: 1, + bZeroChannel: !1 + }; + if (f.extend(P, t), -1 != r) { + te(d[r]); + var h = d[r]; + if (re()) { + if (!h.bSupportWebsocket) return void(t.error && t.error(403, oe())); + s = h.oProtocolInc.CGI.startWsRealPlay, + o = "ws://", + B(P.iWSPort) ? h.iWSPort = 7681 : h.iWSPort = P.iWSPort, + i = h.iWSPort, + c = P.iStreamType, + a = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID : h.oStreamCapa.iIpChanBase + parseInt(P + .iChannelID, 10) - h.iAnalogChannelNum - 1, + l = !0 + } else { + var I = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10); + I == W && h.oStreamCapa.bSupportShttpPlay ? (_("SHTTP RealPlay"), s = h.oProtocolInc.CGI + .startShttpRealPlay, o = "http://", c = P.iStreamType - 1, a = P.iChannelID <= h.iAnalogChannelNum ? + P.iChannelID : h.oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, + l = !0, B(P.iPort) ? "https://" == h.szHttpProtocol ? (-1 == h.iHttpPort && (h.iHttpPort = J(h) + .iHttpPort), i = h.iHttpPort) : i = h.iCGIPort : (h.iHttpPort = P.iPort, i = P.iPort)) : (_( + "RTSP RealPlay"), s = h.oProtocolInc.CGI.startRealPlay, o = "rtsp://", c = P.iStreamType, a = P + .iChannelID, B(P.iRtspPort) || (h.iRtspPort = P.iRtspPort), -1 == h.iRtspPort && (h.iRtspPort = J(h) + .iRtspPort), i = h.iRtspPort) + } + if (-1 == i) return _("获取端口号失败"), + void(t.error && t.error()); + if (f.extend(P, { + urlProtocol: o, + cgi: s, + iPort: i, + iStreamType: c, + iChannelID: a + }), r = this.findWndIndexByIndex(P.iWndIndex), -1 == r) + if (re()) h.oProtocolInc.startRealPlay(h, P).then(function() { + r = this.findWndIndexByIndex(P.iWndIndex); + var e = p[r]; + e.bShttpIPChannel = l, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + // console.log(h, P); + var m = h.oProtocolInc.startRealPlay(h, P); + if (0 == m) { + r = this.findWndIndexByIndex(P.iWndIndex); + var S = p[r]; + S.bShttpIPChannel = l, + t.success && t.success() + } else h.iRtspPort = -1, + t.error && t.error() + } + } else t.error && t.error() + }, + this.I_Stop = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + var r = p[n]; + if (r.bRecord && (re() || c.HWP_StopSave(r.iIndex)), r.bSound && (re() || c.HWP_CloseSound()), r.bEZoom && + (re() || c.HWP_DisableZoom(r.iIndex)), re()) c.JS_Stop(t.iWndIndex).then(function() { + p.splice(n, 1), + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var s = c.HWP_Stop(t.iWndIndex); + 0 == s ? (p.splice(n, 1), t.success && t.success()) : t.error && t.error() + } + } else t.error && t.error() + }, + this.I_OpenSound = function(e) { + e = B(e) ? u : e; + var t = this.findWndIndexByIndex(e), + n = -1; + if (-1 != t) { + var r = p[t]; + r.bSound || (n = re() ? c.JS_OpenSound(e) : c.HWP_OpenSound(e), 0 == n && (r.bSound = !0)) + } + return n + }, + this.I_CloseSound = function(e) { + e = B(e) ? u : e; + var t = this.findWndIndexByIndex(e), + n = -1; + if (-1 != t) { + var r = p[t]; + r.bSound && (n = re() ? c.JS_CloseSound() : c.HWP_CloseSound(), 0 == n && (r.bSound = !1)) + } + return n + }, + this.I_SetVolume = function(e, t) { + var n = -1; + if (e = parseInt(e, 10), isNaN(e)) return n; + if (0 > e || e > 100) return n; + t = B(t) ? u : t; + var r = this.findWndIndexByIndex(t); + return -1 != r && (re() ? (c.JS_SetVolume(t, e), n = 0) : n = c.HWP_SetVolume(t, e)), + n + }, + this.I_CapturePic = function(e, t) { + var n = { + iWndIndex: u, + bDateDir: !0 + }; + N(t) ? f.extend(n, t) : B(t) || (n.iWndIndex = t); + var r = this.findWndIndexByIndex(n.iWndIndex), + s = -1; + if (-1 != r) + if (re()) { + var o = "JPEG"; + ".jpg" === e.slice(-4).toLowerCase() ? e = e.slice(0, -4) : ".jpeg" === e.slice(-5).toLowerCase() ? e = + e.slice(0, -5) : ".bmp" === e.slice(-4).toLowerCase() && (e = e.slice(0, -4), o = "BMP"), + s = c.JS_CapturePicture(n.iWndIndex, e, o) + } else ".jpg" === e.slice(-4).toLowerCase() ? e = e.slice(0, -4) : ".jpeg" === e.slice(-5) + .toLowerCase() && (e = e.slice(0, -5)), + s = c.HWP_CapturePicture(n.iWndIndex, e, n.bDateDir); + return s + }, + this.I_StartRecord = function(e, t) { + var n = { + iWndIndex: u, + bDateDir: !0 + }; + N(t) ? f.extend(n, t) : B(t) || (n.iWndIndex = t); + var r = this.findWndIndexByIndex(n.iWndIndex); + if (-1 != r) { + var s = p[r]; + if (s.bRecord) n.error && n.error(); + else if (re()) { + var o = f.browser(); + o.chrome ? c.JS_StartSave(n.iWndIndex, e).then(function() { + s.bRecord = !0, + n.success && n.success() + }, + function() { + n.error && n.error() + }) : n.error && n.error() + } else { + var i = c.HWP_StartSave(n.iWndIndex, e, n.bDateDir); + 0 == i ? (s.bRecord = !0, n.success && n.success()) : n.error && n.error() + } + } else n.error && n.error() + }, + this.I_StopRecord = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + var r = p[n]; + if (r.bRecord) + if (re()) { + var s = f.browser(); + s.chrome ? c.JS_StopSave(t.iWndIndex).then(function() { + r.bRecord = !1, + t.success && t.success() + }, + function() { + t.error && t.error() + }) : t.error && t.error() + } else { + var o = c.HWP_StopSave(t.iWndIndex); + 0 == o ? (r.bRecord = !1, t.success && t.success()) : t.error && t.error() + } + else t.error && t.error() + } else t.error && t.error() + }, + this.I_StartVoiceTalk = function(e, t) { + if (isNaN(parseInt(t, 10))) return -1; + var n = this.findDeviceIndexByIP(e), + r = -1; + if (-1 != n) { + var s = d[n]; + s.bVoiceTalk || (r = re() ? -1 : s.oProtocolInc.startVoiceTalk(s, t), 0 == r && (d[n].bVoiceTalk = !0)) + } + return r + }, + this.I_StopVoiceTalk = function() { + var e = -1; + if (!re()) { + e = c.HWP_StopVoiceTalk(); + for (var t = 0, + n = d.length; n > t; t++) + if (d[t].bVoiceTalk) { + d[t].bVoiceTalk = !1; + break + } + } + return e + }, + this.I_PTZControl = function(e, t, n) { + // debugger + var r = { + iWndIndex: u, + iPTZIndex: e, + iPTZSpeed: 4 + }; + f.extend(r, n), + f.extend(r, { + async: !1 + }); + var s = this.findWndIndexByIndex(r.iWndIndex); + if (-1 != s) { + var o = p[s]; + if (s = this.findDeviceIndexByIP(o.szIP), -1 != s) { + var i = d[s]; + 9 == e ? i.oProtocolInc.ptzAutoControl(i, t, o, r) : i.oProtocolInc.ptzControl(i, t, o, r) + } + } + }, + this.I_EnableEZoom = function(e) { + e = B(e) ? u : e; + var t = this.findWndIndexByIndex(e), + n = -1; + if (-1 != t) { + var r = p[t]; + r.bEZoom || (n = re() ? c.JS_EnableZoom(e) : c.HWP_EnableZoom(e, 0), 0 == n && (r.bEZoom = !0)) + } + return n + }, + this.I_DisableEZoom = function(e) { + e = B(e) ? u : e; + var t = this.findWndIndexByIndex(e), + n = -1; + if (-1 != t) { + var r = p[t]; + r.bEZoom && (re() ? n = c.JS_DisableZoom(e) : (c.HWP_DisableZoom(e), n = 0), 0 == n && (r.bEZoom = !1)) + } + return n + }, + this.I_Enable3DZoom = function(e) { + e = B(e) ? u : e; + var t = this.findWndIndexByIndex(e), + n = -1; + if (-1 != t) { + var r = p[t]; + r.b3DZoom || (n = re() ? -1 : c.HWP_EnableZoom(e, 1), 0 == n && (r.b3DZoom = !0)) + } + return n + }, + this.I_Disable3DZoom = function(e) { + e = B(e) ? u : e; + var t = this.findWndIndexByIndex(e), + n = -1; + if (-1 != t) { + var r = p[t]; + r.b3DZoom && (re() ? n = -1 : (c.HWP_DisableZoom(e), n = 0), 0 == n && (r.b3DZoom = !1)) + } + return n + }, + this.I_FullScreen = function(e) { + re() ? c.JS_FullScreenDisplay(e) : c.HWP_FullScreenDisplay(e) + }, + this.I_SetPreset = function(e, t) { + var n = { + iWndIndex: u, + iPresetID: e + }; + f.extend(n, t); + var r = this.findWndIndexByIndex(n.iWndIndex); + if (-1 != r) { + var s = p[r]; + if (r = this.findDeviceIndexByIP(s.szIP), -1 != r) { + var o = d[r]; + o.oProtocolInc.setPreset(o, s, n) + } + } + }, + this.I_GoPreset = function(e, t) { + var n = { + iWndIndex: u, + iPresetID: e + }; + f.extend(n, t); + var r = this.findWndIndexByIndex(n.iWndIndex); + if (-1 != r) { + var s = p[r]; + if (r = this.findDeviceIndexByIP(s.szIP), -1 != r) { + var o = d[r]; + o.oProtocolInc.goPreset(o, s, n) + } + } + }, + this.I_RecordSearch = function(e, t, n, r, s) { + var o = this.findDeviceIndexByIP(e); + if (-1 != o) { + var i = d[o], + a = { + iChannelID: t, + szStartTime: n, + szEndTime: r, + iSearchPos: 0, + iStreamType: 1, + success: null, + error: null + }; + f.extend(a, s), + i.oProtocolInc.recordSearch(i, a) + } + }, + this.I_StartPlayback = function(e, t) { + var r = this.findDeviceIndexByIP(e), + s = "", + o = "", + i = -1, + a = 1, + c = 0, + l = f.dateFormat(new Date, "yyyy-MM-dd"), + p = { + iWndIndex: u, + iStreamType: 1, + iChannelID: 1, + szStartTime: l + " 00:00:00", + szEndTime: l + " 23:59:59" + }; + if (f.extend(p, t), -1 != r) { + te(d[r]); + var P = d[r]; + if (re()) { + if (!P.bSupportWebsocket) return void(t.error && t.error(403, oe())); + if (!B(p.oTransCodeParam)) return void(t.error && t.error()); + s = P.oProtocolInc.CGI.startWsPlayback, + o = "ws://", + B(p.iWSPort) ? P.iWSPort = 7681 : P.iWSPort = p.iWSPort, + i = P.iWSPort, + c = p.iStreamType, + a = p.iChannelID <= P.iAnalogChannelNum ? p.iChannelID : P.oStreamCapa.iIpChanBase + parseInt(p + .iChannelID, 10) - P.iAnalogChannelNum - 1, + a = 100 * a + c + } else { + var h = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10); + h == W && P.oStreamCapa.bSupportShttpPlay ? (s = B(p.oTransCodeParam) ? P.oProtocolInc.CGI + .startShttpPlayback : P.oProtocolInc.CGI.startTransCodePlayback, o = "http://", c = p.iStreamType - + 1, a = p.iChannelID <= P.iAnalogChannelNum ? p.iChannelID : P.oStreamCapa.iIpChanBase + parseInt(p + .iChannelID, 10) - P.iAnalogChannelNum - 1, P.bSupportSubStreamPlayback && (a = 100 * a + c), B(p + .iPort) ? "https://" == P.szHttpProtocol ? (-1 == P.iHttpPort && (P.iHttpPort = J(P).iHttpPort), + i = P.iHttpPort) : i = P.iCGIPort : (P.iHttpPort = p.iPort, i = p.iPort)) : (s = P.oProtocolInc + .CGI.startPlayback, o = "rtsp://", c = p.iStreamType, a = 100 * p.iChannelID + c, B(p.iRtspPort) || + (P.iRtspPort = p.iRtspPort), -1 == P.iRtspPort && (P.iRtspPort = J(P).iRtspPort), i = P.iRtspPort) + } + if (-1 == i) return _("获取端口号失败"), + void(t.error && t.error()); + if (f.extend(p, { + urlProtocol: o, + cgi: s, + iPort: i, + iChannelID: a + }), r = this.findWndIndexByIndex(p.iWndIndex), -1 == r) + if (re()) p.szStartTime = p.szStartTime.replace(" ", "T") + "Z", + p.szEndTime = p.szEndTime.replace(" ", "T") + "Z", + P.oProtocolInc.startPlayback(P, p).then(function() { + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + p.szStartTime = p.szStartTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", + p.szEndTime = p.szEndTime.replace(/[-:]/g, "").replace(" ", "T") + "Z"; + var I = P.oProtocolInc.startPlayback(P, p); + 0 == I ? t.success && t.success() : (P.iRtspPort = -1, t.error && t.error()) + } + } else t.error && t.error() + }, + this.I_ReversePlayback = function(e, t) { + var r = this.findDeviceIndexByIP(e), + s = -1, + o = "", + i = "", + a = -1, + c = -1, + l = 0, + p = f.dateFormat(new Date, "yyyy-MM-dd"), + P = { + iWndIndex: u, + iStreamType: 1, + iChannelID: 1, + szStartTime: p + " 00:00:00", + szEndTime: p + " 23:59:59" + }; + if (f.extend(P, t), -1 != r) { + te(d[r]); + var h = d[r]; + if (re()) return s; + var I = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10); + if (I == W && h.oStreamCapa.bSupportShttpPlay ? (o = h.oProtocolInc.CGI.startShttpReversePlayback, i = + "http://", l = P.iStreamType - 1, c = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID : h + .oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, c = 100 * c + l, B(P + .iPort) ? "https://" == h.szHttpProtocol ? (-1 == h.iHttpPort && (h.iHttpPort = J(h).iHttpPort), a = + h.iHttpPort) : a = h.iCGIPort : (h.iHttpPort = P.iPort, a = P.iPort)) : (o = h.oProtocolInc.CGI + .startPlayback, i = "rtsp://", l = P.iStreamType, c = 100 * P.iChannelID + l, B(P.iRtspPort) || (h + .iRtspPort = P.iRtspPort), -1 == h.iRtspPort && (h.iRtspPort = J(h).iRtspPort), a = h.iRtspPort), - + 1 == a) return _("获取端口号失败"), + s; + f.extend(P, { + urlProtocol: i, + cgi: o, + iPort: a, + iChannelID: c + }), + r = this.findWndIndexByIndex(P.iWndIndex), + -1 == r && (P.szStartTime = P.szStartTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", P.szEndTime = P + .szEndTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", s = h.oProtocolInc.reversePlayback(h, P)) + } + return -1 == s && (h.iRtspPort = -1), + s + }, + this.I_Frame = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + var r = p[n], + s = r.iPlayStatus; + if (s == D || s == T) + if (re()) c.JS_FrameForward(t.iWndIndex).then(function() { + r.iPlayStatus = T, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var o = c.HWP_FrameForward(t.iWndIndex); + 0 == o ? (r.iPlayStatus = T, t.success && t.success()) : t.error && t.error() + } + else t.error && t.error() + } else t.error && t.error() + }, + this.I_Pause = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + var r = p[n], + s = r.iPlayStatus, + o = -1; + if (s == D) o = z; + else { + if (s != b) return void(t.error && t.error()); + o = A + } + if (re()) c.JS_Pause(t.iWndIndex).then(function() { + r.iPlayStatus = o, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var i = c.HWP_Pause(t.iWndIndex); + 0 == i ? (r.iPlayStatus = o, t.success && t.success()) : t.error && t.error() + } + } else t.error && t.error() + }, + this.I_Resume = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + var r = p[n], + s = r.iPlayStatus, + o = -1; + if (s == z || s == T) o = D; + else { + if (s != A) return void(t.error && t.error()); + o = b + } + if (re()) c.JS_Resume(t.iWndIndex).then(function() { + r.iPlayStatus = o, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var i = c.HWP_Resume(t.iWndIndex); + 0 == i ? (r.iPlayStatus = o, t.success && t.success()) : t.error && t.error() + } + } else t.error && t.error() + }, + this.I_PlaySlow = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + var r = p[n]; + if (r.iPlayStatus == D) + if (re()) { + var s = c.JS_GetWndStatus(t.iWndIndex); + s.iRate <= -4 ? t.error && t.error() : c.JS_Slow(t.iWndIndex).then(function() { + t.success && t.success() + }, + function() { + t.error && t.error() + }) + } else { + var o = c.HWP_Slow(t.iWndIndex); + 0 == o ? t.success && t.success() : t.error && t.error() + } + else t.error && t.error() + } else t.error && t.error() + }, + this.I_PlayFast = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + var r = p[n]; + if (r.iPlayStatus == D) + if (re()) { + var s = c.JS_GetWndStatus(t.iWndIndex); + s.iRate >= 4 ? t.error && t.error() : c.JS_Fast(t.iWndIndex).then(function() { + t.success && t.success() + }, + function() { + t.error && t.error() + }) + } else { + var o = c.HWP_Fast(t.iWndIndex); + 0 == o ? t.success && t.success() : t.error && t.error() + } + else t.error && t.error() + } else t.error && t.error() + }, + this.I_GetOSDTime = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if (-1 != n) { + if (re()) c.JS_GetOSDTime(t.iWndIndex).then(function(e) { + if (t.success) { + var n = f.dateFormat(new Date(1e3 * e), "yyyy-MM-dd hh:mm:ss"); + t.success(n) + } + }, + function() { + t.error && t.error() + }); + else if (t.success) { + var r = c.HWP_GetOSDTime(t.iWndIndex), + s = f.dateFormat(new Date(1e3 * r), "yyyy-MM-dd hh:mm:ss"); + t.success(s) + } + } else t.error && t.error() + }, + this.I_StartDownloadRecord = function(e, t, n, r) { + var s = this.findDeviceIndexByIP(e), + o = -1; + if (-1 != s) { + var i = d[s], + a = { + szPlaybackURI: t, + szFileName: n, + bDateDir: !0 + }; + B(r) || f.extend(a, r), + o = i.oProtocolInc.startDownloadRecord(i, a) + } + return o + }, + this.I_GetDownloadStatus = function(e) { + var t = -1; + return re() ? t : (t = c.HWP_GetDownloadStatus(e), 1 == t && (t = -1), t) + }, + this.I_GetDownloadProgress = function(e) { + return re() ? -1 : c.HWP_GetDownloadProgress(e); + }, + this.I_StopDownloadRecord = function(e) { + return re() ? -1 : c.HWP_StopDownload(e) + }, + this.I_ExportDeviceConfig = function(e) { + var t = this.findDeviceIndexByIP(e), + n = -1; + if (-1 != t) { + var r = d[t]; + if (re()) return n; + n = r.oProtocolInc.exportDeviceConfig(r) + } + return n + }, + this.I_ImportDeviceConfig = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = -1; + if (-1 != n) { + var s = d[n], + o = { + szFileName: t + }; + if (re()) return r; + r = s.oProtocolInc.importDeviceConfig(s, o) + } + return r + }, + this.I_RestoreDefault = function(e, t, n) { + var r = { + success: null, + error: null + }; + f.extend(r, n); + var s = this.findDeviceIndexByIP(e); + if (-1 != s) { + var o = d[s]; + o.oProtocolInc.restore(o, t, r) + } + }, + this.I_Restart = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = { + success: null, + error: null + }; + if (f.extend(r, t), -1 != n) { + var s = d[n]; + s.oProtocolInc.restart(s, r) + } + }, + this.I_Reconnect = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = { + success: null, + error: null + }; + if (f.extend(r, t), -1 != n) { + var s = d[n]; + s.oProtocolInc.login(s.szIP, s.iCGIPort, s.szAuth, r) + } + }, + this.I_StartUpgrade = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = -1; + if (-1 != n) { + var s = d[n], + o = { + szFileName: t + }; + if (re()) return r; + r = s.oProtocolInc.startUpgrade(s, o) + } + return r + }, + this.I_UpgradeStatus = function() { + return re() ? -1 : c.HWP_UpgradeStatus() + }, + this.I_UpgradeProgress = function() { + return re() ? -1 : c.HWP_UpgradeProgress() + }, + this.I_StopUpgrade = function() { + return re() ? -1 : c.HWP_StopUpgrade() + }, + this.I_CheckPluginInstall = function() { + var e = -1, + t = f.browser(); + if (re()) e = 0; + else if (t.msie) try { + new ActiveXObject("WebVideoKitActiveX.WebVideoKitActiveXCtrl.1"); + e = 0 + } catch (n) {} else + for (var r = 0, + s = navigator.mimeTypes.length; s > r; r++) + if ("application/webvideo-plugin-kit" == navigator.mimeTypes[r].type.toLowerCase()) { + e = 0; + break + } + return e + }, + this.I_CheckPluginVersion = function() { + return re() ? 0 : c.HWP_CheckPluginUpdate(k) ? -1 : 0 + }, + this.I_SendHTTPRequest = function(e, t, n) { + var r = this.findDeviceIndexByIP(e); + if (!(0 > r)) { + var s = d[r], + o = new ue, + i = s.szHttpProtocol + s.szIP + ":" + s.iCGIPort + "/" + t, + a = { + type: "GET", + url: i, + auth: s.szAuth, + success: null, + error: null + }; + f.extend(a, n), + f.extend(a, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + o.setRequestParam(a), + o.submitRequest() + } + }, + this.I_RemoteConfig = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = -1, + s = -1; + if (re()) return r; + var o = { + iLan: 0, + iDevicePort: -1, + iType: 0 + }; + if (f.extend(o, t), -1 != n) { + var i = d[n]; + if (-1 == o.iDevicePort) + if (-1 == i.iDevicePort) { + if (i.iDevicePort = J(i).iDevicePort, s = i.iDevicePort, -1 == s) return r + } else s = i.iDevicePort; + else s = o.iDevicePort; + if (":" == f.Base64.decode(i.szAuth)[0]) var a = f.Base64.decode(i.szAuth).split(":")[1], + u = f.Base64.decode(i.szAuth).split(":")[2]; + else var a = f.Base64.decode(i.szAuth).split(":")[0], + u = f.Base64.decode(i.szAuth).split(":")[1]; + var l = "" + o.iType + "" + o.iLan + + "" + i.szIP + "" + s + "" + a + "" + f.Base64 + .encode(u) + ""; + return c.HWP_ShowRemConfig(l) + } + return r + }, + this.I_ChangeWndNum = function(e) { + return isNaN(parseInt(e, 10)) ? -1 : (re() ? c.JS_ArrangeWindow(e) : c.HWP_ArrangeWindow(e), 0) + }, + this.I_GetLastError = function() { + return re() ? -1 : c.HWP_GetLastError() + }, + this.I_GetWindowStatus = function(e) { + if (B(e)) { + var t = []; + return f.extend(t, p), + t + } + var n = this.findWndIndexByIndex(e); + if (-1 != n) { + var t = {}; + return f.extend(t, p[n]), + t + } + return null + }, + this.I_GetIPInfoByMode = function(e, t, n, r) { + return re() ? "" : c.HWP_GetIpInfoByMode(e, t, n, r) + }, + this.I_SetPlayModeType = function(e) { + return re() ? -1 : c.HWP_SetPlayModeType(e) + }, + this.I_SetSnapDrawMode = function(e, t) { + return re() ? -1 : c.HWP_SetSnapDrawMode(e, t) + }, + this.I_SetSnapPolygonInfo = function(e, t) { + if (re()) return -1; + var r, s, o, i, a, u, l, d, p, P, h, I, m, C = c.HWP_GetSnapPolygonInfo(e); + // console.log("921", r); + r = f.loadXML(C), + s = n.$XML(r).find("SnapPolygon", !0); + + var S = s.length, + v = []; + for (o = 0, i = s.length; i > o; o++) a = s[o], + v.push(n.$XML(a).find("id").eq(0).text()); + var y = v.join(","); + // console.log("927"); + if (y = "," + y + ",", r = f.loadXML(t), s = n.$XML(r).find("SnapPolygon", !0), S + s.length > 32) return - + 3; + for (o = 0, i = s.length; i > o; o++) { + if (a = s[o], u = n.$XML(a).find("id").eq(0).text(), !f.isInt(u)) return -2; + if (l = parseInt(u, 10), 1 > l || l > 32) return -2; + if (y.indexOf("," + u + ",") > -1) return -4; + if (d = n.$XML(a).find("tips").eq(0).text(), d.length > 32) return -2; + if (h = "true" === n.$XML(a).find("isClosed").eq(0).text(), !h) { + if (p = n.$XML(a).find("MinClosed").eq(0).text(), !f.isInt(p)) return -2; + if (P = parseInt(p, 10), 4 > P || P > 17) return -2; + if (I = n.$XML(a).find("PointNumMax").eq(0).text(), !f.isInt(I)) return -2; + if (m = parseInt(I, 10), P > m || m > 17) return -2 + } + } + return c.HWP_SetSnapPolygonInfo(e, t) + }, + this.I_GetSnapPolygonInfo = function(e) { + return re() ? "" : c.HWP_GetSnapPolygonInfo(e) + }, + this.I_ClearSnapInfo = function(e) { + return re() ? -1 : c.HWP_ClearSnapInfo(e, 1) + }, + this.I_DeviceCapturePic = function(e, t, n, r) { + var s = this.findDeviceIndexByIP(e), + o = -1; + if (-1 != s) { + var i = d[s], + a = { + bDateDir: !0 + }; + if (f.extend(a, r), !B(a.iResolutionWidth) && !f.isInt(a.iResolutionWidth)) return o; + if (!B(a.iResolutionHeight) && !f.isInt(a.iResolutionHeight)) return o; + o = i.oProtocolInc.deviceCapturePic(i, t, n, a) + } + return o + }, + this.I_SetPackageType = function(e) { + return re() ? -1 : c.HWP_SetPackageType(e) + }, + this.I_GetDevicePort = function(e) { + + var t = this.findDeviceIndexByIP(e), + n = null; + if (-1 != t) { + var r = d[t]; + n = J(r) + } + return n + }, + this.findDeviceIndexByIP = function(e) { + if (e.indexOf("_") > -1) { + for (var t = 0, + n = d.length; n > t; t++) + if (d[t].szDeviceIdentify == e) return t + } else + for (var t = 0, + n = d.length; n > t; t++) + if (d[t].szIP == e) return t; + return -1 + }, + this.findWndIndexByIndex = function(e) { + for (var t = 0, + n = p.length; n > t; t++) + if (p[t].iIndex == e) return t; + return -1 + }; + var ae = function() { + this.szIP = "", + this.szHostName = "", + this.szAuth = "", + this.szHttpProtocol = "http://", + this.iCGIPort = 80, + this.szDeviceIdentify = "", + this.iDevicePort = -1, + this.iHttpPort = -1, + this.iHttpsPort = -1, + this.iRtspPort = -1, + this.iWSPort = -1, + this.iAudioType = 1, + this.m_iAudioBitRate = -1, + this.m_iAudioSamplingRate = -1, + this.iDeviceProtocol = S, + this.oProtocolInc = null, + this.iAnalogChannelNum = 0, + this.szDeviceType = "", + this.bVoiceTalk = !1, + this.oStreamCapa = { + bObtained: !1, + bSupportShttpPlay: !1, + bSupportShttpPlayback: !1, + bSupportShttpsPlay: !1, + bSupportShttpsPlayback: !1, + bSupportShttpPlaybackTransCode: !1, + bSupportShttpsPlaybackTransCode: !1, + iIpChanBase: 1 + } + }, + ce = function() { + this.iIndex = 0, + this.szIP = "", + this.iCGIPort = 80, + this.szDeviceIdentify = "", + this.iChannelID = "", + this.iPlayStatus = g, + this.bSound = !1, + this.bRecord = !1, + this.bPTZAuto = !1, + this.bEZoom = !1, + this.b3DZoom = !1 + }, + ue = function() { + this.options = { + type: "GET", + url: "", + auth: "", + timeout: 1e4, + data: "", + async: !0, + success: null, + error: null + }, + this.m_szHttpHead = "", + this.m_szHttpContent = "", + this.m_szHttpData = "" + }; + ue.prototype.m_httpRequestSet = [], + ue.prototype.setRequestParam = function(e) { + f.extend(this.options, e) + }, + ue.prototype.submitRequest = function() { + var t = null, + n = this; + if (re()) { + console.log("submitRequest>>>>>e") + this.options.auth ? f.cookie("WebSession", this.options.auth) : f.cookie("WebSession", null); + console.log("this.options.auth>>>>>", this.options.auth) + console.log("this.options.url>>>>>", this.options.url) + console.log("this.options.data>>>>>", this.options.data) + var r = se(this.options.url), + // var r = se("http://192.168.3.175:80/ISAPI/Security/sessionLogin"), + s = new XMLHttpRequest(); + s.open(this.options.type, r, this.options.async), + s.setRequestHeader("X-Requested-With", "XMLHttpRequest"), + s.setRequestHeader("If-Modified-Since", "0"), + s.send(this.options.data || null); + var o = function() { + if (4 === s.readyState) { + t = { + funSuccessCallback: n.options.success, + funErrorCallback: n.options.error + }; + var e = s.status + s.responseText; + 0 === s.status && (e = ""), + console.log("submitRequest>>>>>t111", t) + console.log("submitRequest>>>>>e11", e) + n.httpDataAnalyse(t, e) + } + }; + this.options.async ? (s.timeout = this.options.timeout, s.onreadystatechange = function() { + o() + }) : o() + } else { + console.log("submitRequest>>>>>e222") + var i = this.getHttpMethod(this.options.type); + if (this.options.async) { + var a = c.HWP_SubmitHttpRequest(i, this.options.url, this.options.auth, this.options.data, this.options + .timeout); - 1 != a && (t = { + iRequestID: a, + funSuccessCallback: this.options.success, + funErrorCallback: this.options.error + }, + this.m_httpRequestSet.push(t)) + } else { + var u = c.HWP_SendHttpSynRequest(i, this.options.url, this.options.auth, this.options.data, this.options + .timeout); + t = { + funSuccessCallback: this.options.success, + funErrorCallback: this.options.error + }, + this.httpDataAnalyse(t, u) + } + } + }, + ue.prototype.getHttpMethod = function(e) { + var t = { + GET: 1, + POST: 2, + PUT: 5, + DELETE: 6 + }, + n = t[e]; + return n ? n : -1 + }, + ue.prototype.processCallback = function(e, t) { + for (var n = null, r = 0; r < this.m_httpRequestSet.length; r++) + if (e == this.m_httpRequestSet[r].iRequestID) { + n = this.m_httpRequestSet[r], + this.m_httpRequestSet.splice(r, 1); + break + } + null != n && (this.httpDataAnalyse(n, t)) + }, + ue.prototype.httpDataAnalyse = function(e, t) { + console.log("httpDataAnalyse>>>>>e", e) + console.log("httpDataAnalyse>>>>>t", t) + var n = "", + r = 0; + + "" == t || B(t) ? e.funErrorCallback() : (r = parseInt(t.substring(0, 3)), n = t.substring(3, t.length), + isNaN(r) ? e.funErrorCallback() : y == r ? e.funSuccessCallback(f.loadXML2(n)) : e.funErrorCallback(r, f + .loadXML2(n))) + }; + var le = function() {}; + le.prototype.CGI = { + login: "%s%s:%s/ISAPI/Security/userCheck", + getAudioInfo: "%s%s:%s/ISAPI/System/TwoWayAudio/channels", + getDeviceInfo: "%s%s:%s/ISAPI/System/deviceInfo", + getAnalogChannelInfo: "%s%s:%s/ISAPI/System/Video/inputs/channels", + getDigitalChannel: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels", + getDigitalChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels/status", + getZeroChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/ZeroVideo/channels", + getStreamChannels: { + analog: "%s%s:%s/ISAPI/Streaming/channels", + digital: "%s%s:%s/ISAPI/ContentMgmt/StreamingProxy/channels" + }, + getStreamDynChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels", + startRealPlay: { + channels: "%s%s:%s/PSIA/streaming/channels/%s", + zeroChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s" + }, + startShttpRealPlay: { + channels: "%s%s:%s/SDK/play/%s/004", + zeroChannels: "%s%s:%s/SDK/play/100/004/ZeroStreaming" + }, + startWsRealPlay: { + channels: "%s%s:%s/%s", + zeroChannels: "%s%s:%s/%s" + }, + startVoiceTalk: { + open: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/open", + close: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/close", + audioData: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/audioData" + }, + ptzControl: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/continuous", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/continuous" + }, + ptzAutoControl: { + ipdome: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto", + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/autoPan", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/autoPan" + }, + setPreset: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s" + }, + goPreset: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s/goto" + }, + ptzFocus: { + analog: "%s%s:%s/ISAPI/Image/channels/%s/focus", + digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/focus", + ipc: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/focus" + }, + ptzIris: { + analog: "%s%s:%s/ISAPI/Image/channels/%s/iris", + digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/iris", + ipc: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/iris" + }, + getNetworkBond: "%s%s:%s/ISAPI/System/Network/Bond", + getNetworkInterface: "%s%s:%s/ISAPI/System/Network/interfaces", + getUPnPPortStatus: "%s%s:%s/ISAPI/System/Network/UPnP/ports/status", + getPPPoEStatus: "%s%s:%s/ISAPI/System/Network/PPPoE/1/status", + getPortInfo: "%s%s:%s/ISAPI/Security/adminAccesses", + recordSearch: "%s%s:%s/ISAPI/ContentMgmt/search", + startPlayback: "%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%s", + startWsPlayback: "%s%s:%s/%s", + startShttpPlayback: "%s%s:%s/SDK/playback/%s", + startShttpReversePlayback: "%s%s:%s/SDK/playback/%s/reversePlay", + startTransCodePlayback: "%s%s:%s/SDK/playback/%s/transcoding", + startDownloadRecord: "%s%s:%s/ISAPI/ContentMgmt/download", + deviceConfig: "%s%s:%s/ISAPI/System/configurationData", + restart: "%s%s:%s/ISAPI/System/reboot", + restore: "%s%s:%s/ISAPI/System/factoryReset?mode=%s", + startUpgrade: { + upgrade: "%s%s:%s/ISAPI/System/updateFirmware", + status: "%s%s:%s/ISAPI/System/upgradeStatus" + }, + set3DZoom: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/position3D", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/position3D" + }, + SDKCapabilities: "%s%s:%s/SDK/capabilities", + deviceCapture: { + channels: "%s%s:%s/ISAPI/Streaming/channels/%s/picture" + }, + sessionCap: "%s%s:%s/ISAPI/Security/sessionLogin/capabilities?username=%s", + sessionLogin: "%s%s:%s/ISAPI/Security/sessionLogin", + sessionHeartbeat: "%s%s:%s/ISAPI/Security/sessionHeartbeat", + sessionLogout: "%s%s:%s/ISAPI/Security/sessionLogout", + systemCapabilities: "%s%s:%s/ISAPI/System/capabilities" + }, + le.prototype.login = function(e, t, n, r) { + var s = 2 == r.protocol ? "https://" : "http://", + o = E(this.CGI.login, s, e, t), + i = new ue, + a = { + type: "GET", + url: o, + auth: n, + success: null, + error: null + }; + f.extend(a, r), + f.extend(a, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + i.setRequestParam(a), + i.submitRequest() + }, + le.prototype.getAudioInfo = function(e, t) { + var n = E(this.CGI.getAudioInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getDeviceInfo = function(e, t) { + var r = E(this.CGI.getDeviceInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""), + r.push("" + f.escape(n.$XML(e).find("deviceName").eq(0).text()) + ""), + r.push("" + n.$XML(e).find("deviceID").eq(0).text() + ""), + r.push("" + n.$XML(e).find("deviceType").eq(0).text() + ""), + r.push("" + n.$XML(e).find("model").eq(0).text() + ""), + r.push("" + n.$XML(e).find("serialNumber").eq(0).text() + ""), + r.push("" + n.$XML(e).find("macAddress").eq(0).text() + ""), + r.push("" + n.$XML(e).find("firmwareVersion").eq(0).text() + + ""), + r.push("" + n.$XML(e).find("firmwareReleasedDate").eq(0).text() + + ""), + r.push("" + n.$XML(e).find("encoderVersion").eq(0).text() + + ""), + r.push("" + n.$XML(e).find("encoderReleasedDate").eq(0).text() + + ""), + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess && t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.getAnalogChannelInfo = function(e, t) { + var r = E(this.CGI.getAnalogChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("VideoInputChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + n.$XML(a).find("inputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("" + n.$XML(a).find("videoFormat").eq(0).text() + ""), + r.push("") + } + // console.log("1171", r); + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess && t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.getDigitalChannel = function(e, t) { + var r = E(this.CGI.getDigitalChannel, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("InputProxyChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("") + } + // console.log("1188", r); + + r.push(""), + e = f.loadXML2(r.join("")), + t.success && t.success(e), + t.mysuccess && t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.getDigitalChannelInfo = function(e, t) { + var r = null, + s = {}; + if (this.getDigitalChannel(e, { + async: !1, + success: function(e) { + r = e; + for (var t = n.$XML(r).find("InputProxyChannel", !0), o = 0, i = t.length; i > o; o++) { + var a = t[o], + c = n.$XML(a).find("id").eq(0).text(), + u = n.$XML(a).find("name").eq(0).text(); + s[c] = u + } + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), null !== r) { + var o = E(this.CGI.getDigitalChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + i = new ue, + a = { + type: "GET", + url: o, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(a, t), + f.extend(a, { + success: function(e) { + var r = []; + r.push(""); + for (var o = n.$XML(e).find("InputProxyChannelStatus", !0), i = 0, a = o.length; a > i; i++) { + var c = o[i], + u = n.$XML(c).find("id").eq(0).text(); + r.push(""), + r.push("" + u + ""), + r.push(""), + r.push("" + n.$XML(c).find("proxyProtocol").eq(0).text() + + ""), + r.push("" + n.$XML(c).find("addressingFormatType").eq(0).text() + + ""), + r.push("" + n.$XML(c).find("ipAddress").eq(0).text() + ""), + r.push("" + n.$XML(c).find("managePortNo").eq(0).text() + ""), + r.push("" + n.$XML(c).find("srcInputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(c).find("userName").eq(0).text()) + ""), + r.push("" + n.$XML(c).find("streamType").eq(0).text() + ""), + r.push("" + n.$XML(c).find("online").eq(0).text() + ""), + r.push("" + f.escape(s[u]) + ""), + r.push(""), + r.push("") + } + // console.log("1217", r); + r.push(""), + e = f.loadXML2(r.join("")), + t.success && t.success(e), + t.mysuccess && t.mysuccess(r.join("")) + // t.success && t.success(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + i.setRequestParam(a), + i.submitRequest() + } + }, + le.prototype.getZeroChannelInfo = function(e, t) { + var n = E(this.CGI.getZeroChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getStreamChannels = function(e, t) { + if (0 != e.iAnalogChannelNum) var n = E(this.CGI.getStreamChannels.analog, e.szHttpProtocol, e.szIP, e + .iCGIPort); + else var n = E(this.CGI.getStreamChannels.digital, e.szHttpProtocol, e.szIP, e.iCGIPort); + var r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getPPPoEStatus = function(e, t) { + var n = E(this.CGI.getPPPoEStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getUPnPPortStatus = function(e, t) { + var n = E(this.CGI.getUPnPPortStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getNetworkBond = function(e, t) { + var n = E(this.CGI.getNetworkBond, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getNetworkInterface = function(e, t) { + + var n = E(this.CGI.getNetworkInterface, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getPortInfo = function(e, t) { + var n = E(this.CGI.getPortInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.startRealPlay = function(e, t) { + var n = 100 * t.iChannelID + t.iStreamType, + r = "", + s = -1, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)), + t.bZeroChannel ? (re() && (n = 0), r = E(t.cgi.zeroChannels, t.urlProtocol, o, t.iPort, n)) : r = E(t.cgi + .channels, t.urlProtocol, o, t.iPort, n); + var i = function() { + var n = new ce; + n.iIndex = t.iWndIndex, + n.szIP = e.szIP, + n.iCGIPort = e.iCGIPort, + n.szDeviceIdentify = e.szDeviceIdentify, + n.iChannelID = t.iChannelID, + n.iPlayStatus = x, + p.push(n) + }; + if (re()) { + var a = new Promise(function(n, s) { + c.JS_Play(r, { + session: e.szAuth + }, + t.iWndIndex).then(function() { + i(), + n() + }, + function() { + s() + }) + }); + return a + } + return s = c.HWP_Play(r, e.szAuth, t.iWndIndex, "", ""), + 0 == s && i(), + s + }, + le.prototype.startVoiceTalk = function(e, t) { + var n = E(this.CGI.startVoiceTalk.open, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + r = E(this.CGI.startVoiceTalk.close, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = E(this.CGI.startVoiceTalk.audioData, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + o = c.HWP_StartVoiceTalkEx(n, r, s, e.szAuth, e.iAudioType, e.m_iAudioBitRate, e.m_iAudioSamplingRate); + return o + }, + le.prototype.ptzAutoControl = function(e, t, n, r) { + var s = n.iChannelID, + o = "", + i = ""; + if (r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100, t && (r.iPTZSpeed = 0), e.szDeviceType != w) o = + s <= e.iAnalogChannelNum ? E(this.CGI.ptzAutoControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n + .iChannelID) : n.bShttpIPChannel ? E(this.CGI.ptzAutoControl.digital, e.szHttpProtocol, e.szIP, e + .iCGIPort, n.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(this.CGI + .ptzAutoControl.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID), + i = "" + r.iPTZSpeed + + ""; + else { + var a = 99; + t && (a = 96), + o = E(this.CGI.ptzAutoControl.ipdome, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID, a) + } + var c = new ue, + u = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }, + l = this; + f.extend(u, r), + f.extend(u, { + success: function(e) { + n.bPTZAuto = !n.bPTZAuto, + r.success && r.success(e) + }, + error: function(t, s) { + if (X == e.szDeviceType || H == e.szDeviceType) { + o = n.bShttpIPChannel ? E(l.CGI.ptzControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n + .iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(l.CGI.ptzControl + .analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID), + i = "" + r.iPTZSpeed + + "0"; + var a = new ue, + c = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }; + f.extend(c, r), + a.setRequestParam(c), + a.submitRequest() + } else r.error && r.error(t, s) + } + }), + c.setRequestParam(u), + c.submitRequest() + }, + le.prototype.ptzControl = function(e, t, n, r) { + var s = n.iChannelID, + o = ""; + n.bPTZAuto && this.ptzAutoControl(e, !0, n, { + iPTZSpeed: 0 + }), + t ? r.iPTZSpeed = 0 : r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100; + var i = [{}, + { + pan: 0, + tilt: r.iPTZSpeed + }, + { + pan: 0, + tilt: -r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: 0 + }, + { + pan: r.iPTZSpeed, + tilt: 0 + }, + { + pan: -r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + {}, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + } + ], + a = "", + c = {}; + switch (r.iPTZIndex) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + c = this.CGI.ptzControl, + a = "" + i[r.iPTZIndex].pan + "" + i[r + .iPTZIndex].tilt + ""; + break; + case 10: + case 11: + c = this.CGI.ptzControl, + a = "" + i[r.iPTZIndex].speed + + ""; + break; + case 12: + case 13: + c = this.CGI.ptzFocus, + a = "" + i[r.iPTZIndex].speed + + ""; + break; + case 14: + case 15: + c = this.CGI.ptzIris, + a = "" + i[r.iPTZIndex].speed + + ""; + break; + default: + return void(r.error && r.error()) + } + o = c != this.CGI.ptzFocus && c != this.CGI.ptzIris || e.szDeviceType != X && e.szDeviceType != w && e + .szDeviceType != H ? s <= e.iAnalogChannelNum ? E(c.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n + .iChannelID) : n.bShttpIPChannel ? E(c.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID - e + .oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(c.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, + n.iChannelID) : E(c.ipc, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID); + var u = new ue, + l = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: a, + success: null, + error: null + }; + f.extend(l, r), + f.extend(l, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + u.setRequestParam(l), + u.submitRequest() + }, + le.prototype.setPreset = function(e, t, n) { + var r = t.iChannelID, + s = "", + o = ""; + s = r <= e.iAnalogChannelNum ? E(this.CGI.setPreset.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t + .iChannelID, n.iPresetID) : t.bShttpIPChannel ? E(this.CGI.setPreset.digital, e.szHttpProtocol, e.szIP, + e.iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum, n.iPresetID) : E(this + .CGI.setPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID), + o = "", + o += "", + o += "" + n.iPresetID + "", + e.szDeviceType != w && (o += "Preset" + n.iPresetID + ""), + o += ""; + var i = new ue, + a = { + type: "PUT", + url: s, + auth: e.szAuth, + data: o, + success: null, + error: null + }; + f.extend(a, n), + f.extend(a, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + i.setRequestParam(a), + i.submitRequest() + }, + le.prototype.goPreset = function(e, t, n) { + var r = t.iChannelID, + s = ""; + s = r <= e.iAnalogChannelNum ? E(this.CGI.goPreset.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t + .iChannelID, n.iPresetID) : t.bShttpIPChannel ? E(this.CGI.goPreset.digital, e.szHttpProtocol, e.szIP, e + .iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum, n.iPresetID) : E(this.CGI + .goPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID); + var o = new ue, + i = { + type: "PUT", + url: s, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(i, n), + f.extend(i, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + o.setRequestParam(i), + o.submitRequest() + }, + le.prototype.recordSearch = function(e, r) { + var s = "", + o = "", + i = r.iChannelID, + a = r.iStreamType, + c = r.szStartTime.replace(" ", "T") + "Z", + u = r.szEndTime.replace(" ", "T") + "Z"; + s = E(this.CGI.recordSearch, e.szHttpProtocol, e.szIP, e.iCGIPort), + o = "" + new t + + "" + (100 * i + a) + + "" + c + "" + u + + "40" + r.iSearchPos + + "//metadata.ISAPI.org/VideoMotion"; + var l = new ue, + d = { + type: "POST", + url: s, + auth: e.szAuth, + data: o, + success: null, + error: null + }; + f.extend(d, r), + f.extend(d, { + success: function(e) { + var t = []; + t.push(""), + t.push("" + n.$XML(e).find("responseStatus").eq(0).text() + + ""), + t.push("" + n.$XML(e).find("responseStatusStrg").eq(0).text() + + ""), + t.push("" + n.$XML(e).find("numOfMatches").eq(0).text() + ""), + t.push(""); + for (var s = n.$XML(e).find("searchMatchItem", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + t.push(""), + t.push("" + n.$XML(a).find("trackID").eq(0).text() + ""), + t.push("" + n.$XML(a).find("startTime").eq(0).text() + ""), + t.push("" + n.$XML(a).find("endTime").eq(0).text() + ""), + t.push("" + f.escape(n.$XML(a).find("playbackURI").eq(0).text()) + + ""), + t.push("" + n.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[ + 1] + ""), + t.push("") + } + t.push(""), + t.push(""), + e = f.loadXML(t.join("")), + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + l.setRequestParam(d), + l.submitRequest() + }, + le.prototype.startPlayback = function(e, t) { + var n = t.iWndIndex, + r = "", + s = t.szStartTime, + o = t.szEndTime, + i = e.szIP; + if ("rtsp://" === t.urlProtocol && (i = Z(i)), r = re() ? E(t.cgi, t.urlProtocol, i, t.iPort, t + .iChannelID) : E(t.cgi, t.urlProtocol, i, t.iPort, t.iChannelID, s, o), !B(t.oTransCodeParam)) { + var a = ne(t.oTransCodeParam); + if ("" == a) return -1; + c.HWP_SetTrsPlayBackParam(n, a) + } + var u = function() { + var r = new ce; + r.iIndex = n, + r.szIP = e.szIP, + r.iCGIPort = e.iCGIPort, + r.szDeviceIdentify = e.szDeviceIdentify, + r.iChannelID = t.iChannelID, + r.iPlayStatus = D, + p.push(r) + }; + if (re()) { + var l = new Promise(function(t, i) { + c.JS_Play(r, { + session: e.szAuth + }, + n, s, o).then(function() { + u(), + t() + }, + function() { + i() + }) + }); + return l + } + var d = c.HWP_Play(r, e.szAuth, n, s, o); + return 0 == d && u(), + d + }, + le.prototype.reversePlayback = function(e, t) { + var n = t.iWndIndex, + r = t.szStartTime, + s = t.szEndTime, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)); + var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s), + a = c.HWP_ReversePlay(i, e.szAuth, n, r, s); + if (0 == a) { + var u = new ce; + u.iIndex = n, + u.szIP = e.szIP, + u.iCGIPort = e.iCGIPort, + u.szDeviceIdentify = e.szDeviceIdentify, + u.iChannelID = t.iChannelID, + u.iPlayStatus = b, + p.push(u) + } + return a + }, + le.prototype.startDownloadRecord = function(e, t) { + var n = -1, + r = E(this.CGI.startDownloadRecord, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = " " + f.escape(t.szPlaybackURI) + + ""; + return re() ? (r = se(r), n = c.JS_StartDownload(r, e.szAuth, t.szFileName, s)) : n = c.HWP_StartDownload(r, + e.szAuth, t.szFileName, s, t.bDateDir), + n + }, + le.prototype.exportDeviceConfig = function(e) { + var t = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ExportDeviceConfig(t, e.szAuth, "", 0) + }, + le.prototype.importDeviceConfig = function(e, t) { + var n = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ImportDeviceConfig(n, e.szAuth, t.szFileName, 0) + }, + le.prototype.restart = function(e, t) { + var n = E(this.CGI.restart, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.restore = function(e, t, n) { + var r = E(this.CGI.restore, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = new ue, + o = { + type: "PUT", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, n), + f.extend(o, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.startUpgrade = function(e, t) { + var n = E(this.CGI.startUpgrade.upgrade, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = E(this.CGI.startUpgrade.status, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_StartUpgrade(n, r, e.szAuth, t.szFileName) + }, + le.prototype.set3DZoom = function(e, t, r, s) { + var o = t.iChannelID, + i = ""; + i = o <= e.iAnalogChannelNum ? E(this.CGI.set3DZoom.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t + .iChannelID) : t.bShttpIPChannel ? E(this.CGI.set3DZoom.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t + .iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(this.CGI.set3DZoom.digital, e + .szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID); + var a = f.loadXML(r), + c = parseInt(n.$XML(a).find("StartPoint").eq(0).find("positionX").eq(0).text(), 10), + u = parseInt(n.$XML(a).find("StartPoint").eq(0).find("positionY").eq(0).text(), 10), + l = parseInt(n.$XML(a).find("EndPoint").eq(0).find("positionX").eq(0).text(), 10), + d = parseInt(n.$XML(a).find("EndPoint").eq(0).find("positionY").eq(0).text(), 10), + p = "" + c + + "" + (255 - u) + "" + l + + "" + (255 - d) + "", + P = new ue, + h = { + type: "PUT", + url: i, + data: p, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(h, s), + f.extend(h, { + success: function(e) { + s.success && s.success(e) + }, + error: function(e, t) { + s.error && s.error(e, t) + } + }), + P.setRequestParam(h), + P.submitRequest() + }, + le.prototype.getSDKCapa = function(e, t) { + + var n = E(this.CGI.SDKCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.deviceCapturePic = function(e, t, n, r) { + var t = 100 * t + 1, + s = -1, + o = E(this.CGI.deviceCapture.channels, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + i = []; + if (f.isInt(r.iResolutionWidth) && i.push("videoResolutionWidth=" + r.iResolutionWidth), f.isInt(r + .iResolutionHeight) && i.push("videoResolutionHeight=" + r.iResolutionHeight), i.length > 0 && (o += + "?" + i.join("&")), re()) { + var a = function(e, t) { + var n = ".jpg"; + return $("body").append('
  • '), + $("#jsplugin_download_li").trigger("click"), + $("#jsplugin_download_a").remove(), + 0 + }; + o = se(o), + s = a(o, n) + } else s = c.HWP_DeviceCapturePic(o, e.szAuth, n, r.bDateDir); + return s + }, + le.prototype.getSessionCap = function(e, t, n, r, s) { + var o = ""; + o = 2 == t ? "https://" : "http://"; + var i = E(this.CGI.sessionCap, o, e, n, encodeURIComponent(r)), + a = new ue, + c = { + type: "GET", + url: i, + auth: "", + success: null, + error: null + }; + f.extend(c, s), + f.extend(c, { + success: function(e) { + s.success && s.success(e) + }, + error: function(e, t) { + s.error && s.error(e, t) + } + }), + a.setRequestParam(c), + a.submitRequest() + }, + le.prototype.sessionLogin = function(e, t, r, s, o, i, a) { + console.log("e>>>", e) + console.log("t>>>", t) + console.log("r>>>", r) + console.log("s>>>", s) + console.log("o>>>", o) + console.log("i>>>", i) + console.log("a>>>", a) + console.log("this.CGI.sessionLogin>>>", this.CGI.sessionLogin) + var c = ""; + c = 2 == t ? "https://" : "http://"; + var u = E(this.CGI.sessionLogin, c, e, r), + // var u = E("http://192.168.3.175/ISAPI/Security/sessionLogin" c, e, r), + l = n.$XML(i).find("sessionID").eq(0).text(), + d = n.$XML(i).find("challenge").eq(0).text(), + p = parseInt(n.$XML(i).find("iterations").eq(0).text(), 10), + P = !1, + h = ""; + n.$XML(i).find("isIrreversible", !0).length > 0 && (P = "true" === n.$XML(i).find("isIrreversible").eq(0) + .text(), h = n.$XML(i).find("salt").eq(0).text()); + var I = ""; + if (P) { + I = f.sha256(s + h + o), + I = f.sha256(I + d); + for (var m = 2; p > m; m++) I = f.sha256(I) + } else { + I = f.sha256(o) + d; + for (var m = 1; p > m; m++) I = f.sha256(I) + } + var C = ""; + C += "" + f.escape(s) + "", + C += "" + I + "", + C += "" + l + "", + C += ""; + var S = new ue, + v = { + type: "POST", + url: u, + data: C, + auth: "", + success: null, + error: null + }; + f.extend(v, a), + f.extend(v, { + success: function(e) { + a.success && a.success(e) + }, + error: function(e, t) { + a.error && a.error(e, t) + } + }), + S.setRequestParam(v), + S.submitRequest() + }, + le.prototype.sessionHeartbeat = function(e, t) { + var n = E(this.CGI.sessionHeartbeat, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.sessionLogout = function(e, t) { + var n = E(this.CGI.sessionLogout, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getSystemCapa = function(e, t) { + var n = E(this.CGI.systemCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }; + var de = function() {}; + de.prototype.CGI = { + login: "%s%s:%s/PSIA/Custom/SelfExt/userCheck", + getAudioInfo: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels", + getDeviceInfo: "%s%s:%s/PSIA/System/deviceInfo", + getAnalogChannelInfo: "%s%s:%s/PSIA/System/Video/inputs/channels", + getDigitalChannel: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels", + getDigitalChannelInfo: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels/status", + getZeroChannelInfo: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroVideo/channels", + getStreamChannels: { + analog: "%s%s:%s/PSIA/Streaming/channels", + digital: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels" + }, + getStreamDynChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels", + startRealPlay: { + channels: "%s%s:%s/PSIA/streaming/channels/%s", + zeroChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s" + }, + startVoiceTalk: { + open: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/open", + close: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/close", + audioData: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/audioData" + }, + ptzControl: "%s%s:%s/PSIA/PTZ/channels/%s/continuous", + ptzAutoControl: "%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/autoptz", + setPreset: "%s%s:%s/PSIA/PTZ/channels/%s/presets/%s", + goPreset: "%s%s:%s/PSIA/PTZ/channels/%s/presets/%s/goto", + ptzFocus: "%s%s:%s/PSIA/System/Video/inputs/channels/%s/focus", + ptzIris: "%s%s:%s/PSIA/System/Video/inputs/channels/%s/iris", + getNetworkBond: "%s%s:%s/PSIA/Custom/SelfExt/Bond", + getNetworkInterface: "%s%s:%s/PSIA/System/Network/interfaces", + getUPnPPortStatus: "%s%s:%s/PSIA/Custom/SelfExt/UPnP/ports/status", + getPPPoEStatus: "%s%s:%s/PSIA/Custom/SelfExt/PPPoE/1/status", + getPortInfo: "%s%s:%s/PSIA/Security/AAA/adminAccesses", + recordSearch: "%s%s:%s/PSIA/ContentMgmt/search", + startPlayback: "%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%s", + startDownloadRecord: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/download", + deviceConfig: "%s%s:%s/PSIA/System/configurationData", + restart: "%s%s:%s/PSIA/System/reboot", + restore: "%s%s:%s/PSIA/System/factoryReset?mode=%s", + startUpgrade: { + upgrade: "%s%s:%s/PSIA/System/updateFirmware", + status: "%s%s:%s/PSIA/Custom/SelfExt/upgradeStatus" + }, + set3DZoom: "%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/Set3DZoom", + deviceCapture: { + channels: "%s%s:%s/PSIA/Streaming/channels/%s/picture" + }, + systemCapabilities: "%s%s:%s/PSIA/System/capabilities" + }, + de.prototype.login = function(e, t, r, s) { + var o = 2 == s.protocol ? "https://" : "http://", + i = E(this.CGI.login, o, e, t), + a = new ue, + c = { + type: "GET", + url: i, + auth: r, + success: null, + error: null + }; + f.extend(c, s), + f.extend(c, { + success: function(e) { + "200" == n.$XML(e).find("statusValue").eq(0).text() ? s.success && s.success(e) : s.error && s + .error(401, e) + }, + error: function(e, t) { + s.error && s.error(e, t) + } + }), + a.setRequestParam(c), + a.submitRequest() + }, + de.prototype.getAudioInfo = function(e, t) { + var n = E(this.CGI.getAudioInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getDeviceInfo = function(e, t) { + var r = E(this.CGI.getDeviceInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""), + r.push("" + f.escape(n.$XML(e).find("deviceName").eq(0).text()) + ""), + r.push("" + n.$XML(e).find("deviceID").eq(0).text() + ""), + r.push("" + n.$XML(e).find("deviceDescription").eq(0).text() + ""), + r.push("" + n.$XML(e).find("model").eq(0).text() + ""), + r.push("" + n.$XML(e).find("serialNumber").eq(0).text() + ""), + r.push("" + n.$XML(e).find("macAddress").eq(0).text() + ""), + r.push("" + n.$XML(e).find("firmwareVersion").eq(0).text() + + ""), + r.push("" + n.$XML(e).find("firmwareReleasedDate").eq(0).text() + + ""), + r.push("" + n.$XML(e).find("logicVersion").eq(0).text() + ""), + r.push("" + n.$XML(e).find("logicReleasedDate").eq(0).text() + + ""), + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess && t.mysuccess(r.join("")) + // console.log("2922",r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getSystemCapa = function(e, t) { + var n = E(this.CGI.systemCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getAnalogChannelInfo = function(e, t) { + var r = E(this.CGI.getAnalogChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("VideoInputChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + n.$XML(a).find("inputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("" + n.$XML(a).find("videoFormat").eq(0).text() + ""), + r.push("") + } + + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getDigitalChannel = function(e, t) { + var r = E(this.CGI.getDigitalChannel, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("DynVideoInputChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("") + } + + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess && t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getDigitalChannelInfo = function(e, t) { + var r = null, + s = {}; + if (this.getDigitalChannel(e, { + async: !1, + success: function(e) { + r = e; + for (var t = n.$XML(r).find("InputProxyChannel", !0), o = 0, i = t.length; i > o; o++) { + var a = t[o], + c = n.$XML(a).find("id").eq(0).text(), + u = n.$XML(a).find("name").eq(0).text(); + s[c] = u + } + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), null !== r) { + var o = E(this.CGI.getDigitalChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + i = new ue, + a = { + type: "GET", + url: o, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(a, t), + f.extend(a, { + success: function(e) { + var r = []; + r.push(""); + for (var o = n.$XML(e).find("DynVideoInputChannelStatus", !0), i = 0, a = o.length; a > + i; i++) { + var c = o[i], + u = n.$XML(c).find("id").eq(0).text(); + r.push(""), + r.push("" + u + ""), + r.push(""), + r.push("" + n.$XML(c).find("adminProtocol").eq(0).text() + + ""), + r.push("" + n.$XML(c).find("addressingFormatType").eq(0).text() + + ""), + r.push("" + n.$XML(c).find("ipAddress").eq(0).text() + ""), + r.push("" + n.$XML(c).find("adminPortNo").eq(0).text() + ""), + r.push("" + n.$XML(c).find("srcInputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(c).find("userName").eq(0).text()) + ""), + r.push("" + n.$XML(c).find("streamType").eq(0).text() + ""), + r.push("" + n.$XML(c).find("online").eq(0).text() + ""), + r.push("" + f.escape(s[u]) + ""), + r.push(""), + r.push("") + } + // console.log("1746"); + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess && t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + i.setRequestParam(a), + i.submitRequest() + } + }, + de.prototype.getZeroChannelInfo = function(e, t) { + var n = E(this.CGI.getZeroChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getPPPoEStatus = function(e, t) { + var n = E(this.CGI.getPPPoEStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getUPnPPortStatus = function(e, t) { + var n = E(this.CGI.getUPnPPortStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getNetworkBond = function(e, t) { + var n = E(this.CGI.getNetworkBond, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getNetworkInterface = function(e, t) { + var n = E(this.CGI.getNetworkInterface, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getPortInfo = function(e, t) { + var r = E(this.CGI.getPortInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(r) { + var s = []; + s.push(""); + for (var o = n.$XML(r).find("AdminAccessProtocol", !0), i = 0, a = o.length; a > i; i++) { + o[i]; + s.push(""), + s.push("" + n.$XML(r).find("id").eq(0).text() + ""), + s.push("" + n.$XML(r).find("enabled").eq(0).text() + ""), + s.push("" + n.$XML(r).find("protocol").eq(0).text().toUpperCase() + ""), + s.push("" + n.$XML(r).find("portNo").eq(0).text() + ""), + s.push("") + } + I.getStreamChannels(e, { + async: !1, + success: function(r) { + if (n.$XML(r).find("rtspPortNo", !0).length > 0) { + var o = parseInt(n.$XML(r).find("rtspPortNo").eq(0).text(), 10); + s.push(""), + s.push("4"), + s.push("true"), + s.push("RTSP"), + s.push("" + o + ""), + s.push(""), + s.push(""); + // console.log("1819"); + var i = f.loadXML(s.join("")); + t.success && t.success(i) + } else I.getStreamDynChannels(e, { + async: !1, + success: function(e) { + if (n.$XML(e).find("rtspPortNo", !0).length > 0) { + var r = parseInt(n.$XML(e).find("rtspPortNo").eq(0).text(), 10); + s.push(""), + s.push("4"), + s.push("true"), + s.push("RTSP"), + s.push("" + r + ""), + s.push(""), + s.push(""); + // console.log("1827"); + var o = f.loadXML(s.join("")); + t.success && t.success(o) + } + }, + error: function() { + t.error && t.error() + } + }) + }, + error: function() { + t.error && t.error() + } + }) + }, + error: function() { + var r = []; + r.push(""), + I.getStreamChannels(e, { + async: !1, + success: function(s) { + if (n.$XML(s).find("rtspPortNo", !0).length > 0) { + var o = parseInt(n.$XML(s).find("rtspPortNo").eq(0).text(), 10); + r.push(""), + r.push("4"), + r.push("true"), + r.push("RTSP"), + r.push("" + o + ""), + r.push(""), + r.push(""); + var i = f.loadXML(r.join("")); + // console.log("1847"); + t.success && t.success(i) + } else I.getStreamDynChannels(e, { + async: !1, + success: function(e) { + if (n.$XML(e).find("rtspPortNo", !0).length > 0) { + var s = parseInt(n.$XML(e).find("rtspPortNo").eq(0).text(), 10); + r.push(""), + r.push("4"), + r.push("true"), + r.push("RTSP"), + r.push("" + s + ""), + r.push(""), + r.push(""); + var o = f.loadXML(r.join("")); + // console.log("1855"); + t.success && t.success(o) + } + }, + error: function() { + t.error && t.error() + } + }) + }, + error: function() { + t.error && t.error() + } + }) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getStreamChannels = function(e, t) { + if (0 != e.iAnalogChannelNum) var n = E(this.CGI.getStreamChannels.analog, e.szHttpProtocol, e.szIP, e + .iCGIPort); + else var n = E(this.CGI.getStreamChannels.digital, e.szHttpProtocol, e.szIP, e.iCGIPort); + var r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getStreamDynChannels = function(e, t) { + var n = E(this.CGI.getStreamDynChannels, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.startRealPlay = function(e, t) { + var n = 100 * t.iChannelID + t.iStreamType, + r = "", + s = e.szIP; + "rtsp://" === t.urlProtocol && (s = Z(s)), + r = t.bZeroChannel ? E(t.cgi.zeroChannels, t.urlProtocol, s, t.iPort, n) : E(t.cgi.channels, t + .urlProtocol, s, t.iPort, n); + var o = c.HWP_Play(r, e.szAuth, t.iWndIndex, "", ""); + if (0 == o) { + var i = new ce; + i.iIndex = t.iWndIndex, + i.szIP = e.szIP, + i.iCGIPort = e.iCGIPort, + i.szDeviceIdentify = e.szDeviceIdentify, + i.iChannelID = t.iChannelID, + i.iPlayStatus = x, + p.push(i) + } + return o + }, + de.prototype.startVoiceTalk = function(e, t) { + var n = E(this.CGI.startVoiceTalk.open, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + r = E(this.CGI.startVoiceTalk.close, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = E(this.CGI.startVoiceTalk.audioData, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + o = c.HWP_StartVoiceTalkEx(n, r, s, e.szAuth, e.iAudioTypeoDeviceInfo.m_iAudioBitRate, e + .m_iAudioSamplingRate); + return o + }, + de.prototype.ptzAutoControl = function(e, t, n, r) { + var s = n.iChannelID, + o = "", + i = ""; + if (r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100, t && (r.iPTZSpeed = 0), e.szDeviceType != w) o = + E(this.CGI.ptzAutoControl, e.szHttpProtocol, e.szIP, e.iCGIPort, s), + i = "" + r.iPTZSpeed + + "0"; + else { + var a = 99; + t && (a = 96), + o = E(this.CGI.goPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, s, a) + } + var c = new ue, + u = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }, + l = this; + f.extend(u, r), + f.extend(u, { + success: function(e) { + n.bPTZAuto = !n.bPTZAuto, + r.success && r.success(e) + }, + error: function(t, s) { + if (e.szDeviceType != w) { + o = E(l.CGI.ptzControl, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID); + var a = new ue, + c = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }; + f.extend(c, r), + a.setRequestParam(c), + a.submitRequest() + } else r.error && r.error(t, s) + } + }), + c.setRequestParam(u), + c.submitRequest() + }, + de.prototype.ptzControl = function(e, t, n, r) { + var s = (n.iChannelID, ""); + n.bPTZAuto && this.ptzAutoControl(e, !0, n, { + iPTZSpeed: 0 + }), + t ? r.iPTZSpeed = 0 : r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100; + var o = [{}, + { + pan: 0, + tilt: r.iPTZSpeed + }, + { + pan: 0, + tilt: -r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: 0 + }, + { + pan: r.iPTZSpeed, + tilt: 0 + }, + { + pan: -r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + {}, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + } + ], + i = "", + a = {}; + switch (r.iPTZIndex) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + a = this.CGI.ptzControl, + i = "" + o[r.iPTZIndex].pan + "" + o[r + .iPTZIndex].tilt + ""; + break; + case 10: + case 11: + a = this.CGI.ptzControl, + i = "" + o[r.iPTZIndex].speed + + ""; + break; + case 12: + case 13: + a = this.CGI.ptzFocus, + i = "" + o[r.iPTZIndex].speed + + ""; + break; + case 14: + case 15: + a = this.CGI.ptzIris, + i = "" + o[r.iPTZIndex].speed + + ""; + break; + default: + return void(r.error && r.error()) + } + s = E(a, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID); + var c = new ue, + u = { + type: "PUT", + url: s, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }; + f.extend(u, r), + f.extend(u, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + c.setRequestParam(u), + c.submitRequest() + }, + de.prototype.setPreset = function(e, t, n) { + var r = (t.iChannelID, ""), + s = ""; + r = E(this.CGI.setPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID), + s = "", + s += "", + s += "" + n.iPresetID + "", + e.szDeviceType != w && (s += "Preset" + n.iPresetID + ""), + s += ""; + var o = new ue, + i = { + type: "PUT", + url: r, + auth: e.szAuth, + data: s, + success: null, + error: null + }; + f.extend(i, n), + f.extend(i, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + o.setRequestParam(i), + o.submitRequest() + }, + de.prototype.goPreset = function(e, t, n) { + var r = (t.iChannelID, ""); + r = E(this.CGI.goPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID); + var s = new ue, + o = { + type: "PUT", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, n), + f.extend(o, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.recordSearch = function(e, r) { + var s = "", + o = "", + i = r.iChannelID, + a = r.iStreamType, + c = r.szStartTime.replace(" ", "T") + "Z", + u = r.szEndTime.replace(" ", "T") + "Z"; + s = E(this.CGI.recordSearch, e.szHttpProtocol, e.szIP, e.iCGIPort), + o = "" + new t + + "" + (100 * i + a) + + "" + c + "" + u + + "40" + r.iSearchPos + + "//metadata.psia.org/VideoMotion"; + var l = new ue, + d = { + type: "POST", + url: s, + auth: e.szAuth, + data: o, + success: null, + error: null + }; + f.extend(d, r), + f.extend(d, { + success: function(e) { + var t = []; + t.push(""), + t.push("" + n.$XML(e).find("responseStatus").eq(0).text() + + ""), + t.push("" + n.$XML(e).find("responseStatusStrg").eq(0).text() + + ""), + t.push("" + n.$XML(e).find("numOfMatches").eq(0).text() + ""), + t.push(""); + for (var s = n.$XML(e).find("searchMatchItem", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + t.push(""), + t.push("" + n.$XML(a).find("trackID").eq(0).text() + ""), + t.push("" + n.$XML(a).find("startTime").eq(0).text() + ""), + t.push("" + n.$XML(a).find("endTime").eq(0).text() + ""), + t.push("" + f.escape(n.$XML(a).find("playbackURI").eq(0).text()) + + ""), + t.push("" + n.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[ + 1] + ""), + t.push("") + } + // console.log("2006"); + t.push(""), + t.push(""), + e = f.loadXML(t.join("")), + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + l.setRequestParam(d), + l.submitRequest() + }, + de.prototype.startPlayback = function(e, t) { + var n = t.iWndIndex, + r = t.szStartTime, + s = t.szEndTime, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)); + var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s), + a = c.HWP_Play(i, e.szAuth, n, r, s); + if (0 == a) { + var u = new ce; + u.iIndex = n, + u.szIP = e.szIP, + u.iCGIPort = e.iCGIPort, + u.szDeviceIdentify = e.szDeviceIdentify, + u.iChannelID = t.iChannelID, + u.iPlayStatus = D, + p.push(u) + } + return a + }, + de.prototype.reversePlayback = function(e, t) { + var n = t.iWndIndex, + r = t.szStartTime, + s = t.szEndTime, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)); + var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s), + a = c.HWP_ReversePlay(i, e.szAuth, n, r, s); + if (0 == a) { + var u = new ce; + u.iIndex = n, + u.szIP = e.szIP, + u.iCGIPort = e.iCGIPort, + u.szDeviceIdentify = e.szDeviceIdentify, + u.iChannelID = t.iChannelID, + u.iPlayStatus = b, + p.push(u) + } + return a + }, + de.prototype.startDownloadRecord = function(e, t) { + var n = E(this.CGI.startDownloadRecord, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = " " + f.escape(t.szPlaybackURI) + + ""; + return c.HWP_StartDownload(n, e.szAuth, t.szFileName, r, t.bDateDir) + }, + de.prototype.exportDeviceConfig = function(e) { + var t = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ExportDeviceConfig(t, e.szAuth, "", 0) + }, + de.prototype.importDeviceConfig = function(e, t) { + var n = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ImportDeviceConfig(n, e.szAuth, t.szFileName, 0) + }, + de.prototype.restart = function(e, t) { + var n = E(this.CGI.restart, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.restore = function(e, t, n) { + var r = E(this.CGI.restore, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = new ue, + o = { + type: "PUT", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, n), + f.extend(o, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.startUpgrade = function(e, t) { + var n = E(this.CGI.startUpgrade.upgrade, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = E(this.CGI.startUpgrade.status, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_StartUpgrade(n, r, e.szAuth, t.szFileName) + }, + de.prototype.set3DZoom = function(e, t, n, r) { + var s = E(this.CGI.set3DZoom, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID), + o = new ue, + i = { + type: "PUT", + url: s, + data: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(i, r), + f.extend(i, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + o.setRequestParam(i), + o.submitRequest() + }, + de.prototype.deviceCapturePic = function(e, t, n, r) { + var t = 100 * t + 1, + s = E(this.CGI.deviceCapture.channels, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + o = []; + return f.isInt(r.iResolutionWidth) && o.push("videoResolutionWidth=" + r.iResolutionWidth), + f.isInt(r.iResolutionHeight) && o.push("videoResolutionHeight=" + r.iResolutionHeight), + o.length > 0 && (s += "?" + o.join("&")), + c.HWP_DeviceCapturePic(s, e.szAuth, n, r.bDateDir) + }; + var pe = function() {}; + pe.prototype._alert = function(e) { + a.bDebugMode && console.log(e); + }, + function(t) { + var n = function(e) { + this.elems = [], + this.length = 0, + this.length = this.elems.push(e) + }; + n.prototype.find = function(e, t) { + var n = this.elems[this.length - 1] ? this.elems[this.length - 1].getElementsByTagName(e) : []; + return this.length = this.elems.push(n), + t ? n : this + }, + n.prototype.eq = function(e, t) { + var n = this.elems[this.length - 1].length, + r = null; + return n > 0 && n > e && (r = this.elems[this.length - 1][e]), + this.length = this.elems.push(r), + t ? r : this + }, + n.prototype.text = function(t) { + return this.elems[this.length - 1] ? t ? void(e.DOMParser ? this.elems[this.length - 1].textContent = + t : this.elems[this.length - 1].text = t) : e.DOMParser ? this.elems[this.length - 1].textContent : + this.elems[this.length - 1].text : "" + }, + n.prototype.attr = function(e) { + if (this.elems[this.length - 1]) { + var t = this.elems[this.length - 1].attributes.getNamedItem(e); + return t ? t.value : "" + } + }, + t.$XML = function(e) { + return new n(e) + } + }(this); + var Pe = function() {}; + Pe.prototype.extend = function() { + for (var e, t = arguments[0] || {}, + n = 1, r = arguments.length; r > n; n++) + if (null != (e = arguments[n])) + for (var s in e) { + var o = (t[s], e[s]); + t !== o && ("object" == typeof o ? t[s] = this.extend({}, + o) : void 0 !== o && (t[s] = o)) + } + return t + }, + Pe.prototype.browser = function() { + var e = /(chrome)[ \/]([\w.]+)/, + t = /(safari)[ \/]([\w.]+)/, + n = /(opera)(?:.*version)?[ \/]([\w.]+)/, + r = /(msie) ([\w.]+)/, + s = /(trident.*rv:)([\w.]+)/, + o = /(mozilla)(?:.*? rv:([\w.]+))?/, + i = navigator.userAgent.toLowerCase(), + a = e.exec(i) || t.exec(i) || n.exec(i) || r.exec(i) || s.exec(i) || i.indexOf("compatible") < 0 && o + .exec(i) || ["unknow", "0"]; + a.length > 0 && a[1].indexOf("trident") > -1 && (a[1] = "msie"); + var c = {}; + return c[a[1]] = !0, + c.version = a[2], + c + }, + Pe.prototype.loadXML = function(t) { + if (null == t || "" == t) return null; + var n = null; + //现场硬盘录像机用这段 + if (e.DOMParser) { + var r = new DOMParser; + n = r.parseFromString(t, "text/xml") + // console.log("DOMParser"); + } else { + if (window.ActiveXObject) { + n = new ActiveXObject("Microsoft.XMLDOM"), + n.async = !1, + n.loadXML(t); + // console.log("ActiveXObject"); + } + } + + return n + }, + Pe.prototype.loadXML2 = function(t) { + if (null == t || "" == t) return null; + var n = null; + + try //Internet Explorer + { + n = new ActiveXObject("Microsoft.XMLDOM"); + n.async = "false"; + n.loadXML(t); + } catch (e) { + try //Firefox, Mozilla, Opera, etc. + { + var parser = new DOMParser(); + n = parser.parseFromString(t, "text/xml"); + } catch (e) { + alert(e.message); + return; + } + } + return n + }, + Pe.prototype.toXMLStr = function(e) { + var t = ""; + try { + var n = new XMLSerializer; + t = n.serializeToString(e) + } catch (r) { + try { + t = e.xml + } catch (r) { + return "" + } + } + return -1 == t.indexOf("" + t), + t + }, + Pe.prototype.escape = function(e) { + return e.replace(/&/g, "&").replace(//g, ">") + }, + Pe.prototype.dateFormat = function(e, t) { + var n = { + "M+": e.getMonth() + 1, + "d+": e.getDate(), + "h+": e.getHours(), + "m+": e.getMinutes(), + "s+": e.getSeconds(), + "q+": Math.floor((e.getMonth() + 3) / 3), + S: e.getMilliseconds() + }; + /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length))); + for (var r in n) new RegExp("(" + r + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? n[ + r] : ("00" + n[r]).substr(("" + n[r]).length))); + return t + }, + Pe.prototype.Base64 = { + _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + encode: function(e) { + var t, n, r, s, o, i, a, c = "", + u = 0; + for (e = Pe.prototype.Base64._utf8_encode(e); u < e.length;) t = e.charCodeAt(u++), + n = e.charCodeAt(u++), + r = e.charCodeAt(u++), + s = t >> 2, + o = (3 & t) << 4 | n >> 4, + i = (15 & n) << 2 | r >> 6, + a = 63 & r, + isNaN(n) ? i = a = 64 : isNaN(r) && (a = 64), + c = c + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(i) + this._keyStr + .charAt(a); + return c + }, + decode: function(e) { + var t, n, r, s, o, i, a, c = "", + u = 0; + for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); u < e.length;) s = this._keyStr.indexOf(e.charAt(u++)), + o = this._keyStr.indexOf(e.charAt(u++)), + i = this._keyStr.indexOf(e.charAt(u++)), + a = this._keyStr.indexOf(e.charAt(u++)), + t = s << 2 | o >> 4, + n = (15 & o) << 4 | i >> 2, + r = (3 & i) << 6 | a, + c += String.fromCharCode(t), + 64 != i && (c += String.fromCharCode(n)), + 64 != a && (c += String.fromCharCode(r)); + return c = Pe.prototype.Base64._utf8_decode(c) + }, + _utf8_encode: function(e) { + e = e.replace(/\r\n/g, "\n"); + for (var t = "", + n = 0; n < e.length; n++) { + var r = e.charCodeAt(n); + 128 > r ? t += String.fromCharCode(r) : r > 127 && 2048 > r ? (t += String.fromCharCode(r >> 6 | 192), + t += String.fromCharCode(63 & r | 128)) : (t += String.fromCharCode(r >> 12 | 224), t += String + .fromCharCode(r >> 6 & 63 | 128), t += String.fromCharCode(63 & r | 128)) + } + return t + }, + _utf8_decode: function(e) { + for (var t = "", + n = 0, + r = c1 = c2 = 0; n < e.length;) r = e.charCodeAt(n), + 128 > r ? (t += String.fromCharCode(r), n++) : r > 191 && 224 > r ? (c2 = e.charCodeAt(n + 1), t += + String.fromCharCode((31 & r) << 6 | 63 & c2), n += 2) : (c2 = e.charCodeAt(n + 1), c3 = e + .charCodeAt(n + 2), t += String.fromCharCode((15 & r) << 12 | (63 & c2) << 6 | 63 & c3), n += 3); + return t + } + }, + Pe.prototype.createEventScript = function(e, t, n) { + var r = document.createElement("script"); + r.htmlFor = e, + r.event = t, + r.innerHTML = n, + document.body.parentNode.appendChild(r) + }, + Pe.prototype.isInt = function(e) { + return /^\d+$/.test(e) + }, + Pe.prototype.getDirName = function() { + var e = ""; + if ("" !== a.szBasePath) e = a.szBasePath; + else { + var t = /[^?#]*\//, + n = document.getElementById("videonode"); + if (n) e = n.src.match(t)[0]; + else { + for (var r = document.scripts, + s = 0, + o = r.length; o > s; s++) + if (r[s].src.indexOf("webVideoCtrl.js") > -1) { + n = r[s]; + break + } + n && (e = n.src.match(t)[0]) + } + } + return e + }, + Pe.prototype.loadScript = function(e, t) { + var n = document.createElement("script"); + n.type = "text/javascript", + n.onload = function() { + t() + }, + n.src = e, + document.getElementsByTagName("head")[0].appendChild(n) + }, + Pe.prototype.sha256 = function(e) { + function t(e, t) { + var n = (65535 & e) + (65535 & t); + return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n + } + + function n(e, t) { + return e >>> t | e << 32 - t + } + + return e = function(e) { + for (var e = e.replace(/\r\n/g, "\n"), t = "", n = 0; n < e.length; n++) { + var r = e.charCodeAt(n); + 128 > r ? t += String.fromCharCode(r) : (r > 127 && 2048 > r ? t += String.fromCharCode(r >> 6 | + 192) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128)), + t += String.fromCharCode(63 & r | 128)) + } + return t + }(e), + function(e) { + for (var t = "", + n = 0; n < 4 * e.length; n++) t += "0123456789abcdef".charAt(e[n >> 2] >> 8 * (3 - n % 4) + 4 & + 15) + "0123456789abcdef".charAt(e[n >> 2] >> 8 * (3 - n % 4) & 15); + return t + }(function(e, r) { + var s, o, i, a, c, u, l, d, p, P, h, I, f = [1116352408, 1899447441, 3049323471, 3921009573, + 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, + 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, + 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, + 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, + 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, + 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, + 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, + 2428436474, 2756734187, 3204031479, 3329325298 + ], + m = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], + C = Array(64); + for (e[r >> 5] |= 128 << 24 - r % 32, e[(r + 64 >> 9 << 4) + 15] = r, p = 0; p < e.length; p += 16) { + for (s = m[0], o = m[1], i = m[2], a = m[3], c = m[4], u = m[5], l = m[6], d = m[7], P = 0; 64 > + P; P++) C[P] = 16 > P ? e[P + p] : t(t(t(n(C[P - 2], 17) ^ n(C[P - 2], 19) ^ C[P - 2] >>> 10, C[ + P - 7]), n(C[P - 15], 7) ^ n(C[P - 15], 18) ^ C[P - 15] >>> 3), C[P - 16]), + h = t(t(t(t(d, n(c, 6) ^ n(c, 11) ^ n(c, 25)), c & u ^ ~c & l), f[P]), C[P]), + I = t(n(s, 2) ^ n(s, 13) ^ n(s, 22), s & o ^ s & i ^ o & i), + d = l, + l = u, + u = c, + c = t(a, h), + a = i, + i = o, + o = s, + s = t(h, I); + m[0] = t(s, m[0]), + m[1] = t(o, m[1]), + m[2] = t(i, m[2]), + m[3] = t(a, m[3]), + m[4] = t(c, m[4]), + m[5] = t(u, m[5]), + m[6] = t(l, m[6]), + m[7] = t(d, m[7]) + } + return m + }(function(e) { + for (var t = [], n = 0; n < 8 * e.length; n += 8) t[n >> 5] |= (255 & e.charCodeAt(n / 8)) << 24 - + n % 32; + return t + }(e), 8 * e.length)) + }, + Pe.prototype.cookie = function(e, t, n) { + if (arguments.length > 1 && (null === t || "object" != typeof t)) { + if (n = this.extend({}, + n), null === t && (n.expires = -1), "number" == typeof n.expires) { + var r = n.expires, + s = n.expires = new Date; + s.setDate(s.getDate() + r) + } + return document.cookie = [encodeURIComponent(e), "=", n.raw ? String(t) : encodeURIComponent(String(t)), n + .expires ? "; expires=" + n.expires.toUTCString() : "", n.path ? "; path=" + n.path : "; path=/", n + .domain ? "; domain=" + n.domain : "", n.secure ? "; secure" : "" + ].join("") + } + n = t || {}; + var o, i = n.raw ? + function(e) { + return e + } : decodeURIComponent; + return (o = new RegExp("(?:^|; )" + encodeURIComponent(e) + "=([^;]*)").exec(document.cookie)) ? i(o[1]) : + null + }, + t.prototype.valueOf = function() { + return this.id + }, + t.prototype.toString = function() { + return this.id + }, + t.prototype.createUUID = function() { + var e = new Date(1582, 10, 15, 0, 0, 0, 0), + n = new Date, + r = n.getTime() - e.getTime(), + s = "-", + o = t.getIntegerBits(r, 0, 31), + i = t.getIntegerBits(r, 32, 47), + a = t.getIntegerBits(r, 48, 59) + "1", + c = t.getIntegerBits(t.rand(4095), 0, 7), + u = t.getIntegerBits(t.rand(4095), 0, 7), + l = t.getIntegerBits(t.rand(8191), 0, 7) + t.getIntegerBits(t.rand(8191), 8, 15) + t.getIntegerBits(t + .rand(8191), 0, 7) + t.getIntegerBits(t.rand(8191), 8, 15) + t.getIntegerBits(t.rand(8191), 0, 15); + return o + s + i + s + a + s + c + u + s + l + }, + t.getIntegerBits = function(e, n, r) { + var s = t.returnBase(e, 16), + o = new Array, + i = "", + a = 0; + for (a = 0; a < s.length; a++) o.push(s.substring(a, a + 1)); + for (a = Math.floor(n / 4); a <= Math.floor(r / 4); a++) i += o[a] && "" != o[a] ? o[a] : "0"; + return i + }, + t.returnBase = function(e, t) { + var n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", + "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" + ]; + if (t > e) var r = n[e]; + else { + var s = "" + Math.floor(e / t), + o = e - s * t; + if (s >= t) var r = this.returnBase(s, t) + n[o]; + else var r = n[s] + n[o] + } + return r + }, + t.rand = function(e) { + return Math.floor(Math.random() * e) + }, + h = new le, + I = new de, + P = new pe, + f = new Pe; + var he = f.dateFormat(new Date, "yyyyMMddhhmmss"); + return o = "webVideoCtrl" + he, + i = "webVideoCtrl" + he, + "object" != typeof e.attachEvent && f.browser().msie && (f.createEventScript(o, + "GetSelectWndInfo(SelectWndInfo)", "GetSelectWndInfo(SelectWndInfo);"), f.createEventScript(o, + "ZoomInfoCallback(szZoomInfo)", "ZoomInfoCallback(szZoomInfo);"), f.createEventScript(o, + "GetHttpInfo(lID, lpInfo, lReverse)", "GetHttpInfo(lID, lpInfo, lReverse);"), f.createEventScript(o, + "PluginEventHandler(iEventType, iParam1, iParam2)", "PluginEventHandler(iEventType, iParam1, iParam2);"), + f.createEventScript(o, "RemoteConfigInfo(lID)", "RemoteConfigInfo(lID);"), f.createEventScript(o, + "KeyBoardEventInfo(iKeyCode)", "KeyBoardEventInfo(iKeyCode);")), + this + }(), + n = e.WebVideoCtrl = t; + n.version = "1.1.0" + } +}(this), +"object" == typeof exports && "undefined" != typeof module || ("function" == typeof define && define.amd ? define( + function() { + return WebVideoCtrl + }) : "function" == typeof define && define.cmd && define(function(e, t, n) { + n.exports = WebVideoCtrl +})); +// export{ +// WebVideoCtrl() +// } \ No newline at end of file diff --git a/supervise-monitor-ui/src/main.js b/supervise-monitor-ui/src/main.js index cac4571a..b54f9e5d 100644 --- a/supervise-monitor-ui/src/main.js +++ b/supervise-monitor-ui/src/main.js @@ -21,6 +21,8 @@ import VueAMap from 'vue-amap' Vue.use(ElementUI) +import hkVideo from '@/api/hikvision/hkVideo' + // import '@/permission' //权限控制 Vue.prototype.$userInfo = null // 用户信息 diff --git a/supervise-monitor-ui/src/static/webVideoCtrl.js b/supervise-monitor-ui/src/static/webVideoCtrl.js new file mode 100644 index 00000000..0c7a211a --- /dev/null +++ b/supervise-monitor-ui/src/static/webVideoCtrl.js @@ -0,0 +1,4140 @@ +! +function(e) { + if (!e.WebVideoCtrl) { + var t = function() { + function t() { + this.id = this.createUUID() + } + + var r = "100%", + s = "100%", + o = "", + i = "", + a = { + szContainerID: "", + szColorProperty: "", + szOcxClassId: "clsid:FDF0038A-CF64-4634-81AB-80F0A7946D6C", + szMimeTypes: "application/webvideo-plugin-kit", + szBasePath: "", + iWndowType: 1, + iPlayMode: 2, + bWndFull: !0, + iPackageType: 2, + bDebugMode: !1, + bNoPlugin: !0, + cbSelWnd: null, + myCbSelWnd: null, + cbDoubleClickWnd: null, + cbEvent: null, + cbRemoteConfig: null, + cbInitPluginComplete: null + }, + c = null, + u = 0, + l = !1, + d = [], + p = [], + P = null, + h = null, + I = null, + f = null, + m = this, + C = null, + S = 1, + v = 2, + y = 200, + g = 0, + x = 1, + D = 2, + z = 3, + T = 4, + b = 5, + A = 6, + M = 0, + R = 2, + L = 3, + q = 21, + G = -1, + W = 0, + X = "IPCamera", + w = "IPDome", + H = "IPZoom", + k = "3,0,6,23,0,6,27,3,3,611,1,3,62,5,2,81,0,5,59"; + GetSelectWndInfo = function(e) { + // console.log("GetSelectWndInfo", e); + if (re()) { + u = e; + var t = []; + t.push(""), + t.push("" + e + ""), + t.push(""), + a.cbSelWnd && a.cbSelWnd(f.loadXML(t.join(""))) + } else { + var r = f.loadXML2(e); + // console.log("37", r); + if (n.$XML(r).find("SelectWnd", !0).length > 0) { + u = parseInt(n.$XML(r).find("SelectWnd").eq(0).text(), 10), + null === C && U(); + var t = []; + t.push(""), + t.push("" + u + ""), + t.push(""), + a.cbSelWnd && a.cbSelWnd(f.loadXML2(t.join(""))), + a.myCbSelWnd&& a.myCbSelWnd(t.join("")) + } else if (n.$XML(r).find("DoubleClickWnd", !0).length > 0) { + var s = parseInt(n.$XML(r).find("DoubleClickWnd").eq(0).text(), 10); + l = "0" === n.$XML(r).find("IsFullScreen").eq(0).text(), + a.cbDoubleClickWnd && a.cbDoubleClickWnd(s, l) + } + } + }, + e.WindowDblClick = function(e) { + l = e, + a.cbDoubleClickWnd && a.cbDoubleClickWnd(u, l) + }, + e.ZoomInfoCallback = function(e) { + var t = m.findWndIndexByIndex(u); + if ( - 1 != t) { + var n = p[t]; + if (t = m.findDeviceIndexByIP(n.szDeviceIdentify), -1 != t) { + var r = d[t]; + r.oProtocolInc.set3DZoom(r, n, e, { + success: function(e) {}, + error: function() {} + }) + } + } + }, + PluginEventHandler = function(e, t, n) { + re() ? a.cbEvent && a.cbEvent(n, t, "") : (_("插件事件:PluginEventHandler iEventType:%s iParam1: %s, iParam2: %s", e, t, n), M == e || R == e ? m.I_Stop(t) : q == e ? m.I_StopRecord(t) : L == e && m.I_StopVoiceTalk(), a.cbEvent && a.cbEvent(e, t, n)) + }, + GetHttpInfo = function(e, t, n) { + _("http响应返回:http状态:%s, http数据:%s", e, t), + ue.prototype.processCallback(e, t) + }, + e.RemoteConfigInfo = function(e) { + a.cbRemoteConfig && a.cbRemoteConfig(e) + }, + e.KeyBoardEventInfo = function(e) { + 100 === parseInt(e, 10) && (l = !1, a.cbDoubleClickWnd && a.cbDoubleClickWnd(u, l)) + }; + var _ = function() { + if (a.bDebugMode) { + var e = E(arguments); + P._alert(e) + } + }, + E = function() { + for (var e = arguments[0], t = 1; t < arguments.length; t++) e = e.replace("%s", arguments[t]); + return e + }, + Z = function(e) { + var t = e.indexOf(":"); + return t > -1 ? e.substring(0, t) : e + }, + B = function(e) { + return "undefined" == typeof e + }, + N = function(e) { + return "[object Object]" === Object.prototype.toString.call(e) + }, + F = function() { + var e = ""; + if (f.browser().msie) e = ""; + else for (var t = navigator.mimeTypes.length, + n = 0; t > n; n++) navigator.mimeTypes[n].type.toLowerCase() == a.szMimeTypes && (e = ""); + return e + }, + U = function() { + if (!re() && null !== c) { + var e = c.HWP_GetLocalConfig(); + C = f.loadXML2(e); + // console.log("92 C", C, e); + } + }, + V = function(e) { + m.I_GetDeviceInfo(e.szIP, { + success: function(t) { + e.szDeviceType = n.$XML(t).find("deviceType").eq(0).text() + } + }), + m.I_GetAnalogChannelInfo(e.szIP, { + success: function(t) { + e.iAnalogChannelNum = n.$XML(t).find("VideoInputChannel", !0).length + } + }), + m.I_GetAudioInfo(e.szIP, { + success: function(t) { + var r = n.$XML(t).find("audioCompressionType", !0); + if (r.length > 0) { + var s = n.$XML(r).eq(0).text(), + o = 0; + "G.711ulaw" == s ? o = 1 : "G.711alaw" == s ? o = 2 : "G.726" == s ? o = 3 : "MP2L2" == s || "MPEL2" == s ? o = 4 : "G.722.1" == s ? o = 0 : "AAC" == s ? o = 5 : "PCM" == s && (o = 6), + e.iAudioType = o + } + "" !== n.$XML(t).find("audioBitRate").eq(0).text() ? e.m_iAudioBitRate = 1e3 * parseInt(n.$XML(t).find("audioBitRate").eq(0).text(), 10) : e.m_iAudioBitRate = 0, + "" !== n.$XML(t).find("audioSamplingRate").eq(0).text() ? e.m_iAudioSamplingRate = 1e3 * parseInt(n.$XML(t).find("audioSamplingRate").eq(0).text(), 10) : e.m_iAudioSamplingRate = 0 + } + }) + }, + j = function(e) { + e.bSupportWebsocket = !1, + e.bSupportSubStreamPlayback = !1, + e.oProtocolInc.getSystemCapa(e, { + success: function(t) { + var r = n.$XML(t).find("NetworkCap").eq(0).find("isSupportWebsocket", !0); + r.length > 0 && (e.bSupportWebsocket = "true" === n.$XML(t).find("NetworkCap").eq(0).find("isSupportWebsocket").eq(0).text()), + r = n.$XML(t).find("RacmCap").eq(0).find("isSupportMainAndSubRecord", !0), + r.length > 0 && (e.bSupportSubStreamPlayback = "true" === n.$XML(t).find("RacmCap").eq(0).find("isSupportMainAndSubRecord").eq(0).text()) + } + }) + }, + O = function() { + var e = a.bWndFull ? 1 : 0; + c.HWP_SetCanFullScreen(e), + c.HWP_SetPackageType(a.iPackageType) + }, + J = function(e) { + var t = -1, + n = -1, + r = -1, + s = null; + if (ee(e)) s = K(e), + t = s.iRtspPort, + r = s.iDevicePort; + else { + for (var o = Q(e), i = !1, a = 0; a < o.length; a++) if (o[a].ipv4 == e.szIP || o[a].ipv6 == e.szIP) { + i = !0; + break + } + i ? s = K(e) : (s = Y(e), -1 == s.iRtspPort && -1 == s.iDevicePort && (s = K(e))), + t = s.iRtspPort, + n = s.iHttpPort, + r = s.iDevicePort + } + return s + }, + K = function(e) { + var t = -1, + r = -1, + s = -1; + return e.oProtocolInc.getPortInfo(e, { + async: !1, + success: function(e) { + var o = n.$XML(e).find("AdminAccessProtocol", !0); + t = 554; + for (var i = 0, + a = o.length; a > i; i++)"rtsp" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (t = parseInt(n.$XML(o).eq(i).find("portNo").eq(0).text(), 10)), + "http" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (r = parseInt(n.$XML(o).eq(i).find("portNo").eq(0).text(), 10)), + "dev_manage" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (s = parseInt(n.$XML(o).eq(i).find("portNo").eq(0).text(), 10)) + }, + error: function() { + t = -1, + r = -1, + s = -1 + } + }), + { + iRtspPort: t, + iHttpPort: r, + iDevicePort: s + } + }, + Y = function(e) { + var t = -1, + r = -1, + s = -1; + return e.oProtocolInc.getUPnPPortStatus(e, { + async: !1, + success: function(e) { + for (var o = n.$XML(e).find("portStatus", !0), i = 0, a = o.length; a > i; i++)"rtsp" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (t = parseInt(n.$XML(o).eq(i).find("externalPort").eq(0).text(), 10)), + "http" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (r = parseInt(n.$XML(o).eq(i).find("externalPort").eq(0).text(), 10)), + "admin" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (s = parseInt(n.$XML(o).eq(i).find("externalPort").eq(0).text(), 10)) + }, + error: function() { + t = -1, + r = -1, + s = -1 + } + }), + { + iRtspPort: t, + iHttpPort: r, + iDevicePort: s + } + }, + Q = function(e) { + var t = []; + return e.oProtocolInc.getNetworkBond(e, { + async: !1, + success: function(r) { + "true" == n.$XML(r).find("enabled").eq(0).text() ? t.push({ + ipv4: n.$XML(r).find("ipAddress").eq(0).text(), + ipv6: n.$XML(r).find("ipv6Address").eq(0).text() + }) : e.oProtocolInc.getNetworkInterface(e, { + async: !1, + success: function(e) { + for (var r = n.$XML(e).find("NetworkInterface", !0), s = 0, o = r.length; o > s; s++) { + t.push({ + ipv4: n.$XML(e).find("ipAddress").eq(0).text(), + ipv6: n.$XML(e).find("ipv6Address").eq(0).text() + }); + break + } + }, + error: function() {} + }) + }, + error: function() { + + e.oProtocolInc.getNetworkInterface(e, { + async: !1, + success: function(e) { + + for (var r = n.$XML(e).find("NetworkInterface", !0), s = 0, o = r.length; o > s; s++) { + t.push({ + ipv4: n.$XML(e).find("ipAddress").eq(0).text(), + ipv6: n.$XML(e).find("ipv6Address").eq(0).text() + }); + break + } + }, + error: function() { + } + }) + } + }), + t + }, + ee = function(e) { + var t = !1; + return e.oProtocolInc.getPPPoEStatus(e, { + async: !1, + success: function(e) { + t = n.$XML(e).find("ipAddress", !0).length > 0 ? !0 : n.$XML(e).find("ipv6Address", !0).length > 0 + }, + error: function() { + t = !1 + } + }), + t + }, + te = function(e) { + + e.oStreamCapa.bObtained || e.oProtocolInc instanceof le && e.oProtocolInc.getSDKCapa(e, { + async: !1, + success: function(t) { + + e.oStreamCapa.bObtained = !0, + e.oStreamCapa.bSupportShttpPlay = "true" === n.$XML(t).find("isSupportHttpPlay").eq(0).text(), + e.oStreamCapa.bSupportShttpPlayback = "true" === n.$XML(t).find("isSupportHttpPlayback").eq(0).text(), + e.oStreamCapa.bSupportShttpsPlay = "true" === n.$XML(t).find("isSupportHttpsPlay").eq(0).text(), + e.oStreamCapa.bSupportShttpsPlayback = "true" === n.$XML(t).find("isSupportHttpsPlayback").eq(0).text(), + e.oStreamCapa.bSupportShttpPlaybackTransCode = "true" === n.$XML(t).find("isSupportHttpTransCodePlayback").eq(0).text(), + e.oStreamCapa.bSupportShttpsPlaybackTransCode = "true" === n.$XML(t).find("isSupportHttpsTransCodePlayback").eq(0).text(), + n.$XML(t).find("ipChanBase", !0).length > 0 && (e.oStreamCapa.iIpChanBase = parseInt(n.$XML(t).find("ipChanBase").eq(0).text(), 10)) + }, + error: function() { + e.oStreamCapa.bObtained = !0 + } + }) + }, + ne = function(e) { + var t = { + TransFrameRate: "", + TransResolution: "", + TransBitrate: "" + }; + if (f.extend(t, e), "" == t.TransFrameRate || "" == t.TransResolution || "" == t.TransBitrate) return ""; + var n = []; + return n.push(""), + n.push(""), + n.push("" + t.TransFrameRate + ""), + n.push("" + t.TransResolution + ""), + n.push("" + t.TransBitrate + ""), + n.push(""), + n.join("") + }, + re = function() { + if (a.bNoPlugin) { + var e = f.browser(); + return !! (e.chrome && parseInt(e.version, 10) > 45 || e.mozilla && parseInt(e.version, 10) > 52) + } + return ! 1 + }, + se = function(e) { + var t = location.hostname, + n = location.port || "80"; + return /^(http|https):\/\/([^\/]+)(.+)$/.test(e) && (e = e.replace(RegExp.$2, t + ":" + n)), + f.cookie("webVideoCtrlProxy", RegExp.$2, { + raw: !0 + }), + e + }, + oe = function() { + var e = ""; + // console.log("224"); + return e += "", + e += "4", + e += "Invalid Operation", + e += "notSupport", + e += "", + f.loadXML(e) + }; + this.I_InitPlugin = function(t, n, o) { + if (r = t, s = n, f.extend(a, o), re()) { + var i = f.getDirName(); + i && ("object" == typeof exports && "undefined" != typeof module || ("function" == typeof define && define.amd ? require([i + "/jsPlugin-1.0.0.min.js"], + function(t) { + e.JSPlugin = t.JSPlugin, + o.cbInitPluginComplete && o.cbInitPluginComplete() + }) : f.loadScript(i + "/jsPlugin-1.0.0.min.js", + function() { + o.cbInitPluginComplete && o.cbInitPluginComplete() + }))), + addEventListener("resize", + function() { + null !== c && c.JS_Resize(r, s) + }), + B(document.fullScreen) ? B(document.webkitIsFullScreen) ? B(document.mozFullScreen) || document.addEventListener("mozfullscreenchange", + function(t) { + var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1; + l && !n && e.KeyBoardEventInfo(100) + }) : document.addEventListener("webkitfullscreenchange", + function(t) { + var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1; + l && !n && e.KeyBoardEventInfo(100) + }) : document.addEventListener("fullscreenchange", + function(t) { + var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1; + l && !n && e.KeyBoardEventInfo(100) + }), + addEventListener("unload", + function() { + null !== c && c.JS_DestroyWorker() + }) + } else o.cbInitPluginComplete && o.cbInitPluginComplete() + }, + this.I_InsertOBJECTPlugin = function(t) { + if (B(t) || (a.szContainerID = t), null == document.getElementById(a.szContainerID)) return - 1; + if (null != document.getElementById(o) || 0 != document.getElementsByName(o).length) return - 1; + if (re()) { + var n = { + szId: t, + iType: 1, + iWidth: r, + iHeight: s, + iMaxSplit: 4, + iCurrentSplit: a.iWndowType, + szBasePath: f.getDirName() + }, + u = a.szColorProperty; + if ("" != u) { + for (var l = {}, + d = u.split(";"), p = "", P = 0, h = d.length; h > P; P++) p = d[P], + p.indexOf("sub-background") > -1 ? l.background = p.split(":")[1] : p.indexOf("sub-border-select") > -1 ? l.borderSelect = p.split(":")[1] : p.indexOf("sub-border") > -1 && (l.border = p.split(":")[1]); + n.oStyle = l + } + c = new JSPlugin(n) + } else document.getElementById(a.szContainerID).innerHTML = F(), + c = f.browser().msie ? document.getElementById(o) : document.getElementsByName(i)[0]; + return null == c && null == c.object ? -1 : ("object" == typeof e.attachEvent && f.browser().msie && (c.attachEvent("GetSelectWndInfo", GetSelectWndInfo), c.attachEvent("ZoomInfoCallback", ZoomInfoCallback), c.attachEvent("GetHttpInfo", GetHttpInfo), c.attachEvent("PluginEventHandler", PluginEventHandler), c.attachEvent("RemoteConfigInfo", RemoteConfigInfo), c.attachEvent("KeyBoardEventInfo", KeyBoardEventInfo)), U(), 0) + }, + this.I_WriteOBJECT_XHTML = function() { + return re() ? -1 : (document.writeln(F()), c = f.browser().msie ? document.getElementById(o) : document.getElementsByName(i)[0], null == c && null == c.object ? -1 : ("object" == typeof e.attachEvent && f.browser().msie && (c.attachEvent("GetSelectWndInfo", GetSelectWndInfo), c.attachEvent("ZoomInfoCallback", ZoomInfoCallback), c.attachEvent("GetHttpInfo", GetHttpInfo), c.attachEvent("PluginEventHandler", PluginEventHandler), c.attachEvent("RemoteConfigInfo", RemoteConfigInfo), c.attachEvent("KeyBoardEventInfo", KeyBoardEventInfo)), U(), 0)) + }, + this.I_OpenFileDlg = function(e) { + var t = ""; + if (re()) return t; + if (t = c.HWP_OpenFileBrowser(e, ""), null == t) return ""; + if (1 == e) { + if (t.length > 100) return - 1 + } else if (t.length > 130) return - 1; + return t + }, + this.I_GetLocalCfg = function() { + var e = null; + if (re()) return e; + var t = c.HWP_GetLocalConfig(), + r = []; + + return C = f.loadXML(t), + r.push(""), + r.push("" + n.$XML(C).find("ProtocolType").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PackgeSize").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PlayWndType").eq(0).text() + ""), + r.push("" + n.$XML(C).find("BuffNumberType").eq(0).text() + ""), + r.push("" + n.$XML(C).find("RecordPath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("CapturePath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PlaybackFilePath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("PlaybackPicPath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("DeviceCapturePath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("DownloadPath").eq(0).text() + ""), + r.push("" + n.$XML(C).find("IVSMode").eq(0).text() + ""), + r.push("" + n.$XML(C).find("CaptureFileFormat").eq(0).text() + ""), + r.push(""), + e = f.loadXML(r.join("")) + }, + this.I_SetLocalCfg = function(e) { + if (re()) return - 1; + // console.log("227"); + var t = f.loadXML(e), + r = !1; + // console.log("285 t", t, e); + return n.$XML(C).find("ProtocolType").eq(0).text(n.$XML(t).find("ProtocolType").eq(0).text()), + n.$XML(C).find("PackgeSize").eq(0).text(n.$XML(t).find("PackgeSize").eq(0).text()), + n.$XML(C).find("PlayWndType").eq(0).text(n.$XML(t).find("PlayWndType").eq(0).text()), + n.$XML(C).find("BuffNumberType").eq(0).text(n.$XML(t).find("BuffNumberType").eq(0).text()), + n.$XML(C).find("RecordPath").eq(0).text(n.$XML(t).find("RecordPath").eq(0).text()), + n.$XML(C).find("CapturePath").eq(0).text(n.$XML(t).find("CapturePath").eq(0).text()), + n.$XML(C).find("PlaybackFilePath").eq(0).text(n.$XML(t).find("PlaybackFilePath").eq(0).text()), + n.$XML(C).find("DeviceCapturePath").eq(0).text(n.$XML(t).find("DeviceCapturePath").eq(0).text()), + n.$XML(C).find("PlaybackPicPath").eq(0).text(n.$XML(t).find("PlaybackPicPath").eq(0).text()), + n.$XML(C).find("DownloadPath").eq(0).text(n.$XML(t).find("DownloadPath").eq(0).text()), + n.$XML(C).find("IVSMode").eq(0).text(n.$XML(t).find("IVSMode").eq(0).text()), + n.$XML(C).find("CaptureFileFormat").eq(0).text(n.$XML(t).find("CaptureFileFormat").eq(0).text()), + r = c.HWP_SetLocalConfig(f.toXMLStr(C)), + r ? 0 : -1 + }; + var ie = function(e, t, n, r, s, o, i) { + var a = { + protocol: t, + success: null, + error: null + }; + f.extend(a, i), + f.extend(a, { + success: function(a) { + var c = new ae; + c.szIP = e, + 2 == t ? (c.szHttpProtocol = "https://", c.iHttpsPort = n) : (c.szHttpProtocol = "http://", c.iHttpPort = n), + c.iCGIPort = n, + c.szDeviceIdentify = e + "_" + n, + c.szAuth = r, + c.iDeviceProtocol = s, + c.oProtocolInc = o, + d.push(c), + _("使用%s协议登录成功", s), + V(c), + O(), + j(c), + i.success && i.success(a) + }, + error: function(e, t) { + i.error && i.error(e, t) + } + }), + o.login(e, n, r, a) + }; + this.I_Login = function(t, r, s, o, i, a) { + var c = t + "_" + s, + u = this.findDeviceIndexByIP(c); + if ( - 1 != u) return _("设备已经登录过"), + -1; + var l = h, + p = S; + if (B(a.cgi) || (S == a.cgi ? (l = h, p = S) : (l = I, p = v)), re()) if (S == p) { + var P = { + success: null, + error: null + }; + f.extend(P, { + success: function(c) { + var u = { + success: null, + error: null + }; + f.extend(u, { + success: function(o) { + var i = new ae; + i.szIP = t, + 2 == r ? (i.szHttpProtocol = "https://", i.iHttpsPort = s) : (i.szHttpProtocol = "http://", i.iHttpPort = s), + i.iCGIPort = s, + i.szDeviceIdentify = t + "_" + s, + i.szAuth = n.$XML(o).find("sessionID").eq(0).text(), + i.iDeviceProtocol = p, + i.oProtocolInc = l, + d.push(i), + _("使用%s协议登录成功", p), + V(i), + j(i), + i.sessionFailed = 0, + i.sesstionTimer = setInterval(function() { + l.sessionHeartbeat(i, + function() { + i.sessionFailed = 0 + }, + function() { + i.sessionFailed++, + i.sessionFailed >= 5 && (clearInterval(i.sesstionTimer), e.PluginEventHandler(G, i.szDeviceIdentify)) + }) + }, + 3e4), + a.success && a.success(o) + }, + error: function(e, t) { + a.error && a.error(e, t) + } + }), + l.sessionLogin(t, r, s, o, i, c, u) + }, + error: function(e, t) { + a.error && a.error(e, t) + } + }), + l.getSessionCap(t, r, s, o, P) + } else a.error && a.error(403, oe()); + else { + var m = ""; + if (S == p) { + m = f.Base64.encode(":" + o + ":" + i); + var P = { + success: null, + error: null + }; + f.extend(P, a), + f.extend(P, { + error: function(e, n) { + m = f.Base64.encode(o + ":" + i), + p = S, + l = h; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function() { + if (!B(a.cgi)) return void(a.error && a.error(e, n)); + m = f.Base64.encode(":" + o + ":" + i), + p = v, + l = I; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function(e, n) { + m = f.Base64.encode(o + ":" + i), + p = v, + l = I; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function() { + a.error && a.error(e, n) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, P) + } else { + m = f.Base64.encode(":" + o + ":" + i), + p = v, + l = I; + var P = { + success: null, + error: null + }; + f.extend(P, a), + f.extend(P, { + error: function(e, n) { + m = f.Base64.encode(o + ":" + i), + p = v, + l = I; + var c = { + success: null, + error: null + }; + f.extend(c, a), + f.extend(c, { + error: function() { + a.error && a.error(e, n) + } + }), + ie(t, r, s, m, p, l, c) + } + }), + ie(t, r, s, m, p, l, P) + } + } + }, + this.I_Logout = function(e) { + var t = this.findDeviceIndexByIP(e); + if ( - 1 != t) { + if (re()) { + var n = d[t]; + clearInterval(n.sesstionTimer), + n.oProtocolInc.sessionLogout(n, {}) + } + return d.splice(t, 1), + 0 + } + return - 1 + }, + this.I_GetAudioInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if ( - 1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getAudioInfo(r, s) + } + }, + this.I_GetDeviceInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if ( - 1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getDeviceInfo(r, s) + } + }, + this.I_GetAnalogChannelInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if ( - 1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getAnalogChannelInfo(r, s) + } + }, + this.I_GetDigitalChannelInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if ( - 1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getDigitalChannelInfo(r, s) + } + }, + this.I_GetZeroChannelInfo = function(e, t) { + var n = this.findDeviceIndexByIP(e); + if ( - 1 != n) { + var r = d[n], + s = { + success: null, + error: null + }; + f.extend(s, t), + r.oProtocolInc.getZeroChannelInfo(r, s) + } + }, + this.I_StartRealPlay = function(e, t) { + var r = this.findDeviceIndexByIP(e), + s = "", + o = "", + i = -1, + a = 0, + c = 0, + l = !1, + P = { + iWndIndex: u, + iStreamType: 1, + iChannelID: 1, + bZeroChannel: !1 + }; + if (f.extend(P, t), -1 != r) { + te(d[r]); + var h = d[r]; + if (re()) { + if (!h.bSupportWebsocket) return void(t.error && t.error(403, oe())); + s = h.oProtocolInc.CGI.startWsRealPlay, + o = "ws://", + B(P.iWSPort) ? h.iWSPort = 7681 : h.iWSPort = P.iWSPort, + i = h.iWSPort, + c = P.iStreamType, + a = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID: h.oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, + l = !0 + } else { + var I = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10); + I == W && h.oStreamCapa.bSupportShttpPlay ? (_("SHTTP RealPlay"), s = h.oProtocolInc.CGI.startShttpRealPlay, o = "http://", c = P.iStreamType - 1, a = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID: h.oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, l = !0, B(P.iPort) ? "https://" == h.szHttpProtocol ? ( - 1 == h.iHttpPort && (h.iHttpPort = J(h).iHttpPort), i = h.iHttpPort) : i = h.iCGIPort: (h.iHttpPort = P.iPort, i = P.iPort)) : (_("RTSP RealPlay"), s = h.oProtocolInc.CGI.startRealPlay, o = "rtsp://", c = P.iStreamType, a = P.iChannelID, B(P.iRtspPort) || (h.iRtspPort = P.iRtspPort), -1 == h.iRtspPort && (h.iRtspPort = J(h).iRtspPort), i = h.iRtspPort) + } + if ( - 1 == i) return _("获取端口号失败"), + void(t.error && t.error()); + if (f.extend(P, { + urlProtocol: o, + cgi: s, + iPort: i, + iStreamType: c, + iChannelID: a + }), r = this.findWndIndexByIndex(P.iWndIndex), -1 == r) if (re()) h.oProtocolInc.startRealPlay(h, P).then(function() { + r = this.findWndIndexByIndex(P.iWndIndex); + var e = p[r]; + e.bShttpIPChannel = l, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + // console.log(h, P); + var m = h.oProtocolInc.startRealPlay(h, P); + if (0 == m) { + r = this.findWndIndexByIndex(P.iWndIndex); + var S = p[r]; + S.bShttpIPChannel = l, + t.success && t.success() + } else h.iRtspPort = -1, + t.error && t.error() + } + } else t.error && t.error() + }, + this.I_Stop = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + var r = p[n]; + if (r.bRecord && (re() || c.HWP_StopSave(r.iIndex)), r.bSound && (re() || c.HWP_CloseSound()), r.bEZoom && (re() || c.HWP_DisableZoom(r.iIndex)), re()) c.JS_Stop(t.iWndIndex).then(function() { + p.splice(n, 1), + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var s = c.HWP_Stop(t.iWndIndex); + 0 == s ? (p.splice(n, 1), t.success && t.success()) : t.error && t.error() + } + } else t.error && t.error() + }, + this.I_OpenSound = function(e) { + e = B(e) ? u: e; + var t = this.findWndIndexByIndex(e), + n = -1; + if ( - 1 != t) { + var r = p[t]; + r.bSound || (n = re() ? c.JS_OpenSound(e) : c.HWP_OpenSound(e), 0 == n && (r.bSound = !0)) + } + return n + }, + this.I_CloseSound = function(e) { + e = B(e) ? u: e; + var t = this.findWndIndexByIndex(e), + n = -1; + if ( - 1 != t) { + var r = p[t]; + r.bSound && (n = re() ? c.JS_CloseSound() : c.HWP_CloseSound(), 0 == n && (r.bSound = !1)) + } + return n + }, + this.I_SetVolume = function(e, t) { + var n = -1; + if (e = parseInt(e, 10), isNaN(e)) return n; + if (0 > e || e > 100) return n; + t = B(t) ? u: t; + var r = this.findWndIndexByIndex(t); + return - 1 != r && (re() ? (c.JS_SetVolume(t, e), n = 0) : n = c.HWP_SetVolume(t, e)), + n + }, + this.I_CapturePic = function(e, t) { + var n = { + iWndIndex: u, + bDateDir: !0 + }; + N(t) ? f.extend(n, t) : B(t) || (n.iWndIndex = t); + var r = this.findWndIndexByIndex(n.iWndIndex), + s = -1; + if ( - 1 != r) if (re()) { + var o = "JPEG"; + ".jpg" === e.slice( - 4).toLowerCase() ? e = e.slice(0, -4) : ".jpeg" === e.slice( - 5).toLowerCase() ? e = e.slice(0, -5) : ".bmp" === e.slice( - 4).toLowerCase() && (e = e.slice(0, -4), o = "BMP"), + s = c.JS_CapturePicture(n.iWndIndex, e, o) + } else ".jpg" === e.slice( - 4).toLowerCase() ? e = e.slice(0, -4) : ".jpeg" === e.slice( - 5).toLowerCase() && (e = e.slice(0, -5)), + s = c.HWP_CapturePicture(n.iWndIndex, e, n.bDateDir); + return s + }, + this.I_StartRecord = function(e, t) { + var n = { + iWndIndex: u, + bDateDir: !0 + }; + N(t) ? f.extend(n, t) : B(t) || (n.iWndIndex = t); + var r = this.findWndIndexByIndex(n.iWndIndex); + if ( - 1 != r) { + var s = p[r]; + if (s.bRecord) n.error && n.error(); + else if (re()) { + var o = f.browser(); + o.chrome ? c.JS_StartSave(n.iWndIndex, e).then(function() { + s.bRecord = !0, + n.success && n.success() + }, + function() { + n.error && n.error() + }) : n.error && n.error() + } else { + var i = c.HWP_StartSave(n.iWndIndex, e, n.bDateDir); + 0 == i ? (s.bRecord = !0, n.success && n.success()) : n.error && n.error() + } + } else n.error && n.error() + }, + this.I_StopRecord = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + var r = p[n]; + if (r.bRecord) if (re()) { + var s = f.browser(); + s.chrome ? c.JS_StopSave(t.iWndIndex).then(function() { + r.bRecord = !1, + t.success && t.success() + }, + function() { + t.error && t.error() + }) : t.error && t.error() + } else { + var o = c.HWP_StopSave(t.iWndIndex); + 0 == o ? (r.bRecord = !1, t.success && t.success()) : t.error && t.error() + } else t.error && t.error() + } else t.error && t.error() + }, + this.I_StartVoiceTalk = function(e, t) { + if (isNaN(parseInt(t, 10))) return - 1; + var n = this.findDeviceIndexByIP(e), + r = -1; + if ( - 1 != n) { + var s = d[n]; + s.bVoiceTalk || (r = re() ? -1 : s.oProtocolInc.startVoiceTalk(s, t), 0 == r && (d[n].bVoiceTalk = !0)) + } + return r + }, + this.I_StopVoiceTalk = function() { + var e = -1; + if (!re()) { + e = c.HWP_StopVoiceTalk(); + for (var t = 0, + n = d.length; n > t; t++) if (d[t].bVoiceTalk) { + d[t].bVoiceTalk = !1; + break + } + } + return e + }, + this.I_PTZControl = function(e, t, n) { + // debugger + var r = { + iWndIndex: u, + iPTZIndex: e, + iPTZSpeed: 4 + }; + f.extend(r, n), + f.extend(r, { + async: !1 + }); + var s = this.findWndIndexByIndex(r.iWndIndex); + if ( - 1 != s) { + var o = p[s]; + if (s = this.findDeviceIndexByIP(o.szIP), -1 != s) { + var i = d[s]; + 9 == e ? i.oProtocolInc.ptzAutoControl(i, t, o, r) : i.oProtocolInc.ptzControl(i, t, o, r) + } + } + }, + this.I_EnableEZoom = function(e) { + e = B(e) ? u: e; + var t = this.findWndIndexByIndex(e), + n = -1; + if ( - 1 != t) { + var r = p[t]; + r.bEZoom || (n = re() ? c.JS_EnableZoom(e) : c.HWP_EnableZoom(e, 0), 0 == n && (r.bEZoom = !0)) + } + return n + }, + this.I_DisableEZoom = function(e) { + e = B(e) ? u: e; + var t = this.findWndIndexByIndex(e), + n = -1; + if ( - 1 != t) { + var r = p[t]; + r.bEZoom && (re() ? n = c.JS_DisableZoom(e) : (c.HWP_DisableZoom(e), n = 0), 0 == n && (r.bEZoom = !1)) + } + return n + }, + this.I_Enable3DZoom = function(e) { + e = B(e) ? u: e; + var t = this.findWndIndexByIndex(e), + n = -1; + if ( - 1 != t) { + var r = p[t]; + r.b3DZoom || (n = re() ? -1 : c.HWP_EnableZoom(e, 1), 0 == n && (r.b3DZoom = !0)) + } + return n + }, + this.I_Disable3DZoom = function(e) { + e = B(e) ? u: e; + var t = this.findWndIndexByIndex(e), + n = -1; + if ( - 1 != t) { + var r = p[t]; + r.b3DZoom && (re() ? n = -1 : (c.HWP_DisableZoom(e), n = 0), 0 == n && (r.b3DZoom = !1)) + } + return n + }, + this.I_FullScreen = function(e) { + re() ? c.JS_FullScreenDisplay(e) : c.HWP_FullScreenDisplay(e) + }, + this.I_SetPreset = function(e, t) { + var n = { + iWndIndex: u, + iPresetID: e + }; + f.extend(n, t); + var r = this.findWndIndexByIndex(n.iWndIndex); + if ( - 1 != r) { + var s = p[r]; + if (r = this.findDeviceIndexByIP(s.szIP), -1 != r) { + var o = d[r]; + o.oProtocolInc.setPreset(o, s, n) + } + } + }, + this.I_GoPreset = function(e, t) { + var n = { + iWndIndex: u, + iPresetID: e + }; + f.extend(n, t); + var r = this.findWndIndexByIndex(n.iWndIndex); + if ( - 1 != r) { + var s = p[r]; + if (r = this.findDeviceIndexByIP(s.szIP), -1 != r) { + var o = d[r]; + o.oProtocolInc.goPreset(o, s, n) + } + } + }, + this.I_RecordSearch = function(e, t, n, r, s) { + var o = this.findDeviceIndexByIP(e); + if ( - 1 != o) { + var i = d[o], + a = { + iChannelID: t, + szStartTime: n, + szEndTime: r, + iSearchPos: 0, + iStreamType: 1, + success: null, + error: null + }; + f.extend(a, s), + i.oProtocolInc.recordSearch(i, a) + } + }, + this.I_StartPlayback = function(e, t) { + var r = this.findDeviceIndexByIP(e), + s = "", + o = "", + i = -1, + a = 1, + c = 0, + l = f.dateFormat(new Date, "yyyy-MM-dd"), + p = { + iWndIndex: u, + iStreamType: 1, + iChannelID: 1, + szStartTime: l + " 00:00:00", + szEndTime: l + " 23:59:59" + }; + if (f.extend(p, t), -1 != r) { + te(d[r]); + var P = d[r]; + if (re()) { + if (!P.bSupportWebsocket) return void(t.error && t.error(403, oe())); + if (!B(p.oTransCodeParam)) return void(t.error && t.error()); + s = P.oProtocolInc.CGI.startWsPlayback, + o = "ws://", + B(p.iWSPort) ? P.iWSPort = 7681 : P.iWSPort = p.iWSPort, + i = P.iWSPort, + c = p.iStreamType, + a = p.iChannelID <= P.iAnalogChannelNum ? p.iChannelID: P.oStreamCapa.iIpChanBase + parseInt(p.iChannelID, 10) - P.iAnalogChannelNum - 1, + a = 100 * a + c + } else { + var h = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10); + h == W && P.oStreamCapa.bSupportShttpPlay ? (s = B(p.oTransCodeParam) ? P.oProtocolInc.CGI.startShttpPlayback: P.oProtocolInc.CGI.startTransCodePlayback, o = "http://", c = p.iStreamType - 1, a = p.iChannelID <= P.iAnalogChannelNum ? p.iChannelID: P.oStreamCapa.iIpChanBase + parseInt(p.iChannelID, 10) - P.iAnalogChannelNum - 1, P.bSupportSubStreamPlayback && (a = 100 * a + c), B(p.iPort) ? "https://" == P.szHttpProtocol ? ( - 1 == P.iHttpPort && (P.iHttpPort = J(P).iHttpPort), i = P.iHttpPort) : i = P.iCGIPort: (P.iHttpPort = p.iPort, i = p.iPort)) : (s = P.oProtocolInc.CGI.startPlayback, o = "rtsp://", c = p.iStreamType, a = 100 * p.iChannelID + c, B(p.iRtspPort) || (P.iRtspPort = p.iRtspPort), -1 == P.iRtspPort && (P.iRtspPort = J(P).iRtspPort), i = P.iRtspPort) + } + if ( - 1 == i) return _("获取端口号失败"), + void(t.error && t.error()); + if (f.extend(p, { + urlProtocol: o, + cgi: s, + iPort: i, + iChannelID: a + }), r = this.findWndIndexByIndex(p.iWndIndex), -1 == r) if (re()) p.szStartTime = p.szStartTime.replace(" ", "T") + "Z", + p.szEndTime = p.szEndTime.replace(" ", "T") + "Z", + P.oProtocolInc.startPlayback(P, p).then(function() { + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + p.szStartTime = p.szStartTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", + p.szEndTime = p.szEndTime.replace(/[-:]/g, "").replace(" ", "T") + "Z"; + var I = P.oProtocolInc.startPlayback(P, p); + 0 == I ? t.success && t.success() : (P.iRtspPort = -1, t.error && t.error()) + } + } else t.error && t.error() + }, + this.I_ReversePlayback = function(e, t) { + var r = this.findDeviceIndexByIP(e), + s = -1, + o = "", + i = "", + a = -1, + c = -1, + l = 0, + p = f.dateFormat(new Date, "yyyy-MM-dd"), + P = { + iWndIndex: u, + iStreamType: 1, + iChannelID: 1, + szStartTime: p + " 00:00:00", + szEndTime: p + " 23:59:59" + }; + if (f.extend(P, t), -1 != r) { + te(d[r]); + var h = d[r]; + if (re()) return s; + var I = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10); + if (I == W && h.oStreamCapa.bSupportShttpPlay ? (o = h.oProtocolInc.CGI.startShttpReversePlayback, i = "http://", l = P.iStreamType - 1, c = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID: h.oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, c = 100 * c + l, B(P.iPort) ? "https://" == h.szHttpProtocol ? ( - 1 == h.iHttpPort && (h.iHttpPort = J(h).iHttpPort), a = h.iHttpPort) : a = h.iCGIPort: (h.iHttpPort = P.iPort, a = P.iPort)) : (o = h.oProtocolInc.CGI.startPlayback, i = "rtsp://", l = P.iStreamType, c = 100 * P.iChannelID + l, B(P.iRtspPort) || (h.iRtspPort = P.iRtspPort), -1 == h.iRtspPort && (h.iRtspPort = J(h).iRtspPort), a = h.iRtspPort), -1 == a) return _("获取端口号失败"), + s; + f.extend(P, { + urlProtocol: i, + cgi: o, + iPort: a, + iChannelID: c + }), + r = this.findWndIndexByIndex(P.iWndIndex), + -1 == r && (P.szStartTime = P.szStartTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", P.szEndTime = P.szEndTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", s = h.oProtocolInc.reversePlayback(h, P)) + } + return - 1 == s && (h.iRtspPort = -1), + s + }, + this.I_Frame = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + var r = p[n], + s = r.iPlayStatus; + if (s == D || s == T) if (re()) c.JS_FrameForward(t.iWndIndex).then(function() { + r.iPlayStatus = T, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var o = c.HWP_FrameForward(t.iWndIndex); + 0 == o ? (r.iPlayStatus = T, t.success && t.success()) : t.error && t.error() + } else t.error && t.error() + } else t.error && t.error() + }, + this.I_Pause = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + var r = p[n], + s = r.iPlayStatus, + o = -1; + if (s == D) o = z; + else { + if (s != b) return void(t.error && t.error()); + o = A + } + if (re()) c.JS_Pause(t.iWndIndex).then(function() { + r.iPlayStatus = o, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var i = c.HWP_Pause(t.iWndIndex); + 0 == i ? (r.iPlayStatus = o, t.success && t.success()) : t.error && t.error() + } + } else t.error && t.error() + }, + this.I_Resume = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + var r = p[n], + s = r.iPlayStatus, + o = -1; + if (s == z || s == T) o = D; + else { + if (s != A) return void(t.error && t.error()); + o = b + } + if (re()) c.JS_Resume(t.iWndIndex).then(function() { + r.iPlayStatus = o, + t.success && t.success() + }, + function() { + t.error && t.error() + }); + else { + var i = c.HWP_Resume(t.iWndIndex); + 0 == i ? (r.iPlayStatus = o, t.success && t.success()) : t.error && t.error() + } + } else t.error && t.error() + }, + this.I_PlaySlow = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + var r = p[n]; + if (r.iPlayStatus == D) if (re()) { + var s = c.JS_GetWndStatus(t.iWndIndex); + s.iRate <= -4 ? t.error && t.error() : c.JS_Slow(t.iWndIndex).then(function() { + t.success && t.success() + }, + function() { + t.error && t.error() + }) + } else { + var o = c.HWP_Slow(t.iWndIndex); + 0 == o ? t.success && t.success() : t.error && t.error() + } else t.error && t.error() + } else t.error && t.error() + }, + this.I_PlayFast = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + var r = p[n]; + if (r.iPlayStatus == D) if (re()) { + var s = c.JS_GetWndStatus(t.iWndIndex); + s.iRate >= 4 ? t.error && t.error() : c.JS_Fast(t.iWndIndex).then(function() { + t.success && t.success() + }, + function() { + t.error && t.error() + }) + } else { + var o = c.HWP_Fast(t.iWndIndex); + 0 == o ? t.success && t.success() : t.error && t.error() + } else t.error && t.error() + } else t.error && t.error() + }, + this.I_GetOSDTime = function(e) { + var t = { + iWndIndex: u + }; + N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e); + var n = this.findWndIndexByIndex(t.iWndIndex); + if ( - 1 != n) { + if (re()) c.JS_GetOSDTime(t.iWndIndex).then(function(e) { + if (t.success) { + var n = f.dateFormat(new Date(1e3 * e), "yyyy-MM-dd hh:mm:ss"); + t.success(n) + } + }, + function() { + t.error && t.error() + }); + else if (t.success) { + var r = c.HWP_GetOSDTime(t.iWndIndex), + s = f.dateFormat(new Date(1e3 * r), "yyyy-MM-dd hh:mm:ss"); + t.success(s) + } + } else t.error && t.error() + }, + this.I_StartDownloadRecord = function(e, t, n, r) { + var s = this.findDeviceIndexByIP(e), + o = -1; + if ( - 1 != s) { + var i = d[s], + a = { + szPlaybackURI: t, + szFileName: n, + bDateDir: !0 + }; + B(r) || f.extend(a, r), + o = i.oProtocolInc.startDownloadRecord(i, a) + } + return o + }, + this.I_GetDownloadStatus = function(e) { + var t = -1; + return re() ? t: (t = c.HWP_GetDownloadStatus(e), 1 == t && (t = -1), t) + }, + this.I_GetDownloadProgress = function(e) { + return re() ? -1 : c.HWP_GetDownloadProgress(e); + }, + this.I_StopDownloadRecord = function(e) { + return re() ? -1 : c.HWP_StopDownload(e) + }, + this.I_ExportDeviceConfig = function(e) { + var t = this.findDeviceIndexByIP(e), + n = -1; + if ( - 1 != t) { + var r = d[t]; + if (re()) return n; + n = r.oProtocolInc.exportDeviceConfig(r) + } + return n + }, + this.I_ImportDeviceConfig = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = -1; + if ( - 1 != n) { + var s = d[n], + o = { + szFileName: t + }; + if (re()) return r; + r = s.oProtocolInc.importDeviceConfig(s, o) + } + return r + }, + this.I_RestoreDefault = function(e, t, n) { + var r = { + success: null, + error: null + }; + f.extend(r, n); + var s = this.findDeviceIndexByIP(e); + if ( - 1 != s) { + var o = d[s]; + o.oProtocolInc.restore(o, t, r) + } + }, + this.I_Restart = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = { + success: null, + error: null + }; + if (f.extend(r, t), -1 != n) { + var s = d[n]; + s.oProtocolInc.restart(s, r) + } + }, + this.I_Reconnect = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = { + success: null, + error: null + }; + if (f.extend(r, t), -1 != n) { + var s = d[n]; + s.oProtocolInc.login(s.szIP, s.iCGIPort, s.szAuth, r) + } + }, + this.I_StartUpgrade = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = -1; + if ( - 1 != n) { + var s = d[n], + o = { + szFileName: t + }; + if (re()) return r; + r = s.oProtocolInc.startUpgrade(s, o) + } + return r + }, + this.I_UpgradeStatus = function() { + return re() ? -1 : c.HWP_UpgradeStatus() + }, + this.I_UpgradeProgress = function() { + return re() ? -1 : c.HWP_UpgradeProgress() + }, + this.I_StopUpgrade = function() { + return re() ? -1 : c.HWP_StopUpgrade() + }, + this.I_CheckPluginInstall = function() { + var e = -1, + t = f.browser(); + if (re()) e = 0; + else if (t.msie) try { + new ActiveXObject("WebVideoKitActiveX.WebVideoKitActiveXCtrl.1"); + e = 0 + } catch(n) {} else for (var r = 0, + s = navigator.mimeTypes.length; s > r; r++) if ("application/webvideo-plugin-kit" == navigator.mimeTypes[r].type.toLowerCase()) { + e = 0; + break + } + return e + }, + this.I_CheckPluginVersion = function() { + return re() ? 0 : c.HWP_CheckPluginUpdate(k) ? -1 : 0 + }, + this.I_SendHTTPRequest = function(e, t, n) { + var r = this.findDeviceIndexByIP(e); + if (! (0 > r)) { + var s = d[r], + o = new ue, + i = s.szHttpProtocol + s.szIP + ":" + s.iCGIPort + "/" + t, + a = { + type: "GET", + url: i, + auth: s.szAuth, + success: null, + error: null + }; + f.extend(a, n), + f.extend(a, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + o.setRequestParam(a), + o.submitRequest() + } + }, + this.I_RemoteConfig = function(e, t) { + var n = this.findDeviceIndexByIP(e), + r = -1, + s = -1; + if (re()) return r; + var o = { + iLan: 0, + iDevicePort: -1, + iType: 0 + }; + if (f.extend(o, t), -1 != n) { + var i = d[n]; + if ( - 1 == o.iDevicePort) if ( - 1 == i.iDevicePort) { + if (i.iDevicePort = J(i).iDevicePort, s = i.iDevicePort, -1 == s) return r + } else s = i.iDevicePort; + else s = o.iDevicePort; + if (":" == f.Base64.decode(i.szAuth)[0]) var a = f.Base64.decode(i.szAuth).split(":")[1], + u = f.Base64.decode(i.szAuth).split(":")[2]; + else var a = f.Base64.decode(i.szAuth).split(":")[0], + u = f.Base64.decode(i.szAuth).split(":")[1]; + var l = "" + o.iType + "" + o.iLan + "" + i.szIP + "" + s + "" + a + "" + f.Base64.encode(u) + ""; + return c.HWP_ShowRemConfig(l) + } + return r + }, + this.I_ChangeWndNum = function(e) { + return isNaN(parseInt(e, 10)) ? -1 : (re() ? c.JS_ArrangeWindow(e) : c.HWP_ArrangeWindow(e), 0) + }, + this.I_GetLastError = function() { + return re() ? -1 : c.HWP_GetLastError() + }, + this.I_GetWindowStatus = function(e) { + if (B(e)) { + var t = []; + return f.extend(t, p), + t + } + var n = this.findWndIndexByIndex(e); + if ( - 1 != n) { + var t = {}; + return f.extend(t, p[n]), + t + } + return null + }, + this.I_GetIPInfoByMode = function(e, t, n, r) { + return re() ? "": c.HWP_GetIpInfoByMode(e, t, n, r) + }, + this.I_SetPlayModeType = function(e) { + return re() ? -1 : c.HWP_SetPlayModeType(e) + }, + this.I_SetSnapDrawMode = function(e, t) { + return re() ? -1 : c.HWP_SetSnapDrawMode(e, t) + }, + this.I_SetSnapPolygonInfo = function(e, t) { + if (re()) return - 1; + var r, s, o, i, a, u, l, d, p, P, h, I, m, C = c.HWP_GetSnapPolygonInfo(e); + // console.log("921", r); + r = f.loadXML(C), + s = n.$XML(r).find("SnapPolygon", !0); + + var S = s.length, + v = []; + for (o = 0, i = s.length; i > o; o++) a = s[o], + v.push(n.$XML(a).find("id").eq(0).text()); + var y = v.join(","); + // console.log("927"); + if (y = "," + y + ",", r = f.loadXML(t), s = n.$XML(r).find("SnapPolygon", !0), S + s.length > 32) return - 3; + for (o = 0, i = s.length; i > o; o++) { + if (a = s[o], u = n.$XML(a).find("id").eq(0).text(), !f.isInt(u)) return - 2; + if (l = parseInt(u, 10), 1 > l || l > 32) return - 2; + if (y.indexOf("," + u + ",") > -1) return - 4; + if (d = n.$XML(a).find("tips").eq(0).text(), d.length > 32) return - 2; + if (h = "true" === n.$XML(a).find("isClosed").eq(0).text(), !h) { + if (p = n.$XML(a).find("MinClosed").eq(0).text(), !f.isInt(p)) return - 2; + if (P = parseInt(p, 10), 4 > P || P > 17) return - 2; + if (I = n.$XML(a).find("PointNumMax").eq(0).text(), !f.isInt(I)) return - 2; + if (m = parseInt(I, 10), P > m || m > 17) return - 2 + } + } + return c.HWP_SetSnapPolygonInfo(e, t) + }, + this.I_GetSnapPolygonInfo = function(e) { + return re() ? "": c.HWP_GetSnapPolygonInfo(e) + }, + this.I_ClearSnapInfo = function(e) { + return re() ? -1 : c.HWP_ClearSnapInfo(e, 1) + }, + this.I_DeviceCapturePic = function(e, t, n, r) { + var s = this.findDeviceIndexByIP(e), + o = -1; + if ( - 1 != s) { + var i = d[s], + a = { + bDateDir: !0 + }; + if (f.extend(a, r), !B(a.iResolutionWidth) && !f.isInt(a.iResolutionWidth)) return o; + if (!B(a.iResolutionHeight) && !f.isInt(a.iResolutionHeight)) return o; + o = i.oProtocolInc.deviceCapturePic(i, t, n, a) + } + return o + }, + this.I_SetPackageType = function(e) { + return re() ? -1 : c.HWP_SetPackageType(e) + }, + this.I_GetDevicePort = function(e) { + + var t = this.findDeviceIndexByIP(e), + n = null; + if ( - 1 != t) { + var r = d[t]; + n = J(r) + } + return n + }, + this.findDeviceIndexByIP = function(e) { + if (e.indexOf("_") > -1) { + for (var t = 0, + n = d.length; n > t; t++) if (d[t].szDeviceIdentify == e) return t + } else for (var t = 0, + n = d.length; n > t; t++) if (d[t].szIP == e) return t; + return - 1 + }, + this.findWndIndexByIndex = function(e) { + for (var t = 0, + n = p.length; n > t; t++) if (p[t].iIndex == e) return t; + return - 1 + }; + var ae = function() { + this.szIP = "", + this.szHostName = "", + this.szAuth = "", + this.szHttpProtocol = "http://", + this.iCGIPort = 80, + this.szDeviceIdentify = "", + this.iDevicePort = -1, + this.iHttpPort = -1, + this.iHttpsPort = -1, + this.iRtspPort = -1, + this.iWSPort = -1, + this.iAudioType = 1, + this.m_iAudioBitRate = -1, + this.m_iAudioSamplingRate = -1, + this.iDeviceProtocol = S, + this.oProtocolInc = null, + this.iAnalogChannelNum = 0, + this.szDeviceType = "", + this.bVoiceTalk = !1, + this.oStreamCapa = { + bObtained: !1, + bSupportShttpPlay: !1, + bSupportShttpPlayback: !1, + bSupportShttpsPlay: !1, + bSupportShttpsPlayback: !1, + bSupportShttpPlaybackTransCode: !1, + bSupportShttpsPlaybackTransCode: !1, + iIpChanBase: 1 + } + }, + ce = function() { + this.iIndex = 0, + this.szIP = "", + this.iCGIPort = 80, + this.szDeviceIdentify = "", + this.iChannelID = "", + this.iPlayStatus = g, + this.bSound = !1, + this.bRecord = !1, + this.bPTZAuto = !1, + this.bEZoom = !1, + this.b3DZoom = !1 + }, + ue = function() { + this.options = { + type: "GET", + url: "", + auth: "", + timeout: 1e4, + data: "", + async: !0, + success: null, + error: null + }, + this.m_szHttpHead = "", + this.m_szHttpContent = "", + this.m_szHttpData = "" + }; + ue.prototype.m_httpRequestSet = [], + ue.prototype.setRequestParam = function(e) { + f.extend(this.options, e) + }, + ue.prototype.submitRequest = function() { + var t = null, + n = this; + if (re()) { + this.options.auth ? f.cookie("WebSession", this.options.auth) : f.cookie("WebSession", null); + var r = se(this.options.url), + s = new XMLHttpRequest(); + s.open(this.options.type, r, this.options.async), + s.setRequestHeader("X-Requested-With", "XMLHttpRequest"), + s.setRequestHeader("If-Modified-Since", "0"), + s.send(this.options.data || null); + var o = function() { + if (4 === s.readyState) { + t = { + funSuccessCallback: n.options.success, + funErrorCallback: n.options.error + }; + var e = s.status + s.responseText; + 0 === s.status && (e = ""), + n.httpDataAnalyse(t, e) + } + }; + this.options.async ? (s.timeout = this.options.timeout, s.onreadystatechange = function() { + o() + }) : o() + } else { + var i = this.getHttpMethod(this.options.type); + if (this.options.async) { + var a = c.HWP_SubmitHttpRequest(i, this.options.url, this.options.auth, this.options.data, this.options.timeout); - 1 != a && (t = { + iRequestID: a, + funSuccessCallback: this.options.success, + funErrorCallback: this.options.error + }, + this.m_httpRequestSet.push(t)) + } else { + var u = c.HWP_SendHttpSynRequest(i, this.options.url, this.options.auth, this.options.data, this.options.timeout); + t = { + funSuccessCallback: this.options.success, + funErrorCallback: this.options.error + }, + this.httpDataAnalyse(t, u) + } + } + }, + ue.prototype.getHttpMethod = function(e) { + var t = { + GET: 1, + POST: 2, + PUT: 5, + DELETE: 6 + }, + n = t[e]; + return n ? n: -1 + }, + ue.prototype.processCallback = function(e, t) { + for (var n = null, + r = 0; r < this.m_httpRequestSet.length; r++) if (e == this.m_httpRequestSet[r].iRequestID) { + n = this.m_httpRequestSet[r], + this.m_httpRequestSet.splice(r, 1); + break + } + null != n && (this.httpDataAnalyse(n, t), delete n) + }, + ue.prototype.httpDataAnalyse = function(e, t) { + var n = "", + r = 0; + + "" == t || B(t) ? e.funErrorCallback() : (r = parseInt(t.substring(0, 3)), n = t.substring(3, t.length), isNaN(r) ? e.funErrorCallback() : y == r ? e.funSuccessCallback(f.loadXML2(n)) : e.funErrorCallback(r, f.loadXML2(n))) + }; + var le = function() {}; + le.prototype.CGI = { + login: "%s%s:%s/ISAPI/Security/userCheck", + getAudioInfo: "%s%s:%s/ISAPI/System/TwoWayAudio/channels", + getDeviceInfo: "%s%s:%s/ISAPI/System/deviceInfo", + getAnalogChannelInfo: "%s%s:%s/ISAPI/System/Video/inputs/channels", + getDigitalChannel: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels", + getDigitalChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels/status", + getZeroChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/ZeroVideo/channels", + getStreamChannels: { + analog: "%s%s:%s/ISAPI/Streaming/channels", + digital: "%s%s:%s/ISAPI/ContentMgmt/StreamingProxy/channels" + }, + getStreamDynChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels", + startRealPlay: { + channels: "%s%s:%s/PSIA/streaming/channels/%s", + zeroChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s" + }, + startShttpRealPlay: { + channels: "%s%s:%s/SDK/play/%s/004", + zeroChannels: "%s%s:%s/SDK/play/100/004/ZeroStreaming" + }, + startWsRealPlay: { + channels: "%s%s:%s/%s", + zeroChannels: "%s%s:%s/%s" + }, + startVoiceTalk: { + open: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/open", + close: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/close", + audioData: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/audioData" + }, + ptzControl: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/continuous", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/continuous" + }, + ptzAutoControl: { + ipdome: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto", + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/autoPan", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/autoPan" + }, + setPreset: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s" + }, + goPreset: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s/goto" + }, + ptzFocus: { + analog: "%s%s:%s/ISAPI/Image/channels/%s/focus", + digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/focus", + ipc: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/focus" + }, + ptzIris: { + analog: "%s%s:%s/ISAPI/Image/channels/%s/iris", + digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/iris", + ipc: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/iris" + }, + getNetworkBond: "%s%s:%s/ISAPI/System/Network/Bond", + getNetworkInterface: "%s%s:%s/ISAPI/System/Network/interfaces", + getUPnPPortStatus: "%s%s:%s/ISAPI/System/Network/UPnP/ports/status", + getPPPoEStatus: "%s%s:%s/ISAPI/System/Network/PPPoE/1/status", + getPortInfo: "%s%s:%s/ISAPI/Security/adminAccesses", + recordSearch: "%s%s:%s/ISAPI/ContentMgmt/search", + startPlayback: "%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%s", + startWsPlayback: "%s%s:%s/%s", + startShttpPlayback: "%s%s:%s/SDK/playback/%s", + startShttpReversePlayback: "%s%s:%s/SDK/playback/%s/reversePlay", + startTransCodePlayback: "%s%s:%s/SDK/playback/%s/transcoding", + startDownloadRecord: "%s%s:%s/ISAPI/ContentMgmt/download", + deviceConfig: "%s%s:%s/ISAPI/System/configurationData", + restart: "%s%s:%s/ISAPI/System/reboot", + restore: "%s%s:%s/ISAPI/System/factoryReset?mode=%s", + startUpgrade: { + upgrade: "%s%s:%s/ISAPI/System/updateFirmware", + status: "%s%s:%s/ISAPI/System/upgradeStatus" + }, + set3DZoom: { + analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/position3D", + digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/position3D" + }, + SDKCapabilities: "%s%s:%s/SDK/capabilities", + deviceCapture: { + channels: "%s%s:%s/ISAPI/Streaming/channels/%s/picture" + }, + sessionCap: "%s%s:%s/ISAPI/Security/sessionLogin/capabilities?username=%s", + sessionLogin: "%s%s:%s/ISAPI/Security/sessionLogin", + sessionHeartbeat: "%s%s:%s/ISAPI/Security/sessionHeartbeat", + sessionLogout: "%s%s:%s/ISAPI/Security/sessionLogout", + systemCapabilities: "%s%s:%s/ISAPI/System/capabilities" + }, + le.prototype.login = function(e, t, n, r) { + var s = 2 == r.protocol ? "https://": "http://", + o = E(this.CGI.login, s, e, t), + i = new ue, + a = { + type: "GET", + url: o, + auth: n, + success: null, + error: null + }; + f.extend(a, r), + f.extend(a, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + i.setRequestParam(a), + i.submitRequest() + }, + le.prototype.getAudioInfo = function(e, t) { + var n = E(this.CGI.getAudioInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getDeviceInfo = function(e, t) { + var r = E(this.CGI.getDeviceInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""), + r.push("" + f.escape(n.$XML(e).find("deviceName").eq(0).text()) + ""), + r.push("" + n.$XML(e).find("deviceID").eq(0).text() + ""), + r.push("" + n.$XML(e).find("deviceType").eq(0).text() + ""), + r.push("" + n.$XML(e).find("model").eq(0).text() + ""), + r.push("" + n.$XML(e).find("serialNumber").eq(0).text() + ""), + r.push("" + n.$XML(e).find("macAddress").eq(0).text() + ""), + r.push("" + n.$XML(e).find("firmwareVersion").eq(0).text() + ""), + r.push("" + n.$XML(e).find("firmwareReleasedDate").eq(0).text() + ""), + r.push("" + n.$XML(e).find("encoderVersion").eq(0).text() + ""), + r.push("" + n.$XML(e).find("encoderReleasedDate").eq(0).text() + ""), + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess &&t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.getAnalogChannelInfo = function(e, t) { + var r = E(this.CGI.getAnalogChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("VideoInputChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + n.$XML(a).find("inputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("" + n.$XML(a).find("videoFormat").eq(0).text() + ""), + r.push("") + } + // console.log("1171", r); + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess &&t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.getDigitalChannel = function(e, t) { + var r = E(this.CGI.getDigitalChannel, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("InputProxyChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("") + } + // console.log("1188", r); + + r.push(""), + e = f.loadXML2(r.join("")), + t.success && t.success(e), + t.mysuccess &&t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.getDigitalChannelInfo = function(e, t) { + var r = null, + s = {}; + if (this.getDigitalChannel(e, { + async: !1, + success: function(e) { + r = e; + for (var t = n.$XML(r).find("InputProxyChannel", !0), o = 0, i = t.length; i > o; o++) { + var a = t[o], + c = n.$XML(a).find("id").eq(0).text(), + u = n.$XML(a).find("name").eq(0).text(); + s[c] = u + } + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), null !== r) { + var o = E(this.CGI.getDigitalChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + i = new ue, + a = { + type: "GET", + url: o, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(a, t), + f.extend(a, { + success: function(e) { + var r = []; + r.push(""); + for (var o = n.$XML(e).find("InputProxyChannelStatus", !0), i = 0, a = o.length; a > i; i++) { + var c = o[i], + u = n.$XML(c).find("id").eq(0).text(); + r.push(""), + r.push("" + u + ""), + r.push(""), + r.push("" + n.$XML(c).find("proxyProtocol").eq(0).text() + ""), + r.push("" + n.$XML(c).find("addressingFormatType").eq(0).text() + ""), + r.push("" + n.$XML(c).find("ipAddress").eq(0).text() + ""), + r.push("" + n.$XML(c).find("managePortNo").eq(0).text() + ""), + r.push("" + n.$XML(c).find("srcInputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(c).find("userName").eq(0).text()) + ""), + r.push("" + n.$XML(c).find("streamType").eq(0).text() + ""), + r.push("" + n.$XML(c).find("online").eq(0).text() + ""), + r.push("" + f.escape(s[u]) + ""), + r.push(""), + r.push("") + } + // console.log("1217", r); + r.push(""), + e = f.loadXML2(r.join("")), + t.success && t.success(e), + t.mysuccess &&t.mysuccess(r.join("")) + // t.success && t.success(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + i.setRequestParam(a), + i.submitRequest() + } + }, + le.prototype.getZeroChannelInfo = function(e, t) { + var n = E(this.CGI.getZeroChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getStreamChannels = function(e, t) { + if (0 != e.iAnalogChannelNum) var n = E(this.CGI.getStreamChannels.analog, e.szHttpProtocol, e.szIP, e.iCGIPort); + else var n = E(this.CGI.getStreamChannels.digital, e.szHttpProtocol, e.szIP, e.iCGIPort); + var r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getPPPoEStatus = function(e, t) { + var n = E(this.CGI.getPPPoEStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getUPnPPortStatus = function(e, t) { + var n = E(this.CGI.getUPnPPortStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getNetworkBond = function(e, t) { + var n = E(this.CGI.getNetworkBond, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getNetworkInterface = function(e, t) { + + var n = E(this.CGI.getNetworkInterface, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getPortInfo = function(e, t) { + var n = E(this.CGI.getPortInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.startRealPlay = function(e, t) { + var n = 100 * t.iChannelID + t.iStreamType, + r = "", + s = -1, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)), + t.bZeroChannel ? (re() && (n = 0), r = E(t.cgi.zeroChannels, t.urlProtocol, o, t.iPort, n)) : r = E(t.cgi.channels, t.urlProtocol, o, t.iPort, n); + var i = function() { + var n = new ce; + n.iIndex = t.iWndIndex, + n.szIP = e.szIP, + n.iCGIPort = e.iCGIPort, + n.szDeviceIdentify = e.szDeviceIdentify, + n.iChannelID = t.iChannelID, + n.iPlayStatus = x, + p.push(n) + }; + if (re()) { + var a = new Promise(function(n, s) { + c.JS_Play(r, { + session: e.szAuth + }, + t.iWndIndex).then(function() { + i(), + n() + }, + function() { + s() + }) + }); + return a + } + return s = c.HWP_Play(r, e.szAuth, t.iWndIndex, "", ""), + 0 == s && i(), + s + }, + le.prototype.startVoiceTalk = function(e, t) { + var n = E(this.CGI.startVoiceTalk.open, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + r = E(this.CGI.startVoiceTalk.close, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = E(this.CGI.startVoiceTalk.audioData, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + o = c.HWP_StartVoiceTalkEx(n, r, s, e.szAuth, e.iAudioType, e.m_iAudioBitRate, e.m_iAudioSamplingRate); + return o + }, + le.prototype.ptzAutoControl = function(e, t, n, r) { + var s = n.iChannelID, + o = "", + i = ""; + if (r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed: 100, t && (r.iPTZSpeed = 0), e.szDeviceType != w) o = s <= e.iAnalogChannelNum ? E(this.CGI.ptzAutoControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID) : n.bShttpIPChannel ? E(this.CGI.ptzAutoControl.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(this.CGI.ptzAutoControl.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID), + i = "" + r.iPTZSpeed + ""; + else { + var a = 99; + t && (a = 96), + o = E(this.CGI.ptzAutoControl.ipdome, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID, a) + } + var c = new ue, + u = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }, + l = this; + f.extend(u, r), + f.extend(u, { + success: function(e) { + n.bPTZAuto = !n.bPTZAuto, + r.success && r.success(e) + }, + error: function(t, s) { + if (X == e.szDeviceType || H == e.szDeviceType) { + o = n.bShttpIPChannel ? E(l.CGI.ptzControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(l.CGI.ptzControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID), + i = "" + r.iPTZSpeed + "0"; + var a = new ue, + c = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }; + f.extend(c, r), + a.setRequestParam(c), + a.submitRequest() + } else r.error && r.error(t, s) + } + }), + c.setRequestParam(u), + c.submitRequest() + }, + le.prototype.ptzControl = function(e, t, n, r) { + var s = n.iChannelID, + o = ""; + n.bPTZAuto && this.ptzAutoControl(e, !0, n, { + iPTZSpeed: 0 + }), + t ? r.iPTZSpeed = 0 : r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed: 100; + var i = [{}, + { + pan: 0, + tilt: r.iPTZSpeed + }, + { + pan: 0, + tilt: -r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: 0 + }, + { + pan: r.iPTZSpeed, + tilt: 0 + }, + { + pan: -r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + {}, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }], + a = "", + c = {}; + switch (r.iPTZIndex) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + c = this.CGI.ptzControl, + a = "" + i[r.iPTZIndex].pan + "" + i[r.iPTZIndex].tilt + ""; + break; + case 10: + case 11: + c = this.CGI.ptzControl, + a = "" + i[r.iPTZIndex].speed + ""; + break; + case 12: + case 13: + c = this.CGI.ptzFocus, + a = "" + i[r.iPTZIndex].speed + ""; + break; + case 14: + case 15: + c = this.CGI.ptzIris, + a = "" + i[r.iPTZIndex].speed + ""; + break; + default: + return void(r.error && r.error()) + } + o = c != this.CGI.ptzFocus && c != this.CGI.ptzIris || e.szDeviceType != X && e.szDeviceType != w && e.szDeviceType != H ? s <= e.iAnalogChannelNum ? E(c.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID) : n.bShttpIPChannel ? E(c.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(c.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID) : E(c.ipc, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID); + var u = new ue, + l = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: a, + success: null, + error: null + }; + f.extend(l, r), + f.extend(l, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + u.setRequestParam(l), + u.submitRequest() + }, + le.prototype.setPreset = function(e, t, n) { + var r = t.iChannelID, + s = "", + o = ""; + s = r <= e.iAnalogChannelNum ? E(this.CGI.setPreset.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID) : t.bShttpIPChannel ? E(this.CGI.setPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum, n.iPresetID) : E(this.CGI.setPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID), + o = "", + o += "", + o += "" + n.iPresetID + "", + e.szDeviceType != w && (o += "Preset" + n.iPresetID + ""), + o += ""; + var i = new ue, + a = { + type: "PUT", + url: s, + auth: e.szAuth, + data: o, + success: null, + error: null + }; + f.extend(a, n), + f.extend(a, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + i.setRequestParam(a), + i.submitRequest() + }, + le.prototype.goPreset = function(e, t, n) { + var r = t.iChannelID, + s = ""; + s = r <= e.iAnalogChannelNum ? E(this.CGI.goPreset.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID) : t.bShttpIPChannel ? E(this.CGI.goPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum, n.iPresetID) : E(this.CGI.goPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID); + var o = new ue, + i = { + type: "PUT", + url: s, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(i, n), + f.extend(i, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + o.setRequestParam(i), + o.submitRequest() + }, + le.prototype.recordSearch = function(e, r) { + var s = "", + o = "", + i = r.iChannelID, + a = r.iStreamType, + c = r.szStartTime.replace(" ", "T") + "Z", + u = r.szEndTime.replace(" ", "T") + "Z"; + s = E(this.CGI.recordSearch, e.szHttpProtocol, e.szIP, e.iCGIPort), + o = "" + new t + "" + (100 * i + a) + "" + c + "" + u + "40" + r.iSearchPos + "//metadata.ISAPI.org/VideoMotion"; + var l = new ue, + d = { + type: "POST", + url: s, + auth: e.szAuth, + data: o, + success: null, + error: null + }; + f.extend(d, r), + f.extend(d, { + success: function(e) { + var t = []; + t.push(""), + t.push("" + n.$XML(e).find("responseStatus").eq(0).text() + ""), + t.push("" + n.$XML(e).find("responseStatusStrg").eq(0).text() + ""), + t.push("" + n.$XML(e).find("numOfMatches").eq(0).text() + ""), + t.push(""); + for (var s = n.$XML(e).find("searchMatchItem", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + t.push(""), + t.push("" + n.$XML(a).find("trackID").eq(0).text() + ""), + t.push("" + n.$XML(a).find("startTime").eq(0).text() + ""), + t.push("" + n.$XML(a).find("endTime").eq(0).text() + ""), + t.push("" + f.escape(n.$XML(a).find("playbackURI").eq(0).text()) + ""), + t.push("" + n.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[1] + ""), + t.push("") + } + t.push(""), + t.push(""), + e = f.loadXML(t.join("")), + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + l.setRequestParam(d), + l.submitRequest() + }, + le.prototype.startPlayback = function(e, t) { + var n = t.iWndIndex, + r = "", + s = t.szStartTime, + o = t.szEndTime, + i = e.szIP; + if ("rtsp://" === t.urlProtocol && (i = Z(i)), r = re() ? E(t.cgi, t.urlProtocol, i, t.iPort, t.iChannelID) : E(t.cgi, t.urlProtocol, i, t.iPort, t.iChannelID, s, o), !B(t.oTransCodeParam)) { + var a = ne(t.oTransCodeParam); + if ("" == a) return - 1; + c.HWP_SetTrsPlayBackParam(n, a) + } + var u = function() { + var r = new ce; + r.iIndex = n, + r.szIP = e.szIP, + r.iCGIPort = e.iCGIPort, + r.szDeviceIdentify = e.szDeviceIdentify, + r.iChannelID = t.iChannelID, + r.iPlayStatus = D, + p.push(r) + }; + if (re()) { + var l = new Promise(function(t, i) { + c.JS_Play(r, { + session: e.szAuth + }, + n, s, o).then(function() { + u(), + t() + }, + function() { + i() + }) + }); + return l + } + var d = c.HWP_Play(r, e.szAuth, n, s, o); + return 0 == d && u(), + d + }, + le.prototype.reversePlayback = function(e, t) { + var n = t.iWndIndex, + r = t.szStartTime, + s = t.szEndTime, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)); + var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s), + a = c.HWP_ReversePlay(i, e.szAuth, n, r, s); + if (0 == a) { + var u = new ce; + u.iIndex = n, + u.szIP = e.szIP, + u.iCGIPort = e.iCGIPort, + u.szDeviceIdentify = e.szDeviceIdentify, + u.iChannelID = t.iChannelID, + u.iPlayStatus = b, + p.push(u) + } + return a + }, + le.prototype.startDownloadRecord = function(e, t) { + var n = -1, + r = E(this.CGI.startDownloadRecord, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = " " + f.escape(t.szPlaybackURI) + ""; + return re() ? (r = se(r), n = c.JS_StartDownload(r, e.szAuth, t.szFileName, s)) : n = c.HWP_StartDownload(r, e.szAuth, t.szFileName, s, t.bDateDir), + n + }, + le.prototype.exportDeviceConfig = function(e) { + var t = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ExportDeviceConfig(t, e.szAuth, "", 0) + }, + le.prototype.importDeviceConfig = function(e, t) { + var n = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ImportDeviceConfig(n, e.szAuth, t.szFileName, 0) + }, + le.prototype.restart = function(e, t) { + var n = E(this.CGI.restart, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.restore = function(e, t, n) { + var r = E(this.CGI.restore, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = new ue, + o = { + type: "PUT", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, n), + f.extend(o, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + le.prototype.startUpgrade = function(e, t) { + var n = E(this.CGI.startUpgrade.upgrade, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = E(this.CGI.startUpgrade.status, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_StartUpgrade(n, r, e.szAuth, t.szFileName) + }, + le.prototype.set3DZoom = function(e, t, r, s) { + var o = t.iChannelID, + i = ""; + i = o <= e.iAnalogChannelNum ? E(this.CGI.set3DZoom.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID) : t.bShttpIPChannel ? E(this.CGI.set3DZoom.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(this.CGI.set3DZoom.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID); + var a = f.loadXML(r), + c = parseInt(n.$XML(a).find("StartPoint").eq(0).find("positionX").eq(0).text(), 10), + u = parseInt(n.$XML(a).find("StartPoint").eq(0).find("positionY").eq(0).text(), 10), + l = parseInt(n.$XML(a).find("EndPoint").eq(0).find("positionX").eq(0).text(), 10), + d = parseInt(n.$XML(a).find("EndPoint").eq(0).find("positionY").eq(0).text(), 10), + p = "" + c + "" + (255 - u) + "" + l + "" + (255 - d) + "", + P = new ue, + h = { + type: "PUT", + url: i, + data: p, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(h, s), + f.extend(h, { + success: function(e) { + s.success && s.success(e) + }, + error: function(e, t) { + s.error && s.error(e, t) + } + }), + P.setRequestParam(h), + P.submitRequest() + }, + le.prototype.getSDKCapa = function(e, t) { + + var n = E(this.CGI.SDKCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.deviceCapturePic = function(e, t, n, r) { + var t = 100 * t + 1, + s = -1, + o = E(this.CGI.deviceCapture.channels, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + i = []; + if (f.isInt(r.iResolutionWidth) && i.push("videoResolutionWidth=" + r.iResolutionWidth), f.isInt(r.iResolutionHeight) && i.push("videoResolutionHeight=" + r.iResolutionHeight), i.length > 0 && (o += "?" + i.join("&")), re()) { + var a = function(e, t) { + var n = ".jpg"; + return $("body").append('
  • '), + $("#jsplugin_download_li").trigger("click"), + $("#jsplugin_download_a").remove(), + 0 + }; + o = se(o), + s = a(o, n) + } else s = c.HWP_DeviceCapturePic(o, e.szAuth, n, r.bDateDir); + return s + }, + le.prototype.getSessionCap = function(e, t, n, r, s) { + var o = ""; + o = 2 == t ? "https://": "http://"; + var i = E(this.CGI.sessionCap, o, e, n, encodeURIComponent(r)), + a = new ue, + c = { + type: "GET", + url: i, + auth: "", + success: null, + error: null + }; + f.extend(c, s), + f.extend(c, { + success: function(e) { + s.success && s.success(e) + }, + error: function(e, t) { + s.error && s.error(e, t) + } + }), + a.setRequestParam(c), + a.submitRequest() + }, + le.prototype.sessionLogin = function(e, t, r, s, o, i, a) { + var c = ""; + c = 2 == t ? "https://": "http://"; + var u = E(this.CGI.sessionLogin, c, e, r), + l = n.$XML(i).find("sessionID").eq(0).text(), + d = n.$XML(i).find("challenge").eq(0).text(), + p = parseInt(n.$XML(i).find("iterations").eq(0).text(), 10), + P = !1, + h = ""; + n.$XML(i).find("isIrreversible", !0).length > 0 && (P = "true" === n.$XML(i).find("isIrreversible").eq(0).text(), h = n.$XML(i).find("salt").eq(0).text()); + var I = ""; + if (P) { + I = f.sha256(s + h + o), + I = f.sha256(I + d); + for (var m = 2; p > m; m++) I = f.sha256(I) + } else { + I = f.sha256(o) + d; + for (var m = 1; p > m; m++) I = f.sha256(I) + } + var C = ""; + C += "" + f.escape(s) + "", + C += "" + I + "", + C += "" + l + "", + C += ""; + var S = new ue, + v = { + type: "POST", + url: u, + data: C, + auth: "", + success: null, + error: null + }; + f.extend(v, a), + f.extend(v, { + success: function(e) { + a.success && a.success(e) + }, + error: function(e, t) { + a.error && a.error(e, t) + } + }), + S.setRequestParam(v), + S.submitRequest() + }, + le.prototype.sessionHeartbeat = function(e, t) { + var n = E(this.CGI.sessionHeartbeat, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.sessionLogout = function(e, t) { + var n = E(this.CGI.sessionLogout, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + le.prototype.getSystemCapa = function(e, t) { + var n = E(this.CGI.systemCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }; + var de = function() {}; + de.prototype.CGI = { + login: "%s%s:%s/PSIA/Custom/SelfExt/userCheck", + getAudioInfo: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels", + getDeviceInfo: "%s%s:%s/PSIA/System/deviceInfo", + getAnalogChannelInfo: "%s%s:%s/PSIA/System/Video/inputs/channels", + getDigitalChannel: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels", + getDigitalChannelInfo: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels/status", + getZeroChannelInfo: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroVideo/channels", + getStreamChannels: { + analog: "%s%s:%s/PSIA/Streaming/channels", + digital: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels" + }, + getStreamDynChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels", + startRealPlay: { + channels: "%s%s:%s/PSIA/streaming/channels/%s", + zeroChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s" + }, + startVoiceTalk: { + open: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/open", + close: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/close", + audioData: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/audioData" + }, + ptzControl: "%s%s:%s/PSIA/PTZ/channels/%s/continuous", + ptzAutoControl: "%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/autoptz", + setPreset: "%s%s:%s/PSIA/PTZ/channels/%s/presets/%s", + goPreset: "%s%s:%s/PSIA/PTZ/channels/%s/presets/%s/goto", + ptzFocus: "%s%s:%s/PSIA/System/Video/inputs/channels/%s/focus", + ptzIris: "%s%s:%s/PSIA/System/Video/inputs/channels/%s/iris", + getNetworkBond: "%s%s:%s/PSIA/Custom/SelfExt/Bond", + getNetworkInterface: "%s%s:%s/PSIA/System/Network/interfaces", + getUPnPPortStatus: "%s%s:%s/PSIA/Custom/SelfExt/UPnP/ports/status", + getPPPoEStatus: "%s%s:%s/PSIA/Custom/SelfExt/PPPoE/1/status", + getPortInfo: "%s%s:%s/PSIA/Security/AAA/adminAccesses", + recordSearch: "%s%s:%s/PSIA/ContentMgmt/search", + startPlayback: "%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%s", + startDownloadRecord: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/download", + deviceConfig: "%s%s:%s/PSIA/System/configurationData", + restart: "%s%s:%s/PSIA/System/reboot", + restore: "%s%s:%s/PSIA/System/factoryReset?mode=%s", + startUpgrade: { + upgrade: "%s%s:%s/PSIA/System/updateFirmware", + status: "%s%s:%s/PSIA/Custom/SelfExt/upgradeStatus" + }, + set3DZoom: "%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/Set3DZoom", + deviceCapture: { + channels: "%s%s:%s/PSIA/Streaming/channels/%s/picture" + }, + systemCapabilities: "%s%s:%s/PSIA/System/capabilities" + }, + de.prototype.login = function(e, t, r, s) { + var o = 2 == s.protocol ? "https://": "http://", + i = E(this.CGI.login, o, e, t), + a = new ue, + c = { + type: "GET", + url: i, + auth: r, + success: null, + error: null + }; + f.extend(c, s), + f.extend(c, { + success: function(e) { + "200" == n.$XML(e).find("statusValue").eq(0).text() ? s.success && s.success(e) : s.error && s.error(401, e) + }, + error: function(e, t) { + s.error && s.error(e, t) + } + }), + a.setRequestParam(c), + a.submitRequest() + }, + de.prototype.getAudioInfo = function(e, t) { + var n = E(this.CGI.getAudioInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getDeviceInfo = function(e, t) { + var r = E(this.CGI.getDeviceInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""), + r.push("" + f.escape(n.$XML(e).find("deviceName").eq(0).text()) + ""), + r.push("" + n.$XML(e).find("deviceID").eq(0).text() + ""), + r.push("" + n.$XML(e).find("deviceDescription").eq(0).text() + ""), + r.push("" + n.$XML(e).find("model").eq(0).text() + ""), + r.push("" + n.$XML(e).find("serialNumber").eq(0).text() + ""), + r.push("" + n.$XML(e).find("macAddress").eq(0).text() + ""), + r.push("" + n.$XML(e).find("firmwareVersion").eq(0).text() + ""), + r.push("" + n.$XML(e).find("firmwareReleasedDate").eq(0).text() + ""), + r.push("" + n.$XML(e).find("logicVersion").eq(0).text() + ""), + r.push("" + n.$XML(e).find("logicReleasedDate").eq(0).text() + ""), + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess &&t.mysuccess(r.join("")) + // console.log("2922",r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getSystemCapa = function(e, t) { + var n = E(this.CGI.systemCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getAnalogChannelInfo = function(e, t) { + var r = E(this.CGI.getAnalogChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("VideoInputChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + n.$XML(a).find("inputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("" + n.$XML(a).find("videoFormat").eq(0).text() + ""), + r.push("") + } + + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getDigitalChannel = function(e, t) { + var r = E(this.CGI.getDigitalChannel, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(e) { + var r = []; + r.push(""); + for (var s = n.$XML(e).find("DynVideoInputChannel", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + r.push(""), + r.push("" + n.$XML(a).find("id").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(a).find("name").eq(0).text()) + ""), + r.push("") + } + + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess &&t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getDigitalChannelInfo = function(e, t) { + var r = null, + s = {}; + if (this.getDigitalChannel(e, { + async: !1, + success: function(e) { + r = e; + for (var t = n.$XML(r).find("InputProxyChannel", !0), o = 0, i = t.length; i > o; o++) { + var a = t[o], + c = n.$XML(a).find("id").eq(0).text(), + u = n.$XML(a).find("name").eq(0).text(); + s[c] = u + } + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), null !== r) { + var o = E(this.CGI.getDigitalChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + i = new ue, + a = { + type: "GET", + url: o, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(a, t), + f.extend(a, { + success: function(e) { + var r = []; + r.push(""); + for (var o = n.$XML(e).find("DynVideoInputChannelStatus", !0), i = 0, a = o.length; a > i; i++) { + var c = o[i], + u = n.$XML(c).find("id").eq(0).text(); + r.push(""), + r.push("" + u + ""), + r.push(""), + r.push("" + n.$XML(c).find("adminProtocol").eq(0).text() + ""), + r.push("" + n.$XML(c).find("addressingFormatType").eq(0).text() + ""), + r.push("" + n.$XML(c).find("ipAddress").eq(0).text() + ""), + r.push("" + n.$XML(c).find("adminPortNo").eq(0).text() + ""), + r.push("" + n.$XML(c).find("srcInputPort").eq(0).text() + ""), + r.push("" + f.escape(n.$XML(c).find("userName").eq(0).text()) + ""), + r.push("" + n.$XML(c).find("streamType").eq(0).text() + ""), + r.push("" + n.$XML(c).find("online").eq(0).text() + ""), + r.push("" + f.escape(s[u]) + ""), + r.push(""), + r.push("") + } + // console.log("1746"); + r.push(""), + e = f.loadXML(r.join("")), + t.success && t.success(e), + t.mysuccess &&t.mysuccess(r.join("")) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + i.setRequestParam(a), + i.submitRequest() + } + }, + de.prototype.getZeroChannelInfo = function(e, t) { + var n = E(this.CGI.getZeroChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getPPPoEStatus = function(e, t) { + var n = E(this.CGI.getPPPoEStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getUPnPPortStatus = function(e, t) { + var n = E(this.CGI.getUPnPPortStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getNetworkBond = function(e, t) { + var n = E(this.CGI.getNetworkBond, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getNetworkInterface = function(e, t) { + var n = E(this.CGI.getNetworkInterface, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getPortInfo = function(e, t) { + var r = E(this.CGI.getPortInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), + s = new ue, + o = { + type: "GET", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, t), + f.extend(o, { + success: function(r) { + var s = []; + s.push(""); + for (var o = n.$XML(r).find("AdminAccessProtocol", !0), i = 0, a = o.length; a > i; i++) { + o[i]; + s.push(""), + s.push("" + n.$XML(r).find("id").eq(0).text() + ""), + s.push("" + n.$XML(r).find("enabled").eq(0).text() + ""), + s.push("" + n.$XML(r).find("protocol").eq(0).text().toUpperCase() + ""), + s.push("" + n.$XML(r).find("portNo").eq(0).text() + ""), + s.push("") + } + I.getStreamChannels(e, { + async: !1, + success: function(r) { + if (n.$XML(r).find("rtspPortNo", !0).length > 0) { + var o = parseInt(n.$XML(r).find("rtspPortNo").eq(0).text(), 10); + s.push(""), + s.push("4"), + s.push("true"), + s.push("RTSP"), + s.push("" + o + ""), + s.push(""), + s.push(""); + // console.log("1819"); + var i = f.loadXML(s.join("")); + t.success && t.success(i) + } else I.getStreamDynChannels(e, { + async: !1, + success: function(e) { + if (n.$XML(e).find("rtspPortNo", !0).length > 0) { + var r = parseInt(n.$XML(e).find("rtspPortNo").eq(0).text(), 10); + s.push(""), + s.push("4"), + s.push("true"), + s.push("RTSP"), + s.push("" + r + ""), + s.push(""), + s.push(""); + // console.log("1827"); + var o = f.loadXML(s.join("")); + t.success && t.success(o) + } + }, + error: function() { + t.error && t.error() + } + }) + }, + error: function() { + t.error && t.error() + } + }) + }, + error: function() { + var r = []; + r.push(""), + I.getStreamChannels(e, { + async: !1, + success: function(s) { + if (n.$XML(s).find("rtspPortNo", !0).length > 0) { + var o = parseInt(n.$XML(s).find("rtspPortNo").eq(0).text(), 10); + r.push(""), + r.push("4"), + r.push("true"), + r.push("RTSP"), + r.push("" + o + ""), + r.push(""), + r.push(""); + var i = f.loadXML(r.join("")); + // console.log("1847"); + t.success && t.success(i) + } else I.getStreamDynChannels(e, { + async: !1, + success: function(e) { + if (n.$XML(e).find("rtspPortNo", !0).length > 0) { + var s = parseInt(n.$XML(e).find("rtspPortNo").eq(0).text(), 10); + r.push(""), + r.push("4"), + r.push("true"), + r.push("RTSP"), + r.push("" + s + ""), + r.push(""), + r.push(""); + var o = f.loadXML(r.join("")); + // console.log("1855"); + t.success && t.success(o) + } + }, + error: function() { + t.error && t.error() + } + }) + }, + error: function() { + t.error && t.error() + } + }) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.getStreamChannels = function(e, t) { + if (0 != e.iAnalogChannelNum) var n = E(this.CGI.getStreamChannels.analog, e.szHttpProtocol, e.szIP, e.iCGIPort); + else var n = E(this.CGI.getStreamChannels.digital, e.szHttpProtocol, e.szIP, e.iCGIPort); + var r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.getStreamDynChannels = function(e, t) { + var n = E(this.CGI.getStreamDynChannels, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "GET", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.startRealPlay = function(e, t) { + var n = 100 * t.iChannelID + t.iStreamType, + r = "", + s = e.szIP; + "rtsp://" === t.urlProtocol && (s = Z(s)), + r = t.bZeroChannel ? E(t.cgi.zeroChannels, t.urlProtocol, s, t.iPort, n) : E(t.cgi.channels, t.urlProtocol, s, t.iPort, n); + var o = c.HWP_Play(r, e.szAuth, t.iWndIndex, "", ""); + if (0 == o) { + var i = new ce; + i.iIndex = t.iWndIndex, + i.szIP = e.szIP, + i.iCGIPort = e.iCGIPort, + i.szDeviceIdentify = e.szDeviceIdentify, + i.iChannelID = t.iChannelID, + i.iPlayStatus = x, + p.push(i) + } + return o + }, + de.prototype.startVoiceTalk = function(e, t) { + var n = E(this.CGI.startVoiceTalk.open, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + r = E(this.CGI.startVoiceTalk.close, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = E(this.CGI.startVoiceTalk.audioData, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + o = c.HWP_StartVoiceTalkEx(n, r, s, e.szAuth, e.iAudioTypeoDeviceInfo.m_iAudioBitRate, e.m_iAudioSamplingRate); + return o + }, + de.prototype.ptzAutoControl = function(e, t, n, r) { + var s = n.iChannelID, + o = "", + i = ""; + if (r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed: 100, t && (r.iPTZSpeed = 0), e.szDeviceType != w) o = E(this.CGI.ptzAutoControl, e.szHttpProtocol, e.szIP, e.iCGIPort, s), + i = "" + r.iPTZSpeed + "0"; + else { + var a = 99; + t && (a = 96), + o = E(this.CGI.goPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, s, a) + } + var c = new ue, + u = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }, + l = this; + f.extend(u, r), + f.extend(u, { + success: function(e) { + n.bPTZAuto = !n.bPTZAuto, + r.success && r.success(e) + }, + error: function(t, s) { + if (e.szDeviceType != w) { + o = E(l.CGI.ptzControl, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID); + var a = new ue, + c = { + type: "PUT", + url: o, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }; + f.extend(c, r), + a.setRequestParam(c), + a.submitRequest() + } else r.error && r.error(t, s) + } + }), + c.setRequestParam(u), + c.submitRequest() + }, + de.prototype.ptzControl = function(e, t, n, r) { + var s = (n.iChannelID, ""); + n.bPTZAuto && this.ptzAutoControl(e, !0, n, { + iPTZSpeed: 0 + }), + t ? r.iPTZSpeed = 0 : r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed: 100; + var o = [{}, + { + pan: 0, + tilt: r.iPTZSpeed + }, + { + pan: 0, + tilt: -r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: 0 + }, + { + pan: r.iPTZSpeed, + tilt: 0 + }, + { + pan: -r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: -r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: r.iPTZSpeed + }, + { + pan: r.iPTZSpeed, + tilt: -r.iPTZSpeed + }, + {}, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }, + { + speed: r.iPTZSpeed + }, + { + speed: -r.iPTZSpeed + }], + i = "", + a = {}; + switch (r.iPTZIndex) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + a = this.CGI.ptzControl, + i = "" + o[r.iPTZIndex].pan + "" + o[r.iPTZIndex].tilt + ""; + break; + case 10: + case 11: + a = this.CGI.ptzControl, + i = "" + o[r.iPTZIndex].speed + ""; + break; + case 12: + case 13: + a = this.CGI.ptzFocus, + i = "" + o[r.iPTZIndex].speed + ""; + break; + case 14: + case 15: + a = this.CGI.ptzIris, + i = "" + o[r.iPTZIndex].speed + ""; + break; + default: + return void(r.error && r.error()) + } + s = E(a, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID); + var c = new ue, + u = { + type: "PUT", + url: s, + async: !1, + auth: e.szAuth, + data: i, + success: null, + error: null + }; + f.extend(u, r), + f.extend(u, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + c.setRequestParam(u), + c.submitRequest() + }, + de.prototype.setPreset = function(e, t, n) { + var r = (t.iChannelID, ""), + s = ""; + r = E(this.CGI.setPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID), + s = "", + s += "", + s += "" + n.iPresetID + "", + e.szDeviceType != w && (s += "Preset" + n.iPresetID + ""), + s += ""; + var o = new ue, + i = { + type: "PUT", + url: r, + auth: e.szAuth, + data: s, + success: null, + error: null + }; + f.extend(i, n), + f.extend(i, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + o.setRequestParam(i), + o.submitRequest() + }, + de.prototype.goPreset = function(e, t, n) { + var r = (t.iChannelID, ""); + r = E(this.CGI.goPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID); + var s = new ue, + o = { + type: "PUT", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, n), + f.extend(o, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.recordSearch = function(e, r) { + var s = "", + o = "", + i = r.iChannelID, + a = r.iStreamType, + c = r.szStartTime.replace(" ", "T") + "Z", + u = r.szEndTime.replace(" ", "T") + "Z"; + s = E(this.CGI.recordSearch, e.szHttpProtocol, e.szIP, e.iCGIPort), + o = "" + new t + "" + (100 * i + a) + "" + c + "" + u + "40" + r.iSearchPos + "//metadata.psia.org/VideoMotion"; + var l = new ue, + d = { + type: "POST", + url: s, + auth: e.szAuth, + data: o, + success: null, + error: null + }; + f.extend(d, r), + f.extend(d, { + success: function(e) { + var t = []; + t.push(""), + t.push("" + n.$XML(e).find("responseStatus").eq(0).text() + ""), + t.push("" + n.$XML(e).find("responseStatusStrg").eq(0).text() + ""), + t.push("" + n.$XML(e).find("numOfMatches").eq(0).text() + ""), + t.push(""); + for (var s = n.$XML(e).find("searchMatchItem", !0), o = 0, i = s.length; i > o; o++) { + var a = s[o]; + t.push(""), + t.push("" + n.$XML(a).find("trackID").eq(0).text() + ""), + t.push("" + n.$XML(a).find("startTime").eq(0).text() + ""), + t.push("" + n.$XML(a).find("endTime").eq(0).text() + ""), + t.push("" + f.escape(n.$XML(a).find("playbackURI").eq(0).text()) + ""), + t.push("" + n.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[1] + ""), + t.push("") + } + // console.log("2006"); + t.push(""), + t.push(""), + e = f.loadXML(t.join("")), + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + l.setRequestParam(d), + l.submitRequest() + }, + de.prototype.startPlayback = function(e, t) { + var n = t.iWndIndex, + r = t.szStartTime, + s = t.szEndTime, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)); + var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s), + a = c.HWP_Play(i, e.szAuth, n, r, s); + if (0 == a) { + var u = new ce; + u.iIndex = n, + u.szIP = e.szIP, + u.iCGIPort = e.iCGIPort, + u.szDeviceIdentify = e.szDeviceIdentify, + u.iChannelID = t.iChannelID, + u.iPlayStatus = D, + p.push(u) + } + return a + }, + de.prototype.reversePlayback = function(e, t) { + var n = t.iWndIndex, + r = t.szStartTime, + s = t.szEndTime, + o = e.szIP; + "rtsp://" === t.urlProtocol && (o = Z(o)); + var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s), + a = c.HWP_ReversePlay(i, e.szAuth, n, r, s); + if (0 == a) { + var u = new ce; + u.iIndex = n, + u.szIP = e.szIP, + u.iCGIPort = e.iCGIPort, + u.szDeviceIdentify = e.szDeviceIdentify, + u.iChannelID = t.iChannelID, + u.iPlayStatus = b, + p.push(u) + } + return a + }, + de.prototype.startDownloadRecord = function(e, t) { + var n = E(this.CGI.startDownloadRecord, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = " " + f.escape(t.szPlaybackURI) + ""; + return c.HWP_StartDownload(n, e.szAuth, t.szFileName, r, t.bDateDir) + }, + de.prototype.exportDeviceConfig = function(e) { + var t = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ExportDeviceConfig(t, e.szAuth, "", 0) + }, + de.prototype.importDeviceConfig = function(e, t) { + var n = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_ImportDeviceConfig(n, e.szAuth, t.szFileName, 0) + }, + de.prototype.restart = function(e, t) { + var n = E(this.CGI.restart, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = new ue, + s = { + type: "PUT", + url: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(s, t), + f.extend(s, { + success: function(e) { + t.success && t.success(e) + }, + error: function(e, n) { + t.error && t.error(e, n) + } + }), + r.setRequestParam(s), + r.submitRequest() + }, + de.prototype.restore = function(e, t, n) { + var r = E(this.CGI.restore, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + s = new ue, + o = { + type: "PUT", + url: r, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(o, n), + f.extend(o, { + success: function(e) { + n.success && n.success(e) + }, + error: function(e, t) { + n.error && n.error(e, t) + } + }), + s.setRequestParam(o), + s.submitRequest() + }, + de.prototype.startUpgrade = function(e, t) { + var n = E(this.CGI.startUpgrade.upgrade, e.szHttpProtocol, e.szIP, e.iCGIPort), + r = E(this.CGI.startUpgrade.status, e.szHttpProtocol, e.szIP, e.iCGIPort); + return c.HWP_StartUpgrade(n, r, e.szAuth, t.szFileName) + }, + de.prototype.set3DZoom = function(e, t, n, r) { + var s = E(this.CGI.set3DZoom, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID), + o = new ue, + i = { + type: "PUT", + url: s, + data: n, + auth: e.szAuth, + success: null, + error: null + }; + f.extend(i, r), + f.extend(i, { + success: function(e) { + r.success && r.success(e) + }, + error: function(e, t) { + r.error && r.error(e, t) + } + }), + o.setRequestParam(i), + o.submitRequest() + }, + de.prototype.deviceCapturePic = function(e, t, n, r) { + var t = 100 * t + 1, + s = E(this.CGI.deviceCapture.channels, e.szHttpProtocol, e.szIP, e.iCGIPort, t), + o = []; + return f.isInt(r.iResolutionWidth) && o.push("videoResolutionWidth=" + r.iResolutionWidth), + f.isInt(r.iResolutionHeight) && o.push("videoResolutionHeight=" + r.iResolutionHeight), + o.length > 0 && (s += "?" + o.join("&")), + c.HWP_DeviceCapturePic(s, e.szAuth, n, r.bDateDir) + }; + var pe = function() {}; + pe.prototype._alert = function(e) { + a.bDebugMode && console.log(e); + }, + function(t) { + var n = function(e) { + this.elems = [], + this.length = 0, + this.length = this.elems.push(e) + }; + n.prototype.find = function(e, t) { + var n = this.elems[this.length - 1] ? this.elems[this.length - 1].getElementsByTagName(e) : []; + return this.length = this.elems.push(n), + t ? n: this + }, + n.prototype.eq = function(e, t) { + var n = this.elems[this.length - 1].length, + r = null; + return n > 0 && n > e && (r = this.elems[this.length - 1][e]), + this.length = this.elems.push(r), + t ? r: this + }, + n.prototype.text = function(t) { + return this.elems[this.length - 1] ? t ? void(e.DOMParser ? this.elems[this.length - 1].textContent = t: this.elems[this.length - 1].text = t) : e.DOMParser ? this.elems[this.length - 1].textContent: this.elems[this.length - 1].text: "" + }, + n.prototype.attr = function(e) { + if (this.elems[this.length - 1]) { + var t = this.elems[this.length - 1].attributes.getNamedItem(e); + return t ? t.value: "" + } + }, + t.$XML = function(e) { + return new n(e) + } + } (this); + var Pe = function() {}; + Pe.prototype.extend = function() { + for (var e, t = arguments[0] || {}, + n = 1, r = arguments.length; r > n; n++) if (null != (e = arguments[n])) for (var s in e) { + var o = (t[s], e[s]); + t !== o && ("object" == typeof o ? t[s] = this.extend({}, + o) : void 0 !== o && (t[s] = o)) + } + return t + }, + Pe.prototype.browser = function() { + var e = /(chrome)[ \/]([\w.]+)/, + t = /(safari)[ \/]([\w.]+)/, + n = /(opera)(?:.*version)?[ \/]([\w.]+)/, + r = /(msie) ([\w.]+)/, + s = /(trident.*rv:)([\w.]+)/, + o = /(mozilla)(?:.*? rv:([\w.]+))?/, + i = navigator.userAgent.toLowerCase(), + a = e.exec(i) || t.exec(i) || n.exec(i) || r.exec(i) || s.exec(i) || i.indexOf("compatible") < 0 && o.exec(i) || ["unknow", "0"]; + a.length > 0 && a[1].indexOf("trident") > -1 && (a[1] = "msie"); + var c = {}; + return c[a[1]] = !0, + c.version = a[2], + c + }, + Pe.prototype.loadXML = function(t) { + if (null == t || "" == t) return null; + var n = null; + //现场硬盘录像机用这段 + if (e.DOMParser) { + var r = new DOMParser; + n = r.parseFromString(t, "text/xml") + // console.log("DOMParser"); + } else { + if (window.ActiveXObject) { + n = new ActiveXObject("Microsoft.XMLDOM"), + n.async = !1, + n.loadXML(t); + // console.log("ActiveXObject"); + } + } + + return n + }, + Pe.prototype.loadXML2 = function(t) { + if (null == t || "" == t) return null; + var n = null; + + try //Internet Explorer + { + n = new ActiveXObject("Microsoft.XMLDOM"); + n.async = "false"; + n.loadXML(t); + } catch(e) { + try //Firefox, Mozilla, Opera, etc. + { + var parser = new DOMParser(); + n = parser.parseFromString(t, "text/xml"); + } catch(e) { + alert(e.message); + return; + } + } + return n + }, + Pe.prototype.toXMLStr = function(e) { + var t = ""; + try { + var n = new XMLSerializer; + t = n.serializeToString(e) + } catch(r) { + try { + t = e.xml + } catch(r) { + return "" + } + } + return - 1 == t.indexOf("" + t), + t + }, + Pe.prototype.escape = function(e) { + return e.replace(/&/g, "&").replace(//g, ">") + }, + Pe.prototype.dateFormat = function(e, t) { + var n = { + "M+": e.getMonth() + 1, + "d+": e.getDate(), + "h+": e.getHours(), + "m+": e.getMinutes(), + "s+": e.getSeconds(), + "q+": Math.floor((e.getMonth() + 3) / 3), + S: e.getMilliseconds() + }; + /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length))); + for (var r in n) new RegExp("(" + r + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? n[r] : ("00" + n[r]).substr(("" + n[r]).length))); + return t + }, + Pe.prototype.Base64 = { + _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + encode: function(e) { + var t, n, r, s, o, i, a, c = "", + u = 0; + for (e = Pe.prototype.Base64._utf8_encode(e); u < e.length;) t = e.charCodeAt(u++), + n = e.charCodeAt(u++), + r = e.charCodeAt(u++), + s = t >> 2, + o = (3 & t) << 4 | n >> 4, + i = (15 & n) << 2 | r >> 6, + a = 63 & r, + isNaN(n) ? i = a = 64 : isNaN(r) && (a = 64), + c = c + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(i) + this._keyStr.charAt(a); + return c + }, + decode: function(e) { + var t, n, r, s, o, i, a, c = "", + u = 0; + for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); u < e.length;) s = this._keyStr.indexOf(e.charAt(u++)), + o = this._keyStr.indexOf(e.charAt(u++)), + i = this._keyStr.indexOf(e.charAt(u++)), + a = this._keyStr.indexOf(e.charAt(u++)), + t = s << 2 | o >> 4, + n = (15 & o) << 4 | i >> 2, + r = (3 & i) << 6 | a, + c += String.fromCharCode(t), + 64 != i && (c += String.fromCharCode(n)), + 64 != a && (c += String.fromCharCode(r)); + return c = Pe.prototype.Base64._utf8_decode(c) + }, + _utf8_encode: function(e) { + e = e.replace(/\r\n/g, "\n"); + for (var t = "", + n = 0; n < e.length; n++) { + var r = e.charCodeAt(n); + 128 > r ? t += String.fromCharCode(r) : r > 127 && 2048 > r ? (t += String.fromCharCode(r >> 6 | 192), t += String.fromCharCode(63 & r | 128)) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128), t += String.fromCharCode(63 & r | 128)) + } + return t + }, + _utf8_decode: function(e) { + for (var t = "", + n = 0, + r = c1 = c2 = 0; n < e.length;) r = e.charCodeAt(n), + 128 > r ? (t += String.fromCharCode(r), n++) : r > 191 && 224 > r ? (c2 = e.charCodeAt(n + 1), t += String.fromCharCode((31 & r) << 6 | 63 & c2), n += 2) : (c2 = e.charCodeAt(n + 1), c3 = e.charCodeAt(n + 2), t += String.fromCharCode((15 & r) << 12 | (63 & c2) << 6 | 63 & c3), n += 3); + return t + } + }, + Pe.prototype.createEventScript = function(e, t, n) { + var r = document.createElement("script"); + r.htmlFor = e, + r.event = t, + r.innerHTML = n, + document.body.parentNode.appendChild(r) + }, + Pe.prototype.isInt = function(e) { + return /^\d+$/.test(e) + }, + Pe.prototype.getDirName = function() { + var e = ""; + if ("" !== a.szBasePath) e = a.szBasePath; + else { + var t = /[^?#]*\//, + n = document.getElementById("videonode"); + if (n) e = n.src.match(t)[0]; + else { + for (var r = document.scripts, + s = 0, + o = r.length; o > s; s++) if (r[s].src.indexOf("webVideoCtrl.js") > -1) { + n = r[s]; + break + } + n && (e = n.src.match(t)[0]) + } + } + return e + }, + Pe.prototype.loadScript = function(e, t) { + var n = document.createElement("script"); + n.type = "text/javascript", + n.onload = function() { + t() + }, + n.src = e, + document.getElementsByTagName("head")[0].appendChild(n) + }, + Pe.prototype.sha256 = function(e) { + function t(e, t) { + var n = (65535 & e) + (65535 & t); + return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n + } + + function n(e, t) { + return e >>> t | e << 32 - t + } + + return e = function(e) { + for (var e = e.replace(/\r\n/g, "\n"), t = "", n = 0; n < e.length; n++) { + var r = e.charCodeAt(n); + 128 > r ? t += String.fromCharCode(r) : (r > 127 && 2048 > r ? t += String.fromCharCode(r >> 6 | 192) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128)), t += String.fromCharCode(63 & r | 128)) + } + return t + } (e), + function(e) { + for (var t = "", + n = 0; n < 4 * e.length; n++) t += "0123456789abcdef".charAt(e[n >> 2] >> 8 * (3 - n % 4) + 4 & 15) + "0123456789abcdef".charAt(e[n >> 2] >> 8 * (3 - n % 4) & 15); + return t + } (function(e, r) { + var s, o, i, a, c, u, l, d, p, P, h, I, f = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298], + m = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], + C = Array(64); + for (e[r >> 5] |= 128 << 24 - r % 32, e[(r + 64 >> 9 << 4) + 15] = r, p = 0; p < e.length; p += 16) { + for (s = m[0], o = m[1], i = m[2], a = m[3], c = m[4], u = m[5], l = m[6], d = m[7], P = 0; 64 > P; P++) C[P] = 16 > P ? e[P + p] : t(t(t(n(C[P - 2], 17) ^ n(C[P - 2], 19) ^ C[P - 2] >>> 10, C[P - 7]), n(C[P - 15], 7) ^ n(C[P - 15], 18) ^ C[P - 15] >>> 3), C[P - 16]), + h = t(t(t(t(d, n(c, 6) ^ n(c, 11) ^ n(c, 25)), c & u ^ ~c & l), f[P]), C[P]), + I = t(n(s, 2) ^ n(s, 13) ^ n(s, 22), s & o ^ s & i ^ o & i), + d = l, + l = u, + u = c, + c = t(a, h), + a = i, + i = o, + o = s, + s = t(h, I); + m[0] = t(s, m[0]), + m[1] = t(o, m[1]), + m[2] = t(i, m[2]), + m[3] = t(a, m[3]), + m[4] = t(c, m[4]), + m[5] = t(u, m[5]), + m[6] = t(l, m[6]), + m[7] = t(d, m[7]) + } + return m + } (function(e) { + for (var t = [], n = 0; n < 8 * e.length; n += 8) t[n >> 5] |= (255 & e.charCodeAt(n / 8)) << 24 - n % 32; + return t + } (e), 8 * e.length)) + }, + Pe.prototype.cookie = function(e, t, n) { + if (arguments.length > 1 && (null === t || "object" != typeof t)) { + if (n = this.extend({}, + n), null === t && (n.expires = -1), "number" == typeof n.expires) { + var r = n.expires, + s = n.expires = new Date; + s.setDate(s.getDate() + r) + } + return document.cookie = [encodeURIComponent(e), "=", n.raw ? String(t) : encodeURIComponent(String(t)), n.expires ? "; expires=" + n.expires.toUTCString() : "", n.path ? "; path=" + n.path: "; path=/", n.domain ? "; domain=" + n.domain: "", n.secure ? "; secure": ""].join("") + } + n = t || {}; + var o, i = n.raw ? + function(e) { + return e + }: decodeURIComponent; + return (o = new RegExp("(?:^|; )" + encodeURIComponent(e) + "=([^;]*)").exec(document.cookie)) ? i(o[1]) : null + }, + t.prototype.valueOf = function() { + return this.id + }, + t.prototype.toString = function() { + return this.id + }, + t.prototype.createUUID = function() { + var e = new Date(1582, 10, 15, 0, 0, 0, 0), + n = new Date, + r = n.getTime() - e.getTime(), + s = "-", + o = t.getIntegerBits(r, 0, 31), + i = t.getIntegerBits(r, 32, 47), + a = t.getIntegerBits(r, 48, 59) + "1", + c = t.getIntegerBits(t.rand(4095), 0, 7), + u = t.getIntegerBits(t.rand(4095), 0, 7), + l = t.getIntegerBits(t.rand(8191), 0, 7) + t.getIntegerBits(t.rand(8191), 8, 15) + t.getIntegerBits(t.rand(8191), 0, 7) + t.getIntegerBits(t.rand(8191), 8, 15) + t.getIntegerBits(t.rand(8191), 0, 15); + return o + s + i + s + a + s + c + u + s + l + }, + t.getIntegerBits = function(e, n, r) { + var s = t.returnBase(e, 16), + o = new Array, + i = "", + a = 0; + for (a = 0; a < s.length; a++) o.push(s.substring(a, a + 1)); + for (a = Math.floor(n / 4); a <= Math.floor(r / 4); a++) i += o[a] && "" != o[a] ? o[a] : "0"; + return i + }, + t.returnBase = function(e, t) { + var n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; + if (t > e) var r = n[e]; + else { + var s = "" + Math.floor(e / t), + o = e - s * t; + if (s >= t) var r = this.returnBase(s, t) + n[o]; + else var r = n[s] + n[o] + } + return r + }, + t.rand = function(e) { + return Math.floor(Math.random() * e) + }, + h = new le, + I = new de, + P = new pe, + f = new Pe; + var he = f.dateFormat(new Date, "yyyyMMddhhmmss"); + return o = "webVideoCtrl" + he, + i = "webVideoCtrl" + he, + "object" != typeof e.attachEvent && f.browser().msie && (f.createEventScript(o, "GetSelectWndInfo(SelectWndInfo)", "GetSelectWndInfo(SelectWndInfo);"), f.createEventScript(o, "ZoomInfoCallback(szZoomInfo)", "ZoomInfoCallback(szZoomInfo);"), f.createEventScript(o, "GetHttpInfo(lID, lpInfo, lReverse)", "GetHttpInfo(lID, lpInfo, lReverse);"), f.createEventScript(o, "PluginEventHandler(iEventType, iParam1, iParam2)", "PluginEventHandler(iEventType, iParam1, iParam2);"), f.createEventScript(o, "RemoteConfigInfo(lID)", "RemoteConfigInfo(lID);"), f.createEventScript(o, "KeyBoardEventInfo(iKeyCode)", "KeyBoardEventInfo(iKeyCode);")), + this + } (), + n = e.WebVideoCtrl = t; + n.version = "1.1.0" + } +} (this), +"object" == typeof exports && "undefined" != typeof module || ("function" == typeof define && define.amd ? define(function() { + return WebVideoCtrl +}) : "function" == typeof define && define.cmd && define(function(e, t, n) { + n.exports = WebVideoCtrl +})); +// export{ +// WebVideoCtrl() +// } diff --git a/supervise-monitor-ui/src/views/monitor/videos/index.vue b/supervise-monitor-ui/src/views/monitor/videos/index.vue index 7f79320a..8bdcacfd 100644 --- a/supervise-monitor-ui/src/views/monitor/videos/index.vue +++ b/supervise-monitor-ui/src/views/monitor/videos/index.vue @@ -1,201 +1,323 @@ + // 退出 + onLogout() { + this.videoData.forEach((element) => { + var szDeviceIdentify = element.ip + "_" + element.port; + var iRet = WebVideoCtrl.I_Logout(szDeviceIdentify); + if (0 == iRet) { + // this.$message({ + // showClose: true, + // message: "退出成功", + // type: "success", + // }); + } else { + // this.$message({ + // showClose: true, + // message: "退出失败", + // type: "error", + // }); + } + }); + }, + clickStartRealPlay() { + console.log("开始预览", this.index); + // 开始预览 + var that = this; + that.startPlayLoading = true; + var szDeviceIdentify = that.hkvInfo.ip + "_" + that.hkvInfo.port; + debugger + that.startRealPlay(szDeviceIdentify, this.index, that.hkvInfo.nvrPrechannel); + that.startPlayLoading = false; + }, + startRealPlay(szDeviceIdentify, iWndIndex, iChannelID) { + var that = this; + WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, { + iRtspPort: that.iRtspPort, + iWndIndex: iWndIndex, + iChannelID: iChannelID, + bZeroChannel: that.bZeroChannel, + iStreamType: 2, //码流类型,2为子码流 + success: function() { + // that.$notify({ + // title: "成功", + // message: "开始预览通道" + iChannelID + "成功", + // type: "success", + // }); + }, + error(status, xmlDoc2) { + console.log(xmlDoc2); //不能删除 + // that.$notify({ + // title: "失败", + // message: "开始预览通道" + iChannelID + "失败", + // type: "error", + // }); + if (status === 403) { + console.log("szInfo 设备不支持Websocket取流!"); + } else { + console.log("开始预览失败 ", status, xmlDoc2); + } + }, + }); + }, + videoInitPlugin() { + this.$nextTick(() => { + var iRet = WebVideoCtrl.I_CheckPluginInstall(); + if (iRet === -1) { + // alert("您还未安装过插件,双击开发包目录里的WebComponentsKit.exe安装"); + this.myFunction(); + return; + } else { + // if (this.ua.match(/msie/) != null || this.ua.match(/trident/) != null) { + this.browserType = "IE"; + this.initPlugin(); + // } else { + // this.$notify({ + // title: "失败", + // message: "请在ie模式下查看摄像头", + // type: "error", + // }); + // } + } - diff --git a/supervise-monitor-ui/src/views/monitor/videos/index2.vue b/supervise-monitor-ui/src/views/monitor/videos/index2.vue new file mode 100644 index 00000000..5df609a9 --- /dev/null +++ b/supervise-monitor-ui/src/views/monitor/videos/index2.vue @@ -0,0 +1,303 @@ + + + + diff --git a/yxt-portal-ui/.env.development b/yxt-portal-ui/.env.development index 8e04a50e..01c78fbe 100644 --- a/yxt-portal-ui/.env.development +++ b/yxt-portal-ui/.env.development @@ -5,5 +5,5 @@ ENV = 'development' VUE_APP_BASE_API = '/api' ## 配置测试和本地开发时的 接口地址 -VUE_APP_URL = "http://192.168.3.20:8112" +VUE_APP_URL = "http://192.168.3.173:8112" ##VUE_APP_URL = "http://8.130.39.13:8112"