Attempt to automatically play next music
This commit is contained in:
parent
aa3f743eee
commit
b11eb6063c
@ -59,7 +59,15 @@ class _MusicPlayerState extends State<MusicPlayer> {
|
||||
autoPlay: true,
|
||||
showControls: false);
|
||||
|
||||
_videoPlayerController!.addListener(() => setState(() {}));
|
||||
_videoPlayerController!.addListener(() => setState(() {
|
||||
// Automatically play next music if required
|
||||
if (_videoPlayerController != null && _duration == _position) {
|
||||
if (_duration?.inSeconds == _position?.inSeconds &&
|
||||
(_duration?.inSeconds ?? 0) > 0) {
|
||||
_playNext();
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user