fix: wait for DOM update before attaching video element
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import GamePlayer from '@/components/GamePlayer.vue'
|
import GamePlayer from '@/components/GamePlayer.vue'
|
||||||
import ChoicePanel from '@/components/ChoicePanel.vue'
|
import ChoicePanel from '@/components/ChoicePanel.vue'
|
||||||
import { useGameEngine } from '@/composables/useGameEngine'
|
import { useGameEngine } from '@/composables/useGameEngine'
|
||||||
@@ -14,6 +14,7 @@ const { loadGame, start, makeChoice } = useGameEngine(() => videoElRef.value)
|
|||||||
async function init() {
|
async function init() {
|
||||||
await loadGame('/scenes/demo.json')
|
await loadGame('/scenes/demo.json')
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
await nextTick()
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user