fix. 비디오 재생 하이드레이션 수정
This commit is contained in:
@@ -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}`" />
|
||||
|
||||
Reference in New Issue
Block a user