public async Task Stop() { if (CurrentPlaybackManager == null) { return; } await CurrentPlaybackManager.Stop(); MediaNotificationManager?.StopNotifications(); }
public async Task PlayPrevious() { // Start current track from beginning if it's the first track or the track has played more than 3sec and you hit "playPrevious". if (!MediaQueue.HasPrevious() || (Position > TimeSpan.FromSeconds(3))) { await CurrentPlaybackManager.Seek(TimeSpan.Zero); } else { //TODO: Maybe pause here instead of stop await CurrentPlaybackManager.Stop(); MediaQueue.SetPreviousAsCurrent(); await Task.WhenAll( CurrentPlaybackManager.Play(_currentMediaFile), GetMediaInformation(new[] { _currentMediaFile })); } }
public async Task PlayNext() { if (MediaQueue.HasNext()) { await CurrentPlaybackManager.Stop(); MediaQueue.SetNextAsCurrent(); await Task.WhenAll( CurrentPlaybackManager.Play(_currentMediaFile), GetMediaInformation(new[] { _currentMediaFile })); } else { // If you don't have a next song in the queue, stop and show the meta-data of the first song. //TODO: Shouldn't we Pause here instead of stop? Stop should shut down everything await CurrentPlaybackManager.Stop(); MediaQueue.SetIndexAsCurrent(0); } }
public async Task Stop() { await CurrentPlaybackManager.Stop(); MediaNotificationManager?.StopNotifications(); }