|
|
|
@ -17,15 +17,16 @@ export default {
|
|
|
|
|
const _this = this
|
|
|
|
|
var g_iWndIndex = 0;
|
|
|
|
|
$(function () {
|
|
|
|
|
window.WebVideoCtrl1 = window.WebVideoCtrl
|
|
|
|
|
// 检查插件是否已经安装过
|
|
|
|
|
var iRet = window.WebVideoCtrl.I_CheckPluginInstall();
|
|
|
|
|
var iRet = window.WebVideoCtrl1.I_CheckPluginInstall();
|
|
|
|
|
if (-1 == iRet) {
|
|
|
|
|
alert("未安装插件");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化插件参数及插入插件
|
|
|
|
|
WebVideoCtrl.I_InitPlugin(500, 300, {
|
|
|
|
|
WebVideoCtrl1.I_InitPlugin(500, 300, {
|
|
|
|
|
bWndFull: true, //是否支持单窗口双击全屏,默认支持 true:支持 false:不支持
|
|
|
|
|
iPackageType: 2,
|
|
|
|
|
iWndowType: 1,
|
|
|
|
@ -42,9 +43,9 @@ export default {
|
|
|
|
|
console.log("关闭远程配置库!");
|
|
|
|
|
},
|
|
|
|
|
cbInitPluginComplete: function () {
|
|
|
|
|
WebVideoCtrl.I_InsertOBJECTPlugin('monitorId2');
|
|
|
|
|
WebVideoCtrl1.I_InsertOBJECTPlugin('monitorId2');
|
|
|
|
|
// 检查插件是否最新
|
|
|
|
|
if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
|
|
|
|
|
if (-1 == WebVideoCtrl1.I_CheckPluginVersion()) {
|
|
|
|
|
alert("检测到新的插件版本");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -65,7 +66,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var iRet = WebVideoCtrl.I_Login(szIP, 1, szPort, szUsername, szPassword, {
|
|
|
|
|
var iRet = WebVideoCtrl1.I_Login(szIP, 1, szPort, szUsername, szPassword, {
|
|
|
|
|
success: function (xmlDoc) {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
getChannelInfo();
|
|
|
|
@ -90,7 +91,7 @@ export default {
|
|
|
|
|
var szDeviceIdentify = '192.168.2.64';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var oPort = WebVideoCtrl.I_GetDevicePort(szDeviceIdentify);
|
|
|
|
|
var oPort = WebVideoCtrl1.I_GetDevicePort(szDeviceIdentify);
|
|
|
|
|
if (oPort != null) {
|
|
|
|
|
|
|
|
|
|
console.log(szDeviceIdentify + " 获取端口成功!");
|
|
|
|
@ -104,7 +105,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 模拟通道
|
|
|
|
|
WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
|
|
|
|
|
WebVideoCtrl1.I_GetAnalogChannelInfo(szDeviceIdentify, {
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (xmlDoc) {
|
|
|
|
|
var oChannels = $(xmlDoc).find("VideoInputChannel");
|
|
|
|
@ -121,7 +122,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// 数字通道
|
|
|
|
|
WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, {
|
|
|
|
|
WebVideoCtrl1.I_GetDigitalChannelInfo(szDeviceIdentify, {
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (xmlDoc) {
|
|
|
|
|
var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
|
|
|
|
@ -142,7 +143,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// 零通道
|
|
|
|
|
WebVideoCtrl.I_GetZeroChannelInfo(szDeviceIdentify, {
|
|
|
|
|
WebVideoCtrl1.I_GetZeroChannelInfo(szDeviceIdentify, {
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (xmlDoc) {
|
|
|
|
|
var oChannels = $(xmlDoc).find("ZeroVideoChannel");
|
|
|
|
@ -165,7 +166,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
// 开始预览
|
|
|
|
|
function clickStartRealPlay(iStreamType) {
|
|
|
|
|
var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
|
|
|
|
|
var oWndInfo = WebVideoCtrl1.I_GetWindowStatus(g_iWndIndex),
|
|
|
|
|
szDeviceIdentify = '192.168.2.64',
|
|
|
|
|
iRtspPort = 554,
|
|
|
|
|
iChannelID = 2,
|
|
|
|
@ -175,7 +176,7 @@ export default {
|
|
|
|
|
iStreamType = 1;
|
|
|
|
|
|
|
|
|
|
var startRealPlay = function () {
|
|
|
|
|
WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
|
|
|
|
|
WebVideoCtrl1.I_StartRealPlay(szDeviceIdentify, {
|
|
|
|
|
iRtspPort: iRtspPort,
|
|
|
|
|
iStreamType: iStreamType,
|
|
|
|
|
iChannelID: iChannelID,
|
|
|
|
@ -197,7 +198,7 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (oWndInfo != null) {// 已经在播放了,先停止
|
|
|
|
|
WebVideoCtrl.I_Stop({
|
|
|
|
|
WebVideoCtrl1.I_Stop({
|
|
|
|
|
success: function () {
|
|
|
|
|
startRealPlay();
|
|
|
|
|
}
|