|
//--------------------------视频管理------------------------//
|
/**
|
* 保活,msg参数为了防止浏览器缓存
|
*/
|
function keepAlive() {
|
var data = {
|
playType: quantityConf.playType,
|
sn: quantityConf.cameraSn,
|
ip: quantityConf.ip,
|
msg: Math.random()
|
};
|
$.ajax({
|
type: 'POST',
|
url: "../../basic/security/keep-alive",
|
dataType: 'JSON',
|
contentType: "application/json;charset=UTF-8",
|
data: JSON.stringify(data),
|
success: function (result) {
|
},
|
error: function (result) {
|
}
|
});
|
}
|
|
/**
|
* 播放还是暂停
|
*/
|
function playStop() {
|
var videL = $('#easyPlayer');
|
if (videL.paused) {
|
videL.play();
|
} else {
|
videL.pause();
|
}
|
}
|
/**
|
* 云台控制 -转向控制
|
* @param tag 执行命令 1=上,2=下,3=左,4=右,5=左上,6=左下,7=右上,8=右下,0=停止,9=变倍小,10 = 变倍加
|
*
|
*/
|
function mouseDownPTZControl(tag) {
|
|
layer.msg("开始调用云平台……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
|
var data = {
|
playType: quantityConf.playType,
|
sn: quantityConf.cameraSn,
|
ip:quantityConf.ip,
|
portV:quantityConf.portWeb,
|
loginId:quantityConf.loginId,
|
pwd:quantityConf.pwd,
|
command: tag
|
};
|
var url = "";
|
if (PlayType.VLC == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
if (PlayType.MEDIA_EASY == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
$.ajax({
|
type: 'POST',
|
url: url,
|
dataType: 'JSON',
|
contentType: "application/json;charset=UTF-8",
|
data: JSON.stringify(data),
|
success: function (result) {
|
if ("ERROR" == result.code) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
} else {
|
layer.msg("执行成功……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
},
|
error: function (result) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
});
|
}
|
|
/**
|
* 云台控制 -转向停止
|
* @param tag
|
*/
|
function mouseUpPTZControl() {
|
|
var data = {
|
playType: quantityConf.playType,
|
sn: quantityConf.cameraSn,
|
ip:quantityConf.ip,
|
portV:quantityConf.portWeb,
|
loginId:quantityConf.loginId,
|
pwd:quantityConf.pwd,
|
command: "0"
|
};
|
var url = "";
|
if (PlayType.VLC == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
if (PlayType.MEDIA_EASY == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
$.ajax({
|
type: 'POST',
|
url: url,
|
dataType: 'JSON',
|
contentType: "application/json;charset=UTF-8",
|
data: JSON.stringify(data),
|
success: function (result) {
|
if ("ERROR" == result.code) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
},
|
error: function (result) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
});
|
}
|
|
/**
|
* 云台控制 -预置位置调用
|
*/
|
function clickGoPreset() {
|
layer.msg("开始调用云平台……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
|
var preset = $("#preset").val();
|
var data = {
|
playType: quantityConf.playType,
|
sn: quantityConf.cameraSn,
|
ip:quantityConf.ip,
|
portV:quantityConf.portWeb,
|
loginId:quantityConf.loginId,
|
pwd:quantityConf.pwd,
|
command: "2",
|
preset: preset
|
};
|
var url = "";
|
if (PlayType.VLC == quantityConf.playType) {
|
url = "../../basic/security/ptz-preset"
|
}
|
if (PlayType.MEDIA_EASY == quantityConf.playType) {
|
url = "../../basic/security/ptz-preset"
|
}
|
$.ajax({
|
type: 'POST',
|
url: url,
|
dataType: 'JSON',
|
contentType: "application/json;charset=UTF-8",
|
data: JSON.stringify(data),
|
success: function (result) {
|
if ("ERROR" == result.code) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
} else {
|
layer.msg("执行成功……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
},
|
error: function (result) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
});
|
}
|
|
/**
|
* PTZZoomout 变倍 +
|
* @constructor
|
*/
|
function PTZZoomout() {
|
|
layer.msg("开始调用云平台……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
|
var data = {
|
playType: quantityConf.playType,
|
sn: quantityConf.cameraSn,
|
ip:quantityConf.ip,
|
portV:quantityConf.portWeb,
|
loginId:quantityConf.loginId,
|
pwd:quantityConf.pwd,
|
command: "10"
|
};
|
var url = "";
|
if (PlayType.VLC == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
if (PlayType.MEDIA_EASY == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
$.ajax({
|
type: 'POST',
|
url: url,
|
dataType: 'JSON',
|
contentType: "application/json;charset=UTF-8",
|
data: JSON.stringify(data),
|
success: function (result) {
|
if ("ERROR" == result.code) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
} else {
|
layer.msg("执行成功……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
},
|
error: function (result) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
});
|
}
|
|
/**
|
* PTZZoomout 变倍 -
|
* @constructor
|
*/
|
function PTZZoomIn() {
|
|
layer.msg("开始调用云平台……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
|
var data = {
|
playType: quantityConf.playType,
|
sn: quantityConf.cameraSn,
|
ip:quantityConf.ip,
|
portV:quantityConf.portWeb,
|
loginId:quantityConf.loginId,
|
pwd:quantityConf.pwd,
|
command: "9"
|
};
|
var url = "";
|
if (PlayType.VLC == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
if (PlayType.MEDIA_EASY == quantityConf.playType) {
|
url = "../../basic/security/ptz-media"
|
}
|
$.ajax({
|
type: 'POST',
|
url: url,
|
dataType: 'JSON',
|
contentType: "application/json;charset=UTF-8",
|
data: JSON.stringify(data),
|
success: function (result) {
|
if ("ERROR" == result.code) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
} else {
|
layer.msg("执行成功……",
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
},
|
error: function (result) {
|
layer.msg(result.msg,
|
{time: 3000, shift: 5, offset: "rb"},
|
function () {
|
});
|
}
|
});
|
}
|
|
/**
|
* PTZZoomout 变倍停止
|
* @constructor
|
*/
|
function PTZZoomStop() {
|
}
|