Ensure that automatic playlist advance works

When playlists advance, the music should continue to play. The recent change to stop `setMusic` from "autoplaying" in this case must now be handled directly by the caller. This is far more clear to read: "set next music and play it."
This commit is contained in:
Eric Robinson 2017-12-12 13:37:31 -05:00
parent bd4426ff2b
commit fa66dd90f4
1 changed files with 4 additions and 0 deletions

View File

@ -573,13 +573,16 @@ class APlayer {
if (this.audio.currentTime !== 0) {
if (this.mode === 'random') {
this.setMusic(this.nextRandomNum());
this.play();
}
else if (this.mode === 'single') {
this.setMusic(this.playIndex);
this.play();
}
else if (this.mode === 'order') {
if (this.playIndex < this.option.music.length - 1) {
this.setMusic(++this.playIndex);
this.play();
}
else {
this.ended = true;
@ -590,6 +593,7 @@ class APlayer {
else if (this.mode === 'circulation') {
this.playIndex = (this.playIndex + 1) % this.option.music.length;
this.setMusic(this.playIndex);
this.play();
}
}
}