From 312f9ece8d4a46d8989187730fc7f5c7fc36cfb5 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期五, 12 七月 2024 15:20:52 +0800 Subject: [PATCH] Update SplashActivity.cs --- HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs | 177 ++++++++++++++++++++++++++--------------------------------- 1 files changed, 78 insertions(+), 99 deletions(-) diff --git a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs index 5110263..707f12f 100644 --- a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs +++ b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs @@ -82,7 +82,7 @@ if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) { //涔愭鍙瀵硅 - //1.鍒濆鍖朙COpenSDK_Api + //1.鍒濆鍖朙COpenSDK_Api(Shared.IOS.LCVideoOnSDK) LCApiKit.SharedInstance().IsChinaMainland = GetIsChinaMainland(); LCApiKit.SharedInstance().InitSDKOpenApi(mESVideoInfo.Lc_AccessToken); LCApiKit.SharedInstance().CurrentDevicePlayToken = mESVideoInfo.Lc_PlayToken; @@ -98,27 +98,22 @@ } else if(interphoneType == InterphoneType.FLVI.ToString()) { - + //Shared.IOS.ESVideoOnSDK ESOnMonitorViewController vc = new ESOnMonitorViewController(); vc.MESVideoID = mESVideoInfo.ESVideoUUID; vc.MESRoomID = roomID; vc.DeviceName = mESVideoInfo.DeviceName; - //vc.RoomName = mESVideoInfo.RoomName; - //vc.MESCallDelegate = new OnESCallDelegate(this); Shared.Application.currentVC.NavigationController.PushViewController(vc, true); - }else if (interphoneType == InterphoneType.HDL.ToString()) + } + else if (interphoneType == InterphoneType.HDL.ToString()) { //HDLLinphone 鐙勮�愬厠 - HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo); - ////鍏ㄨ閫� - //NSDictionary deviceInfo = new NSDictionary("deviceCode","3-1-11-2", "deviceName", mESVideoInfo.DeviceName); - //Shared.IOS.HDLFVSDK.Video.Monitor(deviceInfo); + HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo, interphoneType); } else if (interphoneType == InterphoneType.FREEVIEW.ToString()) { //鍏ㄨ閫氱洃瑙� - NSDictionary deviceInfo = new NSDictionary("deviceCode",mESVideoInfo.deviceCode, "deviceName", mESVideoInfo.DeviceName); - Shared.IOS.HDLFVSDK.Video.Monitor(deviceInfo); - //HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo); + //NSDictionary deviceInfo = new NSDictionary("deviceCode",mESVideoInfo.deviceCode, "deviceName", mESVideoInfo.DeviceName); + //Shared.IOS.HDLFVSDK.Video.Monitor(deviceInfo); } else { @@ -142,35 +137,36 @@ Shared.Application.Activity.StartActivity(intent); } - else if (interphoneType == InterphoneType.FLVI.ToString()) - { + //else if (interphoneType == InterphoneType.FLVI.ToString()) + //{ - intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); - intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); - intent.PutExtra("uuid", mESVideoInfo.uuid); - intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); - intent.PutExtra("cmtID", mESVideoInfo.cmtID); - intent.PutExtra("roomno", mESVideoInfo.roomno); - intent.PutExtra("unitno", mESVideoInfo.unitno); - intent.PutExtra("HomeID", PirSend.HomeId); - intent.PutExtra("callId", mESVideoInfo.callId); - intent.PutExtra("Type", 0); + // intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); + // intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + // intent.PutExtra("uuid", mESVideoInfo.uuid); + // intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + // intent.PutExtra("cmtID", mESVideoInfo.cmtID); + // intent.PutExtra("roomno", mESVideoInfo.roomno); + // intent.PutExtra("unitno", mESVideoInfo.unitno); + // intent.PutExtra("HomeID", PirSend.HomeId); + // intent.PutExtra("callId", mESVideoInfo.callId); + // intent.PutExtra("Type", 0); - Shared.Application.Activity.StartActivity(intent); - } - else if (interphoneType == InterphoneType.HDL.ToString()) - { - //HDLLinphone 鐙勮�愬厠 - HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo, InterphoneType.HDL.ToString()); - } - else if (interphoneType == InterphoneType.FREEVIEW.ToString()) - { - string sip_account = "sip:D" + mESVideoInfo.deviceCode + "@139.159.157.75:46000"; - mESVideoInfo.deviceSipAccount = sip_account; - HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo, InterphoneType.FREEVIEW.ToString()); - } + // Shared.Application.Activity.StartActivity(intent); + //} + //else if (interphoneType == InterphoneType.HDL.ToString()) + //{ + // //HDLLinphone 鐙勮�愬厠 + // HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo, InterphoneType.HDL.ToString()); + //} + //else if (interphoneType == InterphoneType.FREEVIEW.ToString()) + //{ + // string sip_account = "sip:D" + mESVideoInfo.deviceCode + "@139.159.157.75:46000"; + + // mESVideoInfo.deviceSipAccount = sip_account; + // HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo, InterphoneType.FREEVIEW.ToString()); + //} else { HDLUtils.WriteLine("鏈鎺ワ紝涓嶆敮鎸佺洃瑙�"); @@ -191,7 +187,7 @@ if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) { //涔愭鍙瀵硅 - //1.鍒濆鍖朙COpenSDK_Api + //1.鍒濆鍖朙COpenSDK_Api(Shared.IOS.LCVideoOnSDK) LCApiKit.SharedInstance().IsChinaMainland = GetIsChinaMainland(); LCApiKit.SharedInstance().InitSDKOpenApi(mESVideoInfo.Lc_AccessToken); //2021-05-18 鐩墠鎺ㄩ�佺殑PlayToken;鏈夐棶棰樹細瀵艰嚧SDK宕╂簝锛屾殏鏃朵笉浼� @@ -218,8 +214,14 @@ //2.璁剧疆钀ょ煶瀛愯处鍙风殑AccessToken鍒癝DK EZSDK.IOS.EZSDK.SharedInstance().SetEZAccessToken(mESVideoInfo.Lc_AccessToken); //3.鎵撳紑瑙嗛鎾斁椤甸潰 - EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(mESVideoInfo.DeviceSerial); + string currentTimeStr = Utlis.GetTimestamp(); // 褰撳墠鏃堕棿 + if (string.IsNullOrEmpty(mESVideoInfo.currentTime) && string.IsNullOrEmpty(currentTimeStr) && (long.Parse(currentTimeStr) - long.Parse(mESVideoInfo.currentTime)) > 30000) { // 瓒呮椂30s + EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(mESVideoInfo.DeviceSerial); + } + else { + EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(mESVideoInfo.DeviceSerial, mESVideoInfo.msgId); + } } else if (interphoneType == InterphoneType.HDL.ToString()) { @@ -229,7 +231,7 @@ } else if (interphoneType == InterphoneType.FLVI.ToString()) { - + //Shared.IOS.ESVideoOnSDK ESOnIntercomViewController vc = new ESOnIntercomViewController(); vc.MESVideoID = mESVideoInfo.ESVideoUUID; vc.MESRoomID = roomID; @@ -239,7 +241,8 @@ mOnESCallDelegate = new OnESCallDelegate(this); vc.MESCallDelegate = mOnESCallDelegate; Shared.Application.currentVC.NavigationController.PushViewController(vc, true); - }else{ + } + else{ HDLUtils.WriteLine("鏈敮鎸佺殑鍙瀵硅绫诲瀷"); } @@ -265,64 +268,32 @@ Shared.Application.Activity.StartActivity(intent); } - else if (interphoneType == InterphoneType.EZVIZ.ToString()) - { - ((BaseActivity)Shared.Application.Activity).SetCamera(b => - { - if (b) - { - intent = new Android.Content.Intent(); - var bundle = new Android.OS.Bundle(); - //浼犻�抧ame鍙傛暟涓簍inyphp - bundle.PutString("EzChildAccessToken", mESVideoInfo.Lc_AccessToken); - bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); - bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); - bundle.PutString("EzvizAppKey", "1aa98a90489b4838b966b57018b4b04b"); - bundle.PutInt("Platform", 1); - bundle.PutString("HomeId", mESVideoInfo.HomeId); - bundle.PutString("DeviceSerial", mESVideoInfo.DeviceSerial); - intent.PutExtras(bundle); - intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); - Shared.Application.Activity.StartActivity(intent); - } - }); - return; - } - else if (interphoneType == InterphoneType.HDL.ToString()) - { - //HDL Linphone 鐙勮�愬厠 + //else if (interphoneType == InterphoneType.HDL.ToString()) + //{ + // //HDL Linphone 鐙勮�愬厠 - } - else if (interphoneType == InterphoneType.FLVI.ToString()) - { - //寰呭垹鍑忎笉蹇呰鍙傛暟 - intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); - intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); - intent.PutExtra("uuid", mESVideoInfo.uuid); - intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); - intent.PutExtra("cmtID", mESVideoInfo.cmtID); - intent.PutExtra("roomno", mESVideoInfo.roomno); - intent.PutExtra("unitno", mESVideoInfo.unitno); - intent.PutExtra("HomeID", PirSend.HomeId); - intent.PutExtra("callId", mESVideoInfo.callId); - intent.PutExtra("Type", 1); + //} + //else if (interphoneType == InterphoneType.FLVI.ToString()) + //{ + // //寰呭垹鍑忎笉蹇呰鍙傛暟 + // intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); + // intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + // intent.PutExtra("uuid", mESVideoInfo.uuid); + // intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + // intent.PutExtra("cmtID", mESVideoInfo.cmtID); + // intent.PutExtra("roomno", mESVideoInfo.roomno); + // intent.PutExtra("unitno", mESVideoInfo.unitno); + // intent.PutExtra("HomeID", PirSend.HomeId); + // intent.PutExtra("callId", mESVideoInfo.callId); + // intent.PutExtra("Type", 1); - - - - Shared.Application.Activity.StartActivity(intent); - } + // Shared.Application.Activity.StartActivity(intent); + //} else { HDLUtils.WriteLine("鏈敮鎸佺殑鍙瀵硅绫诲瀷"); - } - - - - - #endregion #endif } @@ -580,7 +551,7 @@ #if __IOS__ #region OnESCallDelegate /////// <summary> - /////// OnESCallDelegate 缁ф壙鍝嶅簲浜嬩欢 + /////// OnESCallDelegate 缁ф壙鍝嶅簲浜嬩欢(Shared.IOS.ESVideoOnSDK) /////// </summary> OnESCallDelegate mOnESCallDelegate; @@ -656,7 +627,7 @@ #region OnLCCallDelegate /////// <summary> - /////// OnLCCallDelegate 缁ф壙鍝嶅簲浜嬩欢 + /////// OnLCCallDelegate 缁ф壙鍝嶅簲浜嬩欢(Shared.IOS.LCVideoOnSDK) /////// </summary> OnLCCallDelegate mOnLCCallDelegate; @@ -724,7 +695,7 @@ #endregion - + #endif ///// <summary> @@ -829,6 +800,14 @@ /// 璁惧搴忓垪鍙� /// </summary> public string DeviceSerial = string.Empty; + /// <summary> + /// 鏈嶅姟鍣ㄦ帹閫佹椂闂� + /// </summary> + public string currentTime = string.Empty; + /// <summary> + /// 娑堟伅id + /// </summary> + public string msgId = string.Empty; //========================HDL SIP========================== /// <summary> /// 璁惧sip璐﹀彿 interphoneType鏄疕DL鏃舵墠浼氭湁鍊� @@ -874,7 +853,7 @@ /// <summary> /// 涓版灄骞冲彴 /// </summary> - FLVI, + //FLVI, /// <summary> /// 澶у崕鍙瀵硅骞冲彴 /// </summary> @@ -882,15 +861,15 @@ /// <summary> /// 钀ょ煶鐚溂鍛煎彨 /// </summary> - EZVIZ, + //EZVIZ, /// <summary> /// 鐙勮�愬厠 HDL Linphone /// </summary> - HDL, + //HDL, /// <summary> /// 鍏ㄨ閫氬璁� /// </summary> - FREEVIEW, + //FREEVIEW, } } -- Gitblit v1.8.0