public static async Task SeekFile(double value) { if (PlayingState == PlayingState.Stopped || PlayingEpisode == null) { return; } var seconds = PlayingEpisode.Progress.Length.TotalSeconds * (value / 100); await VlcApi.SeekFile(Convert.ToInt32(seconds)); PlayingEpisode.Progress.Progress = value / 100; Config.Instance.SaveConfig(); }
public static async Task PauseCommand() { await VlcApi.PauseToggle(); if (PlayingState == PlayingState.Paused) { PlayingState = PlayingState.Playing; } else if (PlayingState == PlayingState.Playing) { PlayingState = PlayingState.Paused; } }
public static async Task PlayFile(PodcastEpisodeView ep, bool fromStart = false) { var podcast = Config.Instance.ConfigObject.PodcastMap.Podcasts.FirstOrDefault(x => x.Value.PrimaryName == ep.PrimaryName).Value; if (podcast == null) { return; } var path = System.IO.Path.Combine(Config.Instance.ConfigObject.RootPath, podcast.FolderPath, ep.Episode.PublishDateUtc.Year.ToString(), ep.Episode.FileName); var seconds = 0; if (!fromStart) { seconds = Convert.ToInt32(ep.Episode.Progress.ProgressTime.TotalSeconds); } await VlcApi.PlayFile(path, seconds); podcast.LastPlayed = ep.Episode.EpisodeNumber; await UpdateLatestPlayedList().ConfigureAwait(false); }
public static async Task StopCommand() { await VlcApi.StopFile(); PlayingState = PlayingState.Stopped; }