diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aa3b30ae..e9ccc67e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Refactor Notifications code (small breaking changes) - AudioCache for web - Fixing basic features for Android lower than API 23 +- Fixing error after playing music several times with AudioCache ## 0.18.3 - Fix Float vs Double mixup on Swift that prevent non-integer values for volume/playback diff --git a/lib/audio_cache.dart b/lib/audio_cache.dart index c4ae91bce..39ceee67e 100644 --- a/lib/audio_cache.dart +++ b/lib/audio_cache.dart @@ -158,7 +158,9 @@ class AudioCache { }) async { final uri = await load(fileName); final player = _player(mode); - player.setReleaseMode(ReleaseMode.STOP); + if (fixedPlayer != null) { + player.setReleaseMode(ReleaseMode.STOP); + } await player.play( uri.toString(), volume: volume, @@ -186,6 +188,8 @@ class AudioCache { if (loop) { player.setReleaseMode(ReleaseMode.LOOP); + } else if (fixedPlayer != null) { + player.setReleaseMode(ReleaseMode.STOP); } await player.playBytes(