Fixed issue with maintaining audio player "pause" state between application restarts.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Harmonia.Core.Engine;
|
||||
using Harmonia.Core.Player;
|
||||
using Harmonia.Core.Playlists;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -55,17 +54,7 @@ public class SessionRestorer(
|
||||
if (audioPlayerState.Position > 0 && audioPlayerState.Position <= playlistSong.Song.Length.TotalSeconds)
|
||||
audioPlayer.Position = audioPlayerState.Position;
|
||||
|
||||
switch (audioPlayerState.PlaybackState)
|
||||
{
|
||||
case AudioPlaybackState.Playing:
|
||||
audioPlayer.Play();
|
||||
break;
|
||||
case AudioPlaybackState.Paused:
|
||||
audioPlayer.Pause();
|
||||
break;
|
||||
case AudioPlaybackState.Stopped:
|
||||
audioPlayer.Stop();
|
||||
break;
|
||||
}
|
||||
if (audioPlayerState.PlaybackState == AudioPlaybackState.Playing)
|
||||
audioPlayer.Play();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user