Skip to content

Commit 1386414

Browse files
fix: asynchronous loading issues
1 parent 9573c96 commit 1386414

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/composables/player.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,8 @@ function useLifecycle({
289289
}
290290
}
291291

292-
watch([() => options.value?.videoId], ([videoId]) => {
293-
if (!videoId) {
294-
remove(context)
295-
} else {
296-
context.player.value?.loadVideo(videoId)
297-
}
292+
watch([context.player, () => options.value?.videoId], ([player, videoId]) => {
293+
player && videoId && player.loadVideo(videoId)
298294
})
299295

300296
watch([

0 commit comments

Comments
 (0)