fix: misc issues

This commit is contained in:
Jannat Patel
2024-10-10 14:48:59 +05:30
parent c76d8c582f
commit aba4c034fc
4 changed files with 104 additions and 35 deletions

View File

@@ -3,13 +3,14 @@
<video
@timeupdate="updateTime"
@ended="videoEnded"
class="rounded-lg border border-gray-100"
@click="togglePlay"
class="rounded-lg border border-gray-100 group cursor-pointer"
ref="videoRef"
>
<source :src="fileURL" :type="type" />
</video>
<div
class="flex items-center space-x-2 bg-gray-200 rounded-md p-0.5 absolute bottom-3 w-[98%] left-0 right-0 mx-auto"
class="flex items-center space-x-2 bg-gray-200 rounded-md p-0.5 absolute bottom-3 w-[98%] left-0 right-0 mx-auto invisible group-hover:visible"
>
<Button variant="ghost">
<template #icon>
@@ -106,6 +107,14 @@ const pauseVideo = () => {
playing.value = false
}
const togglePlay = () => {
if (playing.value) {
pauseVideo()
} else {
playVideo()
}
}
const videoEnded = () => {
playing.value = false
}