Get offset in callback #170
-
Hi! Thanks for such an amazing library! Use case I have a list of tracks: Imagine that those tracks are the same. I need to add some visual representation which one of them is playing right now (border for example). If I have only id of track it's not possible to distinguish between those track. Also nextTrack and previosTracks won't help because they return array with max length equals 2 (imagine if I have 10 tracks with same id in queue). Maybe this can be done some other way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hey @yazyrankulov I don't think it's possible. The API accepts an offset for the play command, but I don't think there's a way to get the current track offset in the context. But honestly, your use case is very unique. Having the same track repeated 10+ times is super weird. I would use the repeat mode for it. Good luck |
Beta Was this translation helpful? Give feedback.
Hey @yazyrankulov
Thanks, mate! 🎉
I don't think it's possible. The API accepts an offset for the play command, but I don't think there's a way to get the current track offset in the context.
Since this is handled by either the SDK or the API, I don't keep the offset in the state.
Look at the API docs, and if you find a way to do it, let me know.
But honestly, your use case is very unique. Having the same track repeated 10+ times is super weird. I would use the repeat mode for it.
Good luck