wangxi 1 year ago
parent
commit
776eb37969

+ 2 - 0
Assets/Scripts/Camera/MainCameraController.cs

@@ -95,6 +95,8 @@ public class MainCameraController : MonoBehaviour
     public static string ip = "192.168.81.33";
     public static string devNo = "1";
     public static string brand = "";
+    public static string username = "";
+    public static string pwd = "";
     // Start is called before the first frame update
     void Start()
     {

+ 1 - 1
Assets/Scripts/Http/HttpClient.cs

@@ -62,7 +62,7 @@ public class HttpClient : MonoBehaviour
     /// <summary>
     /// ÇëÇóѲ¼ìÈÎÎñ
     /// </summary>
-    string FindInspectionData = "/api/services/isas/InspectionLiveData/GetAlarmLiveData";
+    string FindInspectionData = "/api/services/isas/InspectionLiveData/GetInspectionLiveData";
     /// <summary>
     /// »ñÈ¡³¡Õ¾ID
     /// </summary>

+ 8 - 0
Assets/Scripts/Http/InspectionDataInfo.cs

@@ -29,6 +29,14 @@ public class InspectionDataInfo : MonoBehaviour
         /// <summary>
         /// 
         /// </summary>
+        public string devUserName { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public string devPassword { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
         public string nvrIp { get; set; }
         /// <summary>
         /// 

+ 5 - 3
Assets/Scripts/UI/InspectionWndController.cs

@@ -125,7 +125,7 @@ public class InspectionWndController : MonoBehaviour
                 switch(item.state)
                 {
                     case 0: itemState = "已执行";break;
-                    case 1: itemState = "执行中"; RealTimePlayer(item.brand,item.cameraIp,item.devNo.ToString(), true); break;
+                    case 1: itemState = "执行中"; RealTimePlayer(item.brand,item.cameraIp,item.devNo.ToString(),item.devUserName,item.devPassword, true); break;
                     case 2: itemState = "未执行"; break;
                     default:break;
                 }
@@ -135,7 +135,7 @@ public class InspectionWndController : MonoBehaviour
         }
         else
         {
-            RealTimePlayer("","","1",false);
+            RealTimePlayer("","","1","","",false);
             clearData();
         }
     }
@@ -196,7 +196,7 @@ public class InspectionWndController : MonoBehaviour
     /// <param name="ip"></param>
     /// <param name="devNo"></param>
     /// <param name="isPlayer"></param>
-    public void RealTimePlayer(string brand,string ip,string devNo, bool isPlayer)
+    public void RealTimePlayer(string brand,string ip,string devNo, string username, string pwd, bool isPlayer)
     {
         if (isPlayer)
         {
@@ -205,6 +205,8 @@ public class InspectionWndController : MonoBehaviour
                 MainCameraController.brand = brand;
                 MainCameraController.ip = ip;
                 MainCameraController.devNo= devNo;
+                MainCameraController.username = username; 
+                MainCameraController.pwd=pwd;
                 play.onClick.Invoke();
             }
         }

+ 14 - 4
Assets/Scripts/UI/VideoPlayerController.cs

@@ -21,6 +21,8 @@ public class VideoPlayerController : MonoBehaviour
     public static string brand = "";
     public static string devNo = "";
     public static string ip = "";
+    public static string username = "";
+    public static string pwd = "";
     public bool isSelected = false;//配置界面是否显示
     public bool isShowTip = true;//是否显示标签
     // Start is called before the first frame update
@@ -113,11 +115,11 @@ public class VideoPlayerController : MonoBehaviour
         getVideoChannel(text);
         if (ip != ""&&brand!="")
         {
-            RealTimePlayer(brand,ip,devNo, true);
+            RealTimePlayer(brand,ip,devNo,username,pwd, true);
         }
         else
         {
-            RealTimePlayer("", "","1", false);
+            RealTimePlayer("", "","1","","", false);
         }
     }
     /// <summary>
@@ -138,6 +140,8 @@ public class VideoPlayerController : MonoBehaviour
                     brand = info.manufacturerInfo.manufacturerCode;
                     ip = info.ip;
                     devNo=info.devNo.ToString();
+                    username = info.devUserName;
+                    pwd = info.devPassword;
                     return;
                 }
             }
@@ -145,22 +149,26 @@ public class VideoPlayerController : MonoBehaviour
         brand = "";
         ip = "";
         devNo = "";
+        username = "";
+        pwd = "";
     }
     /// <summary>
     /// 实时播放
     /// </summary>
     /// <param name="channel"></param>
     /// <param name="isPlayer"></param>
-    public void RealTimePlayer(string brand,string ip, string devNo,bool isPlayer)
+    public void RealTimePlayer(string brand,string ip, string devNo, string username, string pwd, bool isPlayer)
     {
         if (isPlayer)
         {
             MainCameraController.brand = brand;
             MainCameraController.ip = ip;
             MainCameraController.devNo = devNo;
+            MainCameraController.username = username;
+            MainCameraController.pwd = pwd;
             //if (!isPlayed)
             //{
-                Vplay.onClick.Invoke();
+            Vplay.onClick.Invoke();
                 isPlayed = true;
            // }
         }
@@ -169,6 +177,8 @@ public class VideoPlayerController : MonoBehaviour
             MainCameraController.brand = brand;
             MainCameraController.ip = ip;
             MainCameraController.devNo = devNo;
+            MainCameraController.username = username;
+            MainCameraController.pwd = pwd;
             isPlayed = false;
         }
     }

+ 4 - 4
Assets/UniversalMediaPlayer/Scripts/UniversalMediaPlayer.cs

@@ -1042,17 +1042,17 @@ namespace UMP
             {
                 //nvr_ip = ini.keyVal["nvr_ip"];
                 //nvr_port = ini.keyVal["nvr_port"];
-                nvr_username = ini.keyVal["nvr_username"];
-                nvr_password = ini.keyVal["nvr_password"];
+                //nvr_username = ini.keyVal["nvr_username"];
+                //nvr_password = ini.keyVal["nvr_password"];
                 //rtsp_id = ini.keyVal["rtsp_id"];
                 //start_channel = int.Parse(ini.keyVal["start_channel"]);
-                rtsp = "rtsp://" + nvr_username + ":" + nvr_password + "@";// + nvr_ip + "/Streaming/channels/";// + rtsp_id;
+                //rtsp = "rtsp://" + nvr_username + ":" + nvr_password + "@";// + nvr_ip + "/Streaming/channels/";// + rtsp_id;
             }
         }
         public void Play()
         {
             //GetNVRData();
-            
+            rtsp = "rtsp://" + MainCameraController.username + ":" + MainCameraController.pwd + "@";
             if (MainCameraController.brand != default && MainCameraController.ip != default&& MainCameraController.devNo!= default)
             {
                 if(MainCameraController.brand=="Hik")