mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
client: move table items to a independent component
This commit is contained in:
@@ -20,6 +20,8 @@ const playAudio = (path) => {
|
||||
})
|
||||
.then(() => {
|
||||
audio.play();
|
||||
perks.focusCurrent()
|
||||
|
||||
state.is_playing.value = true;
|
||||
|
||||
audio.ontimeupdate = () => {
|
||||
@@ -41,7 +43,6 @@ function playPrev() {
|
||||
}
|
||||
|
||||
function seek(pos) {
|
||||
console.log(pos);
|
||||
audio.currentTime = (pos / 1000) * audio.duration;
|
||||
}
|
||||
|
||||
@@ -68,4 +69,5 @@ audio.addEventListener("pause", () => {
|
||||
audio.addEventListener("ended", () => {
|
||||
playNext();
|
||||
});
|
||||
|
||||
export default { playAudio, playNext, playPrev, playPause, seek, pos, playing };
|
||||
|
||||
Reference in New Issue
Block a user