From de6e76fbdfa2b997ce1419e1d836b0e1e1a763f7 Mon Sep 17 00:00:00 2001 From: harlan Date: Thu, 12 Sep 2024 04:16:08 +1000 Subject: [PATCH] doc: fix youtube example --- docs/content/scripts/content/youtube-player.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/content/scripts/content/youtube-player.md b/docs/content/scripts/content/youtube-player.md index c79769a6..bdbf14b1 100644 --- a/docs/content/scripts/content/youtube-player.md +++ b/docs/content/scripts/content/youtube-player.md @@ -218,7 +218,7 @@ Loading the YouTube Player SDK and interacting with it programmatically. const video = ref() const { onLoaded } = useScriptYouTubePlayer() -let player +const player = ref(null) onLoaded(async ({ YT }) => { // we need to wait for the internal YouTube APIs to be ready const YouTube = await YT @@ -233,12 +233,15 @@ onLoaded(async ({ YT }) => { videoId: 'd_IFKP1Ofq0' }) }) +function play() { + player.value?.playVideo() +}