added skip
This commit is contained in:
@@ -42,6 +42,19 @@ export async function updatePlayer() {
|
||||
}
|
||||
}
|
||||
|
||||
export function skip_song() {
|
||||
if (player.state.status === AudioPlayerStatus.Playing) {
|
||||
const nextSong = queue.songList.shift()
|
||||
if (!nextSong) {
|
||||
queue.current = null
|
||||
player.stop()
|
||||
return
|
||||
};
|
||||
queue.current = nextSong;
|
||||
playSong(player, nextSong);
|
||||
}
|
||||
}
|
||||
|
||||
export function pause_playback(player: AudioPlayer) {
|
||||
player.pause()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user