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}`" />
|
||||
|
||||
@@ -10,9 +10,9 @@ export const isExternalUrl = (url: string): boolean => {
|
||||
}
|
||||
|
||||
/**
|
||||
* 게임 도메인을 가져오는 컴포저블 함수
|
||||
* 게임 도메인을 추출하는 함수
|
||||
* 서버와 클라이언트 환경에서 모두 동작
|
||||
* @param event - H3 이벤트 객체 (서버 미들웨어에서 직접 전달 가능)
|
||||
* @param event - H3 이벤트 객체 (서버 전달 필수)
|
||||
* @returns 게임 도메인 문자열
|
||||
*/
|
||||
export const getGameDomain = (event?: H3Event): string => {
|
||||
@@ -66,7 +66,8 @@ export const getPathLocale = (url: string): string => {
|
||||
|
||||
/**
|
||||
* URL에서 언어 코드 이후의 경로를 추출하는 함수
|
||||
* @param url - URL 문자열 (서버에서는 필수)
|
||||
* 서버와 클라이언트 환경에서 모두 동작
|
||||
* @param url - URL 문자열
|
||||
* @returns 언어 코드 이후의 경로 문자열
|
||||
*/
|
||||
export const getPathAfterLanguage = (url: string): string => {
|
||||
|
||||
Reference in New Issue
Block a user