Skip to content

Commit

Permalink
Merge branch 'jfversluis:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
t871005y authored Sep 8, 2024
2 parents fbcd288 + 2b53e19 commit 3dd8f8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Plugin.Maui.Audio/AudioPlayer/AudioPlayer.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ void SetVolume(double volume, double balance)

void OnPlaybackEnded(object? sender, EventArgs e)
{
PlaybackEnded?.Invoke(this, e);

isPlaying = player.IsPlaying;

//this improves stability on older devices but has minor performance impact
Expand All @@ -318,6 +316,8 @@ void OnPlaybackEnded(object? sender, EventArgs e)
player.Stop();
player.Prepare();
}

PlaybackEnded?.Invoke(this, e);
}

protected virtual void Dispose(bool disposing)
Expand All @@ -330,6 +330,7 @@ protected virtual void Dispose(bool disposing)
if (disposing)
{
player.Completion -= OnPlaybackEnded;
player.Reset();
player.Release();
player.Dispose();
DeleteFile(cachePath);
Expand Down

0 comments on commit 3dd8f8e

Please sign in to comment.