From b529946f2f992146da758cb6fcc1c0a97d898e32 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 04 十一月 2021 14:34:36 +0800
Subject: [PATCH] 2021-11-4 1.更新乐橙SDK

---
 HDL-ON_Android/LeChengVideoActivity.cs |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/HDL-ON_Android/LeChengVideoActivity.cs b/HDL-ON_Android/LeChengVideoActivity.cs
index 7cff4e5..2d2a0cc 100644
--- a/HDL-ON_Android/LeChengVideoActivity.cs
+++ b/HDL-ON_Android/LeChengVideoActivity.cs
@@ -133,6 +133,8 @@
             try
             {
                 LCOpenSDK_ParamReal paramReal = new LCOpenSDK_ParamReal(AccessToken, DeviceId, 0, Psk, PlayToken, 1, false, true);
+                //PlayEventListener listener = new PlayEventListener();//瀹炵幇鎾斁浜嬩欢鐩戝惉鍥炶皟 2021-10-15 鐩墠涓嶈兘鐩戝惉锛岀洃鍚簡浼氱┖寮傚父
+                //mPlayWindow.WindowListener = listener;//瀹炵幇鎾斁浜嬩欢鐩戝惉鍥炶皟
                 mPlayWindow.PlayRtspReal(paramReal);
             }
             catch (System.Exception e)
@@ -147,6 +149,7 @@
         public void Stop()
         {
             mPlayWindow.StopRtspReal(true);//鍏抽棴瑙嗛
+            //mPlayWindow.WindowListener = null;
         }
 
         /// <summary>
@@ -156,8 +159,14 @@
         {
             CloseAudio();// 鍏抽棴Audio
             LCOpenSDK_Talk.Listener = new AudioTalkerListener();//璁剧疆瀵硅鐩戝惉
+            //2021-10-29 瀵硅璇锋眰绫诲瀷锛宑all鍛煎彨锛屽鏋滀笉浼狅紝榛樿涓簍alk
+            string talkType = "talk";
+            if (Type == 1)//0鐩戞帶锛�1瀵硅
+            {
+                talkType = "call";
+            }
             // 瀵硅鍙傛暟
-            LCOpenSDK_ParamTalk paramTalk = new LCOpenSDK_ParamTalk(AccessToken, DeviceId, -1, Psk, PlayToken, true);
+            LCOpenSDK_ParamTalk paramTalk = new LCOpenSDK_ParamTalk(AccessToken, DeviceId, -1, Psk, PlayToken, true, talkType);
             LCOpenSDK_Talk.PlayTalk(paramTalk);
         }
 
@@ -210,6 +219,18 @@
             }
         }
 
+        ///// <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>
@@ -221,6 +242,9 @@
                 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();
                 }
@@ -333,6 +357,7 @@
 
                 try
                 {
+                    System.Console.WriteLine("LC OnTalkResult error锛�" + error + "  type:" + type);
                     bool talkResult = false;
                     if (type == 99 || error.Equals("-1000") || error.Equals("0") || error.Equals("1") || error.Equals("3"))
                     {
@@ -382,5 +407,19 @@
             }
         }
 
+        /// <summary>
+        /// 鎾斁銆侀瑙堢粨鏋滃洖璋�
+        /// resultSource:  0--RTSP  1--HLS  5--DHHTTP  99--OPENAPI
+        /// </summary>
+        class PlayEventListener : LCOpenSDK_EventListener
+        {
+            public override void OnPlayerResult(int index, string code, int resultSource)
+            {
+                base.OnPlayerResult(index, code, resultSource);
+                System.Console.WriteLine("LC OnPlayerResult index锛�" + index + "  code:" + code + "  resultSource:"+ resultSource);
+            }
+
+           
+        }
     }
 }

--
Gitblit v1.8.0