Skip to content

Commit

Permalink
audio player infinite loop fix (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShresthPratapSingh authored Aug 8, 2020
1 parent cc39a27 commit cb51115
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ extension AudioPlayerViewController{
return
}

resetControls()

if dataModel.currentIndex >= dataModel.playerItems.count - 1{

//current queue is empty resetting queue
Expand Down Expand Up @@ -68,6 +70,7 @@ extension AudioPlayerViewController{

if let item = dataModel.preparePrevious(){
updateThumbnailCollectionView(for: .previous)
resetControls()
player.replaceCurrentItem(with: item)
loadSong()
}
Expand Down

0 comments on commit cb51115

Please sign in to comment.