fix. 배경 비디오 currentTime 조절 추가

This commit is contained in:
clkim
2025-11-24 13:44:01 +09:00
parent 34145a3a62
commit f1f613add9

View File

@@ -35,6 +35,16 @@ const gradientClasses = computed(() => [
props.gradient,
])
// 비디오를 처음부터 재생하는 메서드
const restartVideo = () => {
if (!videoRef.value) return
videoRef.value.currentTime = 0
videoRef.value.play().catch(err => {
console.warn('Video play failed:', err)
})
}
// src 변경 시 비디오 다시 로드
watch(videoSrc, () => {
if (!videoRef.value) return
@@ -42,6 +52,10 @@ watch(videoSrc, () => {
videoRef.value.currentTime = 0
videoRef.value.load()
})
defineExpose({
restartVideo,
})
</script>
<template>