fix: Reset audioplayer when played until the end

pull/464/head
Krille 2 years ago
parent 54b152884a
commit bc73a5da95
No known key found for this signature in database

@ -119,6 +119,10 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
AudioPlayerWidget.wavesCount)
.round();
});
if (state.inMilliseconds.toDouble() == maxPosition) {
audioPlayer.stop();
audioPlayer.seek(null);
}
});
onDurationChanged ??= audioPlayer.durationStream.listen((max) {
if (max == null || max == Duration.zero) return;

Loading…
Cancel
Save