File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import { decode as base642Buffer } from '@/utils/base64';
1414
1515const PLAY_PAUSE_FADE_DURATION = 200 ;
1616
17+ const INDEX_IN_PLAY_NEXT = - 1 ;
18+
1719/**
1820 * @readonly
1921 * @enum {string}
@@ -255,8 +257,8 @@ export default class {
255257 const next = this . _reversed ? this . current - 1 : this . current + 1 ;
256258
257259 if ( this . _playNextList . length > 0 ) {
258- let trackID = this . _playNextList . shift ( ) ;
259- return [ trackID , this . current ] ;
260+ let trackID = this . _playNextList [ 0 ] ;
261+ return [ trackID , INDEX_IN_PLAY_NEXT ] ;
260262 }
261263
262264 // 循环模式开启,则重新播放当前模式下的相对的下一首
@@ -704,7 +706,12 @@ export default class {
704706 this . _setPlaying ( false ) ;
705707 return false ;
706708 }
707- this . current = index ;
709+ let next = index ;
710+ if ( index === INDEX_IN_PLAY_NEXT ) {
711+ this . _playNextList . shift ( ) ;
712+ next = this . current ;
713+ }
714+ this . current = next ;
708715 this . _replaceCurrentTrack ( trackID ) ;
709716 return true ;
710717 }
You can’t perform that action at this time.
0 commit comments