| | |
| | | |
| | | private System.Threading.Timer timer = null; |
| | | private int Time = 0; |
| | | private bool isAnswer;//是否已经点击接听过了 |
| | | |
| | | private static LeChengVideoActivity CurtActivity; |
| | | |
| | |
| | | CurtActivity.Play(); |
| | | |
| | | CurtActivity.CloseAudio(); |
| | | |
| | | |
| | | return mView; |
| | | } |
| | | |
| | |
| | | catch { } |
| | | |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开锁 |
| | | /// </summary> |
| | | private void Unlock() |
| | | { |
| | | // |
| | | CurtActivity.Unlock(); |
| | | UpdataUnlockState(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (v.Equals(answerImg)) |
| | | { |
| | | //接收来电 |
| | | isAnswer = true; |
| | | CurtActivity.StartTalk(); |
| | | answerLayout.Visibility = ViewStates.Gone; |
| | | PostAnswer(); |
| | |
| | | else if (v.Equals(hangupImg)) |
| | | { |
| | | CurtActivity.StopTalk(); |
| | | PostHangup(); |
| | | //2021-11-30 增加拒绝和挂断操作处理 |
| | | if (isAnswer) |
| | | { |
| | | //如果接听过了,执行挂断接口 |
| | | PostHangup(); |
| | | } |
| | | else |
| | | { |
| | | //没接听直接挂断,执行拒接接口 |
| | | PostReject(); |
| | | } |
| | | |
| | | TimeEnd(); |
| | | Activity.Finish(); |
| | | } |
| | | else if (v.Equals(screenshotImg)) |
| | | { |
| | | //有视频过来可调用此接口进行拍照 |
| | | screenshotImg.Selected = true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; |
| | | string path = ss + "/" + time + ".jpg"; |
| | | CurtActivity.SnapShot(path); |
| | | } |
| | | else if (v.Equals(unlockImg)) |
| | | { |
| | | PostUnlock(); |
| | | CurtActivity.Unlock(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// post 截图 |
| | | /// </summary> |
| | | /// <param name="path">截图保留的路径</param> |
| | | private void PostScreenshot(string path) |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | string[] str = path.Split("/"); |
| | | string img_name = str.GetValue(str.Length - 1).ToString().Replace(".jpg", ""); |
| | | byte[] images = FileUtlis.Files.ReadFileForPath(path); |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("callId", VideoActivity.CallId); |
| | | d.Add("images", images); |
| | | d.Add("imagesName", img_name); |
| | | string jsonString = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | string url = "/home-wisdom/app/fl/vi/screenshot"; |
| | | ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); |
| | | Log.Info("LcVideo", "Post Screenshot Response code=" + response.Code); |
| | | } |
| | | catch { } |
| | | |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("callId", CurtActivity.CallId);//呼叫id |
| | | //d.Add("callStatus", "REJECT");//可用值:MISSED,RECEIVED,REJECT |
| | | d.Add("callStatus", "RECEIVED");//可用值:MISSED,RECEIVED,REJECT |
| | | d.Add("callDuration", Time);//通话时长(秒) |
| | | d.Add("interphoneTypeEnum", "IMOUVISIAL");//可用值:FLVI,IMOUVISIAL |
| | | string jsonString = HttpUtil.GetSignRequestJson(d); |