Skip to content

Commit ce34d82

Browse files
committed
fix: docs compilation
1 parent 6a5110b commit ce34d82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.vitepress/components/YouTubePlayer/YouTubePlayer.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const props = withDefaults(defineProps<{
1111
1212
const url = computed(() => {
1313
const res = new URL(`https://www.youtube.com/embed/${props.id}`);
14-
res.searchParams.set("origin", location.origin);
14+
15+
if (typeof location !== "undefined")
16+
res.searchParams.set("origin", location.origin);
17+
1518
res.searchParams.set("autoplay", props.autoplay ? "1" : "0");
1619
res.searchParams.set("controls", props.controls ? "1" : "0");
1720
res.searchParams.set("playsinline", "1");

0 commit comments

Comments
 (0)