Which API doesn't behave as documented, and how does it misbehave?
setAsset(), play()
On web (chrome), the first asset that is set will play every time this is triggered. Even after the asset has been set to a different file. Behaves correctly on mobile.
Downgrading to 0.9.46 fixes the issue on web.
Minimal reproduction project
Provide a link here using one of two options:
final player = AudioPlayer();
await Future.wait([
player.setAsset(snapshot.data!.filePath()),
player.setVolume(.5)
]);
player.play();
To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:
- setAsset()
- play()
- replace asset with a new setAsset()
- play()
Error messages
If applicable, copy & paste error message here, within the triple quotes to preserve formatting.
Expected behavior
To behave as it does pre 0.10.0
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
-nA
Flutter SDK version
3.32.4
insert output of "flutter doctor" here
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.4, on macOS 15.5 24F74 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] Connected device (4 available)
[✓] Network resources
Additional context
None
Which API doesn't behave as documented, and how does it misbehave?
setAsset(), play()
On web (chrome), the first asset that is set will play every time this is triggered. Even after the asset has been set to a different file. Behaves correctly on mobile.
Downgrading to 0.9.46 fixes the issue on web.
Minimal reproduction project
Provide a link here using one of two options:
final player = AudioPlayer();
await Future.wait([
player.setAsset(snapshot.data!.filePath()),
player.setVolume(.5)
]);
player.play();
To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:
Error messages
Expected behavior
To behave as it does pre 0.10.0
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
-nA
Flutter SDK version
3.32.4
insert output of "flutter doctor" here
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.4, on macOS 15.5 24F74 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] Connected device (4 available)
[✓] Network resources
Additional context
None