Added tracking/capturing/restoration of audio playback state and position.
This commit is contained in:
@@ -225,6 +225,20 @@ public partial class PlayerViewModel : ViewModelBase
|
||||
_timer.Tick += TickTock;
|
||||
|
||||
_dispatcherQueue = DispatcherQueue.GetForCurrentThread();
|
||||
|
||||
TryRestore();
|
||||
}
|
||||
|
||||
private void TryRestore()
|
||||
{
|
||||
if (_audioPlayer.PlayingSong is null)
|
||||
return;
|
||||
|
||||
Song = _audioPlayer.PlayingSong.Song;
|
||||
Position = _audioPlayer.Position;
|
||||
CurrentPosition = _audioPlayer.Position;
|
||||
|
||||
Task.Run(UpdateImage);
|
||||
}
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
Reference in New Issue
Block a user