public static ServiceResult DialogProcessURIBlocking(string uri, Window owner) { var window = new ServiceResultResolver(owner); ServiceResult result = null; bool closed = false; var task = Task.Run(() => { //result = StreamingFactory.Instance.GetStreamingInfo(uri); result = ProcessURI(uri); if (closed) { log.Info($"Streaming result resolving was cancelled before completion. Uri={uri}."); } else { window.Dispatcher.InvokeAsync(() => window.Close()); } }); window.ShowDialog(); closed = true; return(result); }
public void OpenURI(string uri) { SelectedServiceResult = null; Streaming.ServiceResult result = ServiceResultResolver.DialogProcessURIBlocking(uri, ShellViewModel.Instance.playerWindow); LoggerManager.Info($"OpenURI: Parsed '{uri}' to {result}"); if (result == null) { urlLoadLock = false; return; } Execute.OnUIThread(() => { ResetPlayback(); LoadMedia(result); }); }