| | |
| | | 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) |
| | |
| | | public void Stop() |
| | | { |
| | | mPlayWindow.StopRtspReal(true);//关闭视频 |
| | | //mPlayWindow.WindowListener = null; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | |
| | | ///// <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> |
| | |
| | | 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(); |
| | | } |
| | |
| | | |
| | | 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")) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /// <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); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |