using EC.App.ThatService.Onvif.Impl; using EC.Onvif; using System.Threading.Tasks; namespace EC.App.ThatBLL.Onvif.Impl { public class MediaBLL : IMediaBLL { private readonly OnvifClientService _ocService; public MediaBLL(OnvifClientService onvifClientService) { _ocService = onvifClientService; } public bool IsConnected(string ip) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); bool ret = flag && onvifClient.IsMediaContected(); return ret; } public async Task GetStreamUri(string ip) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); if (!flag) return string.Empty; string uri = await onvifClient.GetStreamUri(); return uri; } public async Task GetSnapshotUri(string ip) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); if (!flag) return string.Empty; string uri = await onvifClient.GetSnapshotUri(); return uri; } } }