private async void AutoPlayOnStartup(AutoPlayAction autoPlayAction) { await Task.Delay(TimeSpan.FromSeconds(1)); logger.Info("AutoPlay " + autoPlayAction); await WebViewHelper.AutoPlay(autoPlayAction); }
public async void NavigateWithConfig(string parameter) { try { var urlDecoder = new WwwFormUrlDecoder(parameter); var pageUrl = urlDecoder.GetFirstValueByName("pageUrl"); await WebViewHelper.NavigateToSpotifyUrl(pageUrl); var autoplayEntry = urlDecoder.FirstOrDefault(x => x.Name == "autoplay"); AutoPlayAction action = AutoPlayAction.None; if (autoplayEntry != null) { action = autoplayEntry.Value == "track" ? AutoPlayAction.Track : AutoPlayAction.Playlist; } if (action != AutoPlayAction.None) { await WebViewHelper.AutoPlay(action); } return; } catch (Exception ex) { logger.Info($"Parsing input parameter {parameter} failed. {ex}"); } }