From df3906c03db154e8622b7caeaa3bf93b67c6d40a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 15 十月 2021 10:25:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/newBranch1' into CJL-Linphone
---
HDL-ON_Android/LeChengVideoActivity.cs | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 100 insertions(+), 3 deletions(-)
diff --git a/HDL-ON_Android/LeChengVideoActivity.cs b/HDL-ON_Android/LeChengVideoActivity.cs
index 71cb5b4..0f426d0 100644
--- a/HDL-ON_Android/LeChengVideoActivity.cs
+++ b/HDL-ON_Android/LeChengVideoActivity.cs
@@ -21,6 +21,7 @@
using Com.Lechange.Opensdk.Media;
using HDL_ON.DAL.Server;
using HDL_ON_Android.LeChengView.Form;
+using Java.IO;
using Java.Lang;
namespace HDL_ON_Android
@@ -37,6 +38,8 @@
public string PlayToken = "";//鎾斁playToken
public string CallId = "";//鍛煎彨Id
private int Type = 0;//0鐩戞帶锛�1瀵硅
+ private string DeviceName = "";// 澶囨敞
+
/// <summary>
/// 0:鍥藉唴锛�1娴峰
/// </summary>
@@ -65,6 +68,7 @@
Type = Intent.GetIntExtra("Type", 0);//0鐩戞帶锛�1瀵硅//1
Location = Intent.GetIntExtra("Location", 0);//1
CallId = Intent.GetStringExtra("callId");//1384766990812426242
+ DeviceName = Intent.GetStringExtra("DeviceName");
InitLCSDK();
@@ -95,7 +99,7 @@
ivBack = (ImageView)FindViewById(Resource.Id.videoBackImg);
tvName = (TextView)FindViewById(Resource.Id.nameText);
- tvName.SetText("DeviceName", null);
+ tvName.SetText(DeviceName, null);
ivBack.SetOnClickListener(this);
}
@@ -108,7 +112,7 @@
mPlayWindow = new LCOpenSDK_PlayWindow();
mPlayWindow.InitPlayWindow(this, flWindowContent, 0, true);
- //if (Location == 1)
+ if (Location == 1)
URL = "openapi.easy4ip.com:443";
}
@@ -182,6 +186,99 @@
public bool CloseAudio()
{
return mPlayWindow.StopAudio() == 0;
+ }
+
+ /// <summary>
+ /// 寮�閿�
+ /// </summary>
+ public void Unlock()
+ {
+ //
+ Dictionary<string, object> dic = new Dictionary<string, object>();
+ dic.Add("deviceId", this.DeviceId);
+ dic.Add("callId", this.CallId);
+
+ var requestJson = HttpUtil.GetSignRequestJson(dic);
+ var revertObj = HttpUtil.RequestHttpsPostFroHome("/home-wisdom/platform/imou/openDoorbell", requestJson);
+ if (revertObj.Code == StateCode.SUCCESS)
+ {
+ Toast.MakeText(this, Resources.GetString(Resource.String.unlock_success), ToastLength.Short).Show();
+ }
+ else
+ {
+ Toast.MakeText(this, Resources.GetString(Resource.String.unlock_fail), ToastLength.Short).Show();
+ }
+ }
+
+ ///// <summary>
+ ///// 鍙戦�佸箍鎾紝閫氱煡鍒锋柊鍥惧簱鐨勬樉绀�
+ ///// </summary>
+ ///// <param name="path"></param>
+ //void SendBroadcastScanFile(Context context, string path)
+ //{
+ // // 鍙戦�佸箍鎾紝閫氱煡鍒锋柊鍥惧簱鐨勬樉绀�
+ // Intent scanIntent = new Intent(Intent.ActionMediaScannerScanFile);
+ // scanIntent.SetData(Android.Net.Uri.FromFile(new File(path)));
+ // context.SendBroadcast(scanIntent);
+ //}
+
+ /// <summary>
+ /// 鎴浘
+ /// </summary>
+ /// <param name="path"></param>
+ public void SnapShot(string path)
+ {
+ try
+ {
+ int code = mPlayWindow.SnapShot(path);
+ if (code == 0)
+ {
+ //2021-09-01 澧炲姞鍙戦�佸箍鎾紝閫氱煡鍒锋柊鍥惧簱鐨勬樉绀�
+ HDLONUtils.SendBroadcastScanFile(this, path);
+
+ //Android.Provider.MediaStore.Images.Media.InsertImage(this.getContentResolver(), path, "ss", "ss");
+ Toast.MakeText(this, Resources.GetString(Resource.String.screenshot_success), ToastLength.Short).Show();
+ }
+ else
+ {
+ Toast.MakeText(this, Resources.GetString(Resource.String.screenshot_fail), ToastLength.Short).Show();
+ }
+ }
+ catch (System.Exception e)
+ {
+ string error = e.Message;
+ }
+
+ //杩愯鍒拌繖锛宲hotoFile宸茬粡瀛樺湪锛岃繖閲岄渶瑕佽幏寰楄繖涓枃浠剁殑uri
+ //* 鍒嗕袱绉嶆儏鍐碉紝android7.0浠ヤ笂鍜屼互涓�
+ // 鍏堝瓨鍏ヤ复鏃剁洰褰曪紝鐒跺悗鍐嶇Щ鍔ㄥ埌鐩稿唽鐩綍涓�
+ //File photoFile = new File(path);
+ //Android.Net.Uri photoUri;
+
+ //if (Build.VERSION.SdkInt >= 24)
+ //if (Build.VERSION.PreviewSdkInt >= 24)
+ //{
+
+ // /**
+ // * FileProvider.getUriForFile(),杩欎釜鏂规硶涓渶瑕佸~鍐欎笁涓弬鏁帮紝
+ // * 绗竴涓狢ontext锛�
+ // * 绗簩涓猄
+ // * tring 浠绘剰
+ // * 绗笁涓狥ile
+ // */
+ // photoUri = FileProvider.GetUriForFile(this, "HDL Video SnapShot", photoFile);
+
+ //}
+ //else
+ //{
+ // photoUri = Android.Net.Uri.FromFile(photoFile);
+ //}
+
+ }
+
+ private ContentResolver getContentResolver()
+ {
+ throw new NotImplementedException();
}
/// <summary>
@@ -267,7 +364,7 @@
CurtActivity.StopTalk();
CurtActivity.RunOnUiThread(() =>
{
- Toast.MakeText(CurtActivity, "鎵撳紑瀵硅澶辫触", ToastLength.Short).Show();
+ Toast.MakeText(CurtActivity, Resource.String.talk_open_failed, ToastLength.Short).Show();
});
}
else
--
Gitblit v1.8.0