public async Task ReplayLastAsync()
{
if (!player.IsAvailable)
{
return;
}
if (playedVideos.Count > 1)
{
Media LastVideo = PlayerAccess.GetVideoById(playedVideos[playedVideos.Count - 2]);
if (LastVideo.MediaId != player.CurrentVideo.MediaId)
{
playedVideos.RemoveAt(playedVideos.Count - 1);
if (nextVideo != null)
{
CancelNextDownload(nextVideo);
}
nextVideo = player.CurrentVideo;
// Enable/Disable SVP if necessary.
MpcConfigBusiness.AutoConfigure(nextVideo);
// Auto-pitch to 432hz
bool EnableAutoPitch = AutoPitchBusiness.AppyAutoPitch(LastVideo);
await player.PlayVideoAsync(LastVideo, EnableAutoPitch).ConfigureAwait(false);
Application.Current.Dispatcher.Invoke(() => PlaylistChanged?.Invoke(this, new EventArgs()));
}
}
}