We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a5110b commit ce34d82Copy full SHA for ce34d82
.vitepress/components/YouTubePlayer/YouTubePlayer.vue
@@ -11,7 +11,10 @@ const props = withDefaults(defineProps<{
11
12
const url = computed(() => {
13
const res = new URL(`https://www.youtube.com/embed/${props.id}`);
14
- res.searchParams.set("origin", location.origin);
+
15
+ if (typeof location !== "undefined")
16
+ res.searchParams.set("origin", location.origin);
17
18
res.searchParams.set("autoplay", props.autoplay ? "1" : "0");
19
res.searchParams.set("controls", props.controls ? "1" : "0");
20
res.searchParams.set("playsinline", "1");
0 commit comments