SwiftAudio
SwiftAudio copied to clipboard
How to know that the song is ended
In my app i am playing single song so no option for next and previous. I want that when the songs end then the slider value should be reset, the play btn image should be changed and the current time should be "00:00" so that i can again play. But right now as per your example when the songs end the play button image changes to play, the song stops but the slider and current time label doesnt change and if i press play button then nothing happens
@nishant6042 implement this event on player
player.event.playbackEnd.addListener(self, handlePlaybackEnd)
func handlePlaybackEnd(data: AudioPlayer.PlaybackEndEventData) {
if data == .playedUntilEnd {
//playing ended
}
}