mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
fix(player): 插队曲目切换后下一首曲目丢失 (#2118)
This commit is contained in:
parent
f2efc4e682
commit
f2f4e2ce58
1 changed files with 10 additions and 3 deletions
|
|
@ -14,6 +14,8 @@ import { decode as base642Buffer } from '@/utils/base64';
|
||||||
|
|
||||||
const PLAY_PAUSE_FADE_DURATION = 200;
|
const PLAY_PAUSE_FADE_DURATION = 200;
|
||||||
|
|
||||||
|
const INDEX_IN_PLAY_NEXT = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @readonly
|
* @readonly
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
|
|
@ -255,8 +257,8 @@ export default class {
|
||||||
const next = this._reversed ? this.current - 1 : this.current + 1;
|
const next = this._reversed ? this.current - 1 : this.current + 1;
|
||||||
|
|
||||||
if (this._playNextList.length > 0) {
|
if (this._playNextList.length > 0) {
|
||||||
let trackID = this._playNextList.shift();
|
let trackID = this._playNextList[0];
|
||||||
return [trackID, this.current];
|
return [trackID, INDEX_IN_PLAY_NEXT];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 循环模式开启,则重新播放当前模式下的相对的下一首
|
// 循环模式开启,则重新播放当前模式下的相对的下一首
|
||||||
|
|
@ -704,7 +706,12 @@ export default class {
|
||||||
this._setPlaying(false);
|
this._setPlaying(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.current = index;
|
let next = index;
|
||||||
|
if (index === INDEX_IN_PLAY_NEXT) {
|
||||||
|
this._playNextList.shift();
|
||||||
|
next = this.current;
|
||||||
|
}
|
||||||
|
this.current = next;
|
||||||
this._replaceCurrentTrack(trackID);
|
this._replaceCurrentTrack(trackID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue