Hi, I’m building a music player with Ember.js and now I’m ready to build a shuffle function.
Without shuffle, I’m able to go to previous and next using something like this:
this.get('tracks').objectAt( (this.get('currentTrackIndex') + 1) );
With shuffle, next is a random item in the array but prev should follow your listening history. Like iTunes and many others.
How would you do this? Maintain a “playbackHistory” array or?