added skip

This commit is contained in:
Patryk Koreń
2025-12-29 18:14:59 +01:00
parent 03c2d35bf0
commit ac5f65844d
3 changed files with 42 additions and 0 deletions

View File

@@ -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()
}