修改看板

IOT
夜笙歌 1 month ago
parent 562afecc70
commit 23cc2e63b3

@ -113,7 +113,7 @@
:style="`top: ${i.top}%;left: ${i.left}%;background-color: ${k === 4 ?'#2979e8':'#234271'}`"></div> :style="`top: ${i.top}%;left: ${i.left}%;background-color: ${k === 4 ?'#2979e8':'#234271'}`"></div>
<div class="video1"> <div class="video1">
<Monitor :iChannelID="1" monitorId="monitor1" key="monitor1"/> <!-- <Monitor :iChannelID="1" monitorId="monitor1" key="monitor1"/>-->
</div> </div>
<div class="video2"> <div class="video2">
<Monitor1 :iChannelID="2" monitorId="monitor2" key="monitor2"/> <Monitor1 :iChannelID="2" monitorId="monitor2" key="monitor2"/>
@ -128,7 +128,7 @@
<script> <script>
import Chart from '@/components/Charts/Chart' import Chart from '@/components/Charts/Chart'
import vueSeamlessScroll from 'vue-seamless-scroll' import vueSeamlessScroll from 'vue-seamless-scroll'
import Monitor from './monitor/monitor' // import Monitor from './monitor/monitor'
import Monitor1 from './monitor/monitor2' import Monitor1 from './monitor/monitor2'
export default { export default {
@ -329,7 +329,7 @@ export default {
components: { components: {
vueSeamlessScroll, vueSeamlessScroll,
Chart, Chart,
Monitor, // Monitor,
Monitor1 Monitor1
}, },
mounted() { mounted() {

@ -1,5 +1,6 @@
<template> <template>
<div> <div>
<div id="monitorId1" class="plugin"></div>
<div id="monitorId2" class="plugin"></div> <div id="monitorId2" class="plugin"></div>
</div> </div>
</template> </template>
@ -13,11 +14,11 @@ export default {
}, },
props:['iChannelID','monitorId'], props:['iChannelID','monitorId'],
async mounted() { async mounted() {
window.WebVideoCtrl1 = window.WebVideoCtrl
await this.$nextTick() await this.$nextTick()
const _this = this const _this = this
var g_iWndIndex = 0; var g_iWndIndex = 0;
$(function () { $(function () {
window.WebVideoCtrl1 = window.WebVideoCtrl
// //
var iRet = window.WebVideoCtrl1.I_CheckPluginInstall(); var iRet = window.WebVideoCtrl1.I_CheckPluginInstall();
if (-1 == iRet) { if (-1 == iRet) {
@ -26,6 +27,31 @@ export default {
} }
// //
WebVideoCtrl.I_InitPlugin(500, 300, {
bWndFull: true, // true: false:
iPackageType: 2,
iWndowType: 1,
bNoPlugin: true,
cbSelWnd: function (xmlDoc) {
console.log(xmlDoc)
},
cbDoubleClickWnd: function (iWndIndex, bFullScreen) {
console.log(iWndIndex, bFullScreen)
},
cbEvent: function (iEventType, iParam1, iParam2) {
},
cbRemoteConfig: function () {
console.log("关闭远程配置库!");
},
cbInitPluginComplete: function () {
WebVideoCtrl1.I_InsertOBJECTPlugin('monitorId1');
//
if (-1 == WebVideoCtrl1.I_CheckPluginVersion()) {
alert("检测到新的插件版本");
return;
}
}
});
WebVideoCtrl1.I_InitPlugin(500, 300, { WebVideoCtrl1.I_InitPlugin(500, 300, {
bWndFull: true, // true: false: bWndFull: true, // true: false:
iPackageType: 2, iPackageType: 2,
@ -66,14 +92,16 @@ export default {
} }
var iRet = WebVideoCtrl1.I_Login(szIP, 1, szPort, szUsername, szPassword, { let iRet = WebVideoCtrl1.I_Login(szIP, 1, szPort, szUsername, szPassword, {
success: function (xmlDoc) { success: function (xmlDoc) {
setTimeout(function () { setTimeout(function () {
getChannelInfo(); getChannelInfo();
getDevicePort(); getDevicePort();
getChannelInfo1();
getDevicePort1();
setTimeout(()=>{ setTimeout(()=>{
clickStartRealPlay() clickStartRealPlay()
clickStartRealPlay1()
},2000) },2000)
}, 10); }, 10);
}, },
@ -99,6 +127,18 @@ export default {
console.log(szDeviceIdentify + " 获取端口失败!"); console.log(szDeviceIdentify + " 获取端口失败!");
} }
} }
function getDevicePort1() {
var szDeviceIdentify = '192.168.2.64';
var oPort = WebVideoCtrl.I_GetDevicePort(szDeviceIdentify);
if (oPort != null) {
console.log(szDeviceIdentify + " 获取端口成功!");
} else {
console.log(szDeviceIdentify + " 获取端口失败!");
}
}
function getChannelInfo() { function getChannelInfo() {
var szDeviceIdentify = '192.168.2.64' var szDeviceIdentify = '192.168.2.64'
@ -121,40 +161,22 @@ export default {
error: function (status, xmlDoc) { error: function (status, xmlDoc) {
} }
}); });
// }
WebVideoCtrl1.I_GetDigitalChannelInfo(szDeviceIdentify, { function getChannelInfo1() {
async: false, var szDeviceIdentify = '192.168.2.64'
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(), WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
online = $(this).find("online").eq(0).text();
if ("false" == online) {//
return true;
}
if ("" == name) {
name = "IPCamera " + (i < 9 ? "0" + (i + 1) : (i + 1));
}
});
},
error: function (status, xmlDoc) {
}
});
//
WebVideoCtrl1.I_GetZeroChannelInfo(szDeviceIdentify, {
async: false, async: false,
success: function (xmlDoc) { success: function (xmlDoc) {
var oChannels = $(xmlDoc).find("ZeroVideoChannel"); var oChannels = $(xmlDoc).find("VideoInputChannel");
$.each(oChannels, function (i) { $.each(oChannels, function (i) {
var id = $(this).find("id").eq(0).text(), var id = $(this).find("id").eq(0).text(),
name = $(this).find("name").eq(0).text(); name = $(this).find("name").eq(0).text();
if ("" == name) { if ("" == name) {
name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : (i + 1)); name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1));
}
if ("true" == $(this).find("enabled").eq(0).text()) {//
} }
}); });
}, },
@ -166,6 +188,48 @@ export default {
// //
function clickStartRealPlay(iStreamType) { function clickStartRealPlay(iStreamType) {
var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
szDeviceIdentify = '192.168.2.64',
iRtspPort = 554,
iChannelID = 1,
bZeroChannel = false,
szInfo = "";
iStreamType = 1;
var startRealPlay = function () {
WebVideoCtrl1.I_StartRealPlay(szDeviceIdentify, {
iRtspPort: iRtspPort,
iStreamType: iStreamType,
iChannelID: iChannelID,
bZeroChannel: bZeroChannel,
success: function () {
szInfo = "开始预览成功!";
console.log(szDeviceIdentify + " " + szInfo);
},
error: function (status, xmlDoc) {
if (403 === status) {
szInfo = "设备不支持Websocket取流";
} else {
szInfo = "开始预览失败!";
}
console.log(szDeviceIdentify + " " + szInfo);
}
});
};
if (oWndInfo != null) {//
WebVideoCtrl1.I_Stop({
success: function () {
startRealPlay();
}
});
} else {
startRealPlay();
}
}
function clickStartRealPlay1(iStreamType) {
var oWndInfo = WebVideoCtrl1.I_GetWindowStatus(g_iWndIndex), var oWndInfo = WebVideoCtrl1.I_GetWindowStatus(g_iWndIndex),
szDeviceIdentify = '192.168.2.64', szDeviceIdentify = '192.168.2.64',
iRtspPort = 554, iRtspPort = 554,

Loading…
Cancel
Save