SwiftAudio
SwiftAudio copied to clipboard
Jump to Item is not working
I am using this code:
`for i in 0 ..< songInfoArray.count {
let item = songInfoArray[i]
let audio = DefaultAudioItem(audioUrl: item.url artist: item.singerName, title: item.title, albumTitle: item.thumbnail, sourceType: .stream)
sources.append(audio)
}`
try? player.add(items: sources, playWhenReady: false)
`if songInfoArray.count > 1 {
try? player.jumpToItem(atIndex: songInfoArray.count - 1)
}`
**try? player.jumpToItem(atIndex: songInfoArray.count - 1)**
is not working
the player always play the songs from the start
Sorry, it is hard for me to understand your issue. It is much easier to understand your code if you are clear on what you expect to happen, what you do, and what actually happens. Also please provide what version you are on when reporting an issue.
The issue is I am populating the source array of the fly so If I have 3 items and I added 5 and then I wanted to jump to the last item it's not working. If I set the array with all the items at first that way it works.
I am using the last version on Github.