xyh123999 před 1 rokem
rodič
revize
d89fbb97fb

+ 7 - 5
src/components/hk/hkCamara.vue

@@ -125,8 +125,8 @@ export default {
             async: false,
             success: function (xmlDoc) {
               console.log("开始预览"); //不能删除
-              // that.getChannelInfo();
-              that.initPlay(Data, index);
+              let oChannels = that.getChannelInfo();
+              that.initPlay(Data, index,oChannels);
             },
             error: function () {
               console.log("login error");
@@ -145,6 +145,7 @@ export default {
           var oChannels = $(xmlDoc).find("VideoInputChannel");
           nAnalogChannel = oChannels.length;
           console.log("获取模拟通道成功!");
+          return oChannels
         },
         error: function () {
           console.log("获取模拟通道失败!" + WebVideoCtrl.I_GetLastError());
@@ -155,7 +156,7 @@ export default {
         async: false,
         success: function (xmlDoc) {
           var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
-          that.initPlay();
+         return oChannels
         },
         error: function () {
           WebVideoCtrl.I_GetLastError();
@@ -167,6 +168,7 @@ export default {
         async: false,
         success: function (xmlDoc) {
           var oChannels = $(xmlDoc).find("ZeroVideoChannel");
+          return oChannels
         },
         error: function () {
           console.log("获取零通道失败!" + WebVideoCtrl.I_GetLastError());
@@ -174,13 +176,13 @@ export default {
       });
     },
     //初始化视频,为了让用户进来就可以看到视频播放
-    initPlay(data, index) {
+    initPlay(data, index,oChannels) {
       let szIP = data.ip; //ip地址
       //循环16次是因为插件分屏最大为4x4(可以根据情况而定)
 
       WebVideoCtrl.I_StartRealPlay(szIP, {
         iStreamType: 1,
-        iChannelID: 1,
+        iChannelID: oChannels.id,//按格式修改
         iWndIndex: index,
       });
     },

+ 7 - 5
src/components/hk/hkv.vue

@@ -155,8 +155,8 @@ export default {
             success: function (xmlDoc) {
               console.log("开始预览"); //不能删除
 
-              // that.getChannelInfo();
-              that.initPlay(Data, index);
+              let oChannels = that.getChannelInfo();
+              that.initPlay(Data, index,oChannels);
             },
             error: function () {
               console.log("login error");
@@ -175,6 +175,7 @@ export default {
           var oChannels = $(xmlDoc).find("VideoInputChannel");
           nAnalogChannel = oChannels.length;
           console.log("获取模拟通道成功!");
+          return oChannels
         },
         error: function () {
           console.log("获取模拟通道失败!" + WebVideoCtrl.I_GetLastError());
@@ -185,7 +186,7 @@ export default {
         async: false,
         success: function (xmlDoc) {
           var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
-          that.initPlay();
+          return oChannels
         },
         error: function () {
           WebVideoCtrl.I_GetLastError();
@@ -197,6 +198,7 @@ export default {
         async: false,
         success: function (xmlDoc) {
           var oChannels = $(xmlDoc).find("ZeroVideoChannel");
+          return oChannels
         },
         error: function () {
           console.log("获取零通道失败!" + WebVideoCtrl.I_GetLastError());
@@ -204,13 +206,13 @@ export default {
       });
     },
     //初始化视频,为了让用户进来就可以看到视频播放
-    initPlay(data, index) {
+    initPlay(data, index,oChannels) {
       let szIP = data.ip; //ip地址
       //循环16次是因为插件分屏最大为4x4(可以根据情况而定)
 
       WebVideoCtrl.I_StartRealPlay(szIP, {
         iStreamType: 1,
-        iChannelID: 1,
+        iChannelID: oChannels.id,//按格式修改下
         iWndIndex: index,
       });
     },

+ 7 - 5
src/components/hk/monitorHK.vue

@@ -147,8 +147,8 @@ this.companyVideoData.forEach(obj => {
             async: false,
             success: function (xmlDoc) {
               console.log("开始预览"); //不能删除
-              // that.getChannelInfo();
-              that.initPlay(Data,index);
+              let oChannels = that.getChannelInfo();
+              that.initPlay(Data,index,oChannels);
             },
             error: function () {
               console.log("login error");
@@ -167,6 +167,7 @@ this.companyVideoData.forEach(obj => {
           var oChannels = $(xmlDoc).find("VideoInputChannel");
           nAnalogChannel = oChannels.length;
           console.log("获取模拟通道成功!");
+          return oChannels
         },
         error: function () {
           console.log("获取模拟通道失败!" + WebVideoCtrl.I_GetLastError());
@@ -177,7 +178,7 @@ this.companyVideoData.forEach(obj => {
         async: false,
         success: function (xmlDoc) {
           var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
-          that.initPlay();
+          return oChannels
         },
         error: function () {
           WebVideoCtrl.I_GetLastError();
@@ -189,6 +190,7 @@ this.companyVideoData.forEach(obj => {
         async: false,
         success: function (xmlDoc) {
           var oChannels = $(xmlDoc).find("ZeroVideoChannel");
+          return oChannels
         },
         error: function () {
           console.log("获取零通道失败!" + WebVideoCtrl.I_GetLastError());
@@ -196,13 +198,13 @@ this.companyVideoData.forEach(obj => {
       });
     },
     //初始化视频,为了让用户进来就可以看到视频播放
-    initPlay(data,index) {
+    initPlay(data,index,oChannels) {
       let szIP = data.ip; //ip地址
       //循环16次是因为插件分屏最大为4x4(可以根据情况而定)
         
         WebVideoCtrl.I_StartRealPlay(szIP, {
           iStreamType: 1,
-          iChannelID: 1,
+          iChannelID: oChannels.id,
           iWndIndex: index,
         });