Added shuffle and repeating

This commit is contained in:
lucast committed 2026-02-19 14:18:49 +01:00
1 parent 53e584b528
commit 43f2634660
2 files changed
+17 -3

No files matched your search

+5
View File
@@ -146,6 +146,10 @@ export default defineNuxtPlugin((nuxtApp) => {
sound.value = null
}
const shuffle = () => {
queue.value.sort(() => Math.random() - 0.5)
}
// Info
const getDuration = () =>
new Promise<number>((resolve) => {
@@ -174,6 +178,7 @@ export default defineNuxtPlugin((nuxtApp) => {
prev,
addToQueue,
clear,
shuffle,
getDuration,
getSecondsPlayed,
setSecondsPlayed,