| | |
| | | } |
| | | } |
| | | |
| | | public static Thread unlockThread = null;//公开出来,关闭activity的时候要结束这个线程,不然会引起崩溃 |
| | | /// <summary> |
| | | /// 更新开锁按钮状态,开锁成功,15秒内不给再点击按钮 |
| | | /// </summary> |
| | |
| | | |
| | | unlockImg.Enabled = false; |
| | | |
| | | new Thread(() => |
| | | { |
| | | Thread.Sleep(15 * 1000); |
| | | Activity.RunOnUiThread(() => |
| | | { |
| | | try { |
| | | if (unlockImg != null) |
| | | unlockImg.Enabled = true; |
| | | } |
| | | catch { } |
| | | }); |
| | | }).Start(); |
| | | unlockThread = new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Thread.Sleep(15 * 1000); |
| | | |
| | | Activity.RunOnUiThread(() => |
| | | { |
| | | try { |
| | | if (unlockImg != null) |
| | | unlockImg.Enabled = true; |
| | | } |
| | | catch { } |
| | | }); |
| | | |
| | | } |
| | | catch { } |
| | | });//.Start(); |
| | | |
| | | unlockThread.Start(); |
| | | |
| | | PostUnlock(); |
| | | } |
| | | catch { } |
| | | } |
| | |
| | | |
| | | switch (event1) |
| | | { |
| | | case "EVT_RECV_CUSTOM_DATA": |
| | | case "EVT_RECV_CUSTOM_DATA":// 开锁成功 |
| | | string data = tp.GetString("data"); |
| | | UpdataUnlockState(); |
| | | break; |
| | |
| | | { |
| | | string UserData = "user text"; |
| | | //注意:RequestAudio 请求对方音频,RequestVideo请求对方视频 SendAudio发送本地音频 SendVideo 发送本地视频 一般门口不接收到视频,所以最好设置0,减少流量消耗 |
| | | string param = string.Format("RequestAudio=1\r\n" + "RequestVideo=1\r\n" + "SendAudio=1\r\n" + "SendVideo=0r\n" + "UserData=%s\r\n", UserData); |
| | | string param = string.Format("RequestAudio=1\r\n" + "RequestVideo=1\r\n" + "SendAudio=1\r\n" + "SendVideo=1r\n" + "UserData=%s\r\n", UserData); |
| | | mPhone.AcceptRing(param); |
| | | answerLayout.Visibility = ViewStates.Gone; |
| | | PostAnswer(); |
| | |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; |
| | | string path = ss + "/" + time + ".jpg"; |
| | | mPhone.Snap(path); |
| | | //2021-09-01 增加发送广播,通知刷新图库的显示 |
| | | HDLONUtils.SendBroadcastScanFile(this.Context, path); |
| | | } |
| | | } |
| | | else if (v.Equals(unlockImg)) |
| | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("callId", VideoActivity.CallId); |
| | | d.Add("images", images); |
| | | d.Add("imagesName", img_name); |
| | | d.Add("imagesName", "_Android.jpg"); |
| | | string jsonString = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | string url = "/home-wisdom/app/fl/vi/screenshot"; |
| | |
| | | |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// post 开锁记录 |
| | | /// </summary> |
| | | private void PostUnlock() |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("callId", VideoActivity.CallId);//呼叫记录id int |
| | | string jsonString = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | string url = "/home-wisdom/app/fl/vi/unlock"; |
| | | ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); |
| | | Log.Info("FengLinVideo", "Post Reject Response code=" + response.Code); |
| | | } |
| | | catch { } |
| | | |
| | | }).Start(); |
| | | } |
| | | } |
| | | } |