fix. 비디오 재생 하이드레이션 수정

This commit is contained in:
clkim
2025-12-19 17:36:43 +09:00
parent ebcb511947
commit 246cc373e2
2 changed files with 8 additions and 8 deletions

View File

@@ -4,7 +4,6 @@ interface Props {
type?: 'mp4' | 'webm'
poster?: string
play?: boolean
muted?: boolean
loop?: boolean
bordered?: boolean
class?: string
@@ -13,7 +12,6 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {
type: 'mp4',
play: true,
muted: true,
loop: true,
bordered: true,
})
@@ -98,9 +96,10 @@ watch(
)
onMounted(() => {
nextTick(() => {
nextTick(async () => {
if (props.play) {
playVideo()
await waitForCanPlay()
await playVideo()
}
})
})
@@ -118,8 +117,8 @@ onBeforeUnmount(() => {
<video
ref="videoRef"
:poster="props.poster"
:muted="props.muted"
:loop="props.loop"
muted
playsinline
>
<source :src="props.src" :type="`video/${props.type}`" />