old mode 100644
new mode 100755
| | |
| | | using System; |
| | | using Android.App; |
| | | using Android.Content.PM; |
| | | using System.Threading; |
| | | using Android.Content.Res; |
| | | using Android.Graphics; |
| | | using Android.OS; |
| | |
| | | [Activity(Name = "com.hdl.home.wxapi.VideoActivity", WindowSoftInputMode = SoftInput.AdjustResize, LaunchMode = LaunchMode.SingleInstance, ConfigurationChanges = (ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.LayoutDirection | ConfigChanges.Locale | ConfigChanges.Orientation | ConfigChanges.ScreenSize), Theme = "@style/MyTheme", ScreenOrientation = ScreenOrientation.Portrait)] |
| | | public class VideoActivity : Android.App.Activity, View.IOnClickListener, ISurfaceHolderCallback, VideoPhoneJni.ICallBack,TipDiaglog.OnConfirmClickListener |
| | | { |
| | | private static Activity activity; |
| | | private VideoPhone mPhone; |
| | | private ISurfaceHolder mRemoteSurfaceHolder; |
| | | private FrameLayout mRemoteFrameContainer; |
| | |
| | | public string DeviceName;//室外机的名称,例,室外机 |
| | | public string RoomName;//房间命名,例 8栋1单元0801 |
| | | public bool IsCollect;//是否收藏 |
| | | public int Tpye = 0;//类型,0 监控,1反呼 |
| | | |
| | | public int Tpye = 0;//类型,0 监控,1反呼
|
| | | |
| | | protected override void OnCreate(Bundle savedInstanceState) |
| | | { |
| | |
| | | |
| | | try |
| | | { |
| | | |
| | | activity = this; |
| | | ESVideoUUID = Intent.GetStringExtra("ESVideoUUID");//室外机UUID,例:JJY000007FSEYX |
| | | ESRoomID = Intent.GetIntExtra("ESRoomID", 0);//当前用户的房间 ID 101 |
| | | DeviceName = Intent.GetStringExtra("DeviceName");//室外机的名称,例,室外机 |
| | |
| | | } |
| | | else |
| | | { |
| | | reverseCallFragment = new ReverseCallFragment(mPhone, ESVideoUUID); |
| | | string param = "address=" + ESVideoUUID + ",tag=mobile://123,"; |
| | | reverseCallFragment = new ReverseCallFragment(mPhone, param); |
| | | FragmentManager.BeginTransaction().Replace(Resource.Id.content, reverseCallFragment).Commit(); |
| | | } |
| | | } |
| | |
| | | base.OnPause(); |
| | | if (mPhone != null) |
| | | { |
| | | mPhone.OnActivityPause(); |
| | | //mPhone.OnActivityPause(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | base.OnDestroy(); |
| | | if (mPhone != null) |
| | | { |
| | | mPhone.OnActivityDestroy(); |
| | | {
|
| | | mPhone.HangUp();
|
| | | mPhone.Release();
|
| | | mPhone = null;
|
| | | //mPhone.OnActivityDestroy();
|
| | | } |
| | | } |
| | | |
| | | }
|
| | |
|
| | | public override void OnBackPressed()
|
| | | {
|
| | | if (mPhone != null)
|
| | | mPhone.HangUp();
|
| | | else
|
| | | Finish();
|
| | | }
|
| | |
|
| | | public void OnClick(View v) |
| | | { |
| | | if (v.Equals(ivBack)) |
| | | { |
| | | this.Finish(); |
| | | {
|
| | | if (mPhone != null)
|
| | | mPhone.HangUp();
|
| | | else |
| | | Finish(); |
| | | } |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 弹出已挂断提示 |
| | | /// </summary> |
| | | private void showTipDialog(string title, string text, string btnText) |
| | | private void showTipDialog(string title, string text, string btnText,bool isClose) |
| | | { |
| | | try |
| | | { |
| | | TipDiaglog diaglog = new TipDiaglog(this); |
| | | diaglog.SetAutoClose(isClose); |
| | | diaglog.SetTitleText(title);//"提示" |
| | | diaglog.SetContentText(text);//"已挂断" |
| | | diaglog.SetConfirmText(btnText);//"确认" |
| | |
| | | |
| | | TextProtocol tp = new TextProtocol(); |
| | | tp.Parse(msg); |
| | | string event1 = tp.GetString("event"); |
| | | |
| | | string event1 = tp.GetString("event");
|
| | |
|
| | | switch (event1) |
| | | { |
| | | case "EVT_Ringing": |
| | |
| | | { |
| | | mPhone.StopStream(); |
| | | } |
| | | showTipDialog("提示","已挂断","确认"); |
| | | showTipDialog("提示", "已挂断", "确认", true); |
| | | break; |
| | | case "EVT_RECV_CUSTOM_DATA": |
| | | string data = tp.GetString("data"); |
| | |
| | | int error = tp.GetInt("error"); |
| | | string filePath = tp.GetString("filePath"); |
| | | if (error == 0) |
| | | { |
| | | showTipDialog("提示", "抓图成功", "确认"); |
| | | {
|
| | | showTipDialog("提示", "抓图成功", "确认", false); |
| | | } |
| | | else |
| | | { |
| | | showTipDialog("提示", "抓图失败\n\r" + error, "确认"); |
| | | {
|
| | | showTipDialog("提示", "抓图失败\n\r" + error, "确认", false); |
| | | } |
| | | break; |
| | | } |
| | |
| | | //throw new NotImplementedException(); |
| | | } |
| | | |
| | | public void onSureClick(TipDiaglog dialoog, View v) |
| | | public void onSureClick(TipDiaglog dialoog, View v, bool bol) |
| | | { |
| | | dialoog.Dismiss(); |
| | | this.Finish(); |
| | | dialoog.Dismiss();
|
| | | if (bol)
|
| | | this.Finish(); |
| | | } |
| | | } |
| | | } |