arielfaur / ionic-audio

An audio player for Ionic 3 and Angular 4. Works with HTML 5 audio or native audio using Cordova Media plugin.
http://arielfaur.github.io/ionic-audio/2.0/index.html
MIT License
321 stars 163 forks source link

Now working prev-next play function #122

Open mmswide opened 7 years ago

mmswide commented 7 years ago

I cannot find the solution how to play prev and next audio from audio queue. I'd like you to post the solution of this as soon as possible.

tbergeron commented 7 years ago

There's no previousTrack() nextTrack() so far. I guess you'd need to pause the current track, switch it to the next one and play the track.

// next track pseudo code example
let nextTrackIndex = currentTrackIndex+1; // get next track index
this.audioProvider.pause(); // pause current track
this.audioProvider.play(nextTrackIndex); // play next track

The thing is, this doesn't work fully right now because the player UI doesn't reflect the track change as stated here #106

I'll update this issue if I do any progress.