diff --git a/src/pages/Playroom.vue b/src/pages/Playroom.vue index a36fc77..803b290 100644 --- a/src/pages/Playroom.vue +++ b/src/pages/Playroom.vue @@ -55,6 +55,26 @@ function formatDetector() { if (format === 'wav') { return 'WAV' } return '未知格式' } + +function playNext() { + if (playQueueStore.currentIndex === playQueueStore.list.length - 1) { + console.log("at the bottom, pause") + playQueueStore.currentIndex = 0 + playQueueStore.isPlaying = false + } else { + playQueueStore.currentIndex++ + playQueueStore.isPlaying = true + } +} + +function playPrevious() { + if (playQueueStore.currentTime < 5 && playQueueStore.currentIndex > 0) { + playQueueStore.currentIndex-- + playQueueStore.isPlaying = true + } else { + playQueueStore.updatedCurrentTime = 0 + } +}