eS v1
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<div class="fixed left-0 bottom-0 opacity-1 z-50 w-full bg-white transition-all"
|
||||
:class="{ '-bottom-20 opacity-0': !playerStore.currentTrack }">
|
||||
<audio ref="audioRef" class="w-full" :src="playerStore.currentTrack?.url || ''" controls />
|
||||
<div class="flex items-center gap-3 p-2">
|
||||
<img v-if="playerStore.getCurrentCoverUrl" :src="playerStore.getCurrentCoverUrl as string" alt="Current cover"
|
||||
class="size-16 object-cover object-center rounded" />
|
||||
<audio ref="audioRef" class="flex-1" controls />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -14,7 +18,7 @@ const audioRef = ref<HTMLAudioElement | null>(null)
|
||||
|
||||
onMounted(() => {
|
||||
if (audioRef.value) {
|
||||
playerStore.audio = audioRef.value
|
||||
playerStore.attachAudio(audioRef.value)
|
||||
audioRef.value.addEventListener("timeupdate", playerStore.updateTime)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user