mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
fix: Reset audioplayer when played until the end
This commit is contained in:
parent
54b152884a
commit
bc73a5da95
1 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue