Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to Item is not working #77

Open
JhonnyTawk opened this issue Aug 20, 2019 · 2 comments
Open

Jump to Item is not working #77

JhonnyTawk opened this issue Aug 20, 2019 · 2 comments

Comments

@JhonnyTawk
Copy link

JhonnyTawk commented Aug 20, 2019

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

@jorgenhenrichsen
Copy link
Owner

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.

@JhonnyTawk
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants