format wiadomości
This commit is contained in:
@@ -14,7 +14,7 @@ export async function requestSong(
|
||||
url: string) {
|
||||
|
||||
const path = await getAudioFile(url)
|
||||
queue.songList.push(path)
|
||||
queue.songList.push({ path, url })
|
||||
updatePlayer()
|
||||
|
||||
}
|
||||
@@ -24,8 +24,9 @@ export async function forceRequestSong(
|
||||
url: string) {
|
||||
|
||||
const path = await getAudioFile(url)
|
||||
queue.songList.push(path)
|
||||
queue.current = path
|
||||
const audio = { path, url }
|
||||
queue.songList.push(audio)
|
||||
queue.current = audio
|
||||
playSong(player, path);
|
||||
}
|
||||
|
||||
@@ -38,21 +39,24 @@ export async function updatePlayer() {
|
||||
return
|
||||
};
|
||||
queue.current = nextSong;
|
||||
playSong(player, nextSong);
|
||||
playSong(player, nextSong.path);
|
||||
}
|
||||
}
|
||||
|
||||
export function skip_song() {
|
||||
export function skip_song(): AudioFile | null {
|
||||
if (player.state.status === AudioPlayerStatus.Playing) {
|
||||
const skipped = queue.current
|
||||
const nextSong = queue.songList.shift()
|
||||
if (!nextSong) {
|
||||
queue.current = null
|
||||
player.stop()
|
||||
return
|
||||
return null
|
||||
};
|
||||
queue.current = nextSong;
|
||||
playSong(player, nextSong);
|
||||
playSong(player, nextSong.path);
|
||||
return skipped
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export function pause_playback(player: AudioPlayer) {
|
||||
|
||||
Reference in New Issue
Block a user