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

Active song index is wrong after shuffle. #318

Closed
enemyss opened this issue Jan 28, 2019 · 6 comments
Closed

Active song index is wrong after shuffle. #318

enemyss opened this issue Jan 28, 2019 · 6 comments
Assignees
Labels
Bug: Needs Confirmation 🧐 Bugs that are reported, but needs to be confirmed and replicated.

Comments

@enemyss
Copy link

enemyss commented Jan 28, 2019

Issue description

Updated from version 3.3.1 to 4. And shuffle mode and active song index is not working properly - when shuffle mode is enabled the "Amplitude.getActiveIndex()" doesn't return correct active song index. It was working good with 3.3.1.

Steps to reproduce the issue

  1. Init player with songs array.
  2. Set shuffle mode on.
  3. Press "amplitude-next"

What is expected?

Amplitude.getActiveIndex() should return the index of song which is playing, not the next song in array.

@danpastori
Copy link
Contributor

@enemyss So the way the active index works is it either references the songs array if shuffle is not on or the shuffle array if shuffle is on. I'm pushing an update in 4.2 where you can get the active song metadata and it will return the index of the song in the songs array or if you are in a playlist the index of the song in the playlist no matter if shuffle is on or not.

@enemyss
Copy link
Author

enemyss commented Mar 19, 2019

@danpastori I'm still confused, it means that it is working as it should? The main issue with this I have is that when switching to next song the DOM element is incorrect for song playing because it just takes next song in array instead of shuffled song, this seems incorrect or am I missing something?

@danpastori
Copy link
Contributor

@enemyss Nope, you were right that it was returning the wrong index. If you check out the dev branch: 6245c16 The push has been made. You can download this and you will get the right index when you get the active song. Is this what you were looking for?

@enemyss
Copy link
Author

enemyss commented Apr 8, 2019

@danpastori Tried that, but now it returns NaN on Amplitude.getActiveIndex() and DOM element sync still takes next song in list after pressing on 'amplitude-next'. It returns active song metadata correct though..

@jaydrogers jaydrogers added the Bug: Needs Confirmation 🧐 Bugs that are reported, but needs to be confirmed and replicated. label Jul 12, 2019
@danpastori
Copy link
Contributor

This was fixed in v5.0.1

@enemyss
Copy link
Author

enemyss commented Dec 11, 2019

Still broken in v5.0.3 - https://521dimensions.com/open-source/amplitudejs/docs/examples/multiple-playlists.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Needs Confirmation 🧐 Bugs that are reported, but needs to be confirmed and replicated.
Projects
None yet
Development

No branches or pull requests

3 participants