File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
src/structures/list/examples/music-player Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -41,22 +41,27 @@ const updateProgress = () => {
4141}
4242
4343const removeCurrentSong = () => {
44- if (! currentSong .value ) return
44+ if (! currentSong .value ) return ;
4545
46- const currentSongTitle = currentSong .value .value .title
47- playlist .value .removeCurrent ()
48- songs .value = songs .value .filter ((song ) => song .title !== currentSongTitle )
46+ const currentSongTitle = currentSong .value .value .title ;
47+ playlist .value .removeCurrent ();
48+ songs .value = songs .value .filter ((song ) => song .title !== currentSongTitle );
4949
5050 if (playlist .value .current ) {
51- currentSong .value = playlist .value .current
51+ currentSong .value = playlist .value .current ;
5252 if (audioPlayer .value ) {
53- audioPlayer .value .src = currentSong .value .value .src
53+ audioPlayer .value .src = currentSong .value .value .src ;
5454 if (isPlaying .value ) {
55- audioPlayer .value .play ()
55+ audioPlayer .value .play ();
5656 }
5757 }
5858 } else {
59- currentSong .value = null
59+ currentSong .value = null ;
60+ if (audioPlayer .value ) {
61+ audioPlayer .value .pause ();
62+ audioPlayer .value .src = ' ' ;
63+ isPlaying .value = false ;
64+ }
6065 }
6166}
6267
You can’t perform that action at this time.
0 commit comments