| | |
| | | const hkModule = ()=>{ |
| | | const {isCollapse} = slideMenu(); |
| | | const divPlugin = ref(null); |
| | | const iWndowType = ref(1); |
| | | const iWndowType = ref(3); |
| | | const gIWndIndex = ref(0); |
| | | const videoInitPlugin = (cbComplete)=>{ |
| | | let iRet = WebVideoCtrl.I_CheckPluginInstall(); |
| | |
| | | |
| | | const initPlugin = (cbComplete)=>{ |
| | | WebVideoCtrl.I_InitPlugin({ |
| | | bWndFull: false, //是否支持单窗口双击全屏 |
| | | bWndFull: true, //是否支持单窗口双击全屏 |
| | | iWndowType: iWndowType.value, |
| | | bDebugMode:true, |
| | | cbSelWnd: function (xmlDoc){ |
| | |
| | | }); |
| | | } |
| | | |
| | | const clickLogin = (data)=>{ |
| | | console.log(data); |
| | | const clickLogin = (data, iWndIndex)=>{ |
| | | WebVideoCtrl.I_Login(data.ip, 1, data.port, data.username, data.password, { |
| | | timeout: 3000, |
| | | success: function () { |
| | | console.log("开始预览"); //不能删除 |
| | | // 模拟通道 |
| | | WebVideoCtrl.I_GetAnalogChannelInfo(data.ip, { |
| | | success: function (xmlDoc) { |
| | | setTimeout(()=>{ |
| | | initPlay(data.ip, data.port); |
| | | initPlay(data.ip, data.port, iWndIndex); |
| | | }, 1000); |
| | | }, |
| | | error: function (oError) { |
| | | setTimeout(()=>{ |
| | | initPlay(data.ip, data.port, iWndIndex); |
| | | }, 1000); |
| | | } |
| | | }); |
| | | }, |
| | | error: function () { |
| | | console.log("login error"); |
| | |
| | | }); |
| | | }; |
| | | |
| | | const initPlay = (ip, port)=>{ |
| | | let oWndInfo = WebVideoCtrl.I_GetWindowStatus(0); |
| | | const initPlay = (ip, port, iWndIndex)=>{ |
| | | let oWndInfo = WebVideoCtrl.I_GetWindowStatus(iWndIndex); |
| | | if (oWndInfo != null) {// 已经在播放了,先停止 |
| | | WebVideoCtrl.I_Stop({ |
| | | iWndIndex, |
| | | success: function () { |
| | | startRealPlay(ip, port); |
| | | startRealPlay(ip, port, iWndIndex); |
| | | } |
| | | }); |
| | | } else { |
| | | startRealPlay(ip, port); |
| | | startRealPlay(ip, port, iWndIndex); |
| | | } |
| | | |
| | | } |
| | | |
| | | const startRealPlay = (ip, port)=>{ |
| | | const startRealPlay = (ip, port, iWndIndex)=>{ |
| | | WebVideoCtrl.I_StartRealPlay(ip, { |
| | | iStreamType: 1, |
| | | iChannelID: 1, |
| | | iWndIndex, |
| | | bZeroChannel: false, |
| | | success: function () { |
| | | console.log("开始预览成功!"); |
| | |
| | | watch( |
| | | isCollapse, |
| | | (newVal)=>{ |
| | | //changeWndNum(newVal[0]); |
| | | setTimeout(()=>{ |
| | | WebVideoCtrl.I_My_Resize(); |
| | | }, 0); |
| | | }, 300); |
| | | |
| | | }, |
| | | ); |