File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,15 @@ const props = withDefaults(defineProps<{
17
17
playerVars? : YT .PlayerVars
18
18
width? : number
19
19
height? : number
20
+ /**
21
+ * Whether to use youtube-nocookie.com for embedding.
22
+ *
23
+ * @default false
24
+ */
25
+ cookies? : boolean
26
+ playerOptions? : YT .PlayerOptions
20
27
}>(), {
28
+ cookies: false ,
21
29
trigger: ' mousedown' ,
22
30
// @ts-expect-error untyped
23
31
playerVars: { autoplay: 0 , playsinline: 1 },
@@ -70,7 +78,9 @@ onMounted(() => {
70
78
resolve ()
71
79
})
72
80
player .value = new YT .Player (youtubeEl .value , {
81
+ host: ! props .cookies ? ' https://www.youtube-nocookie.com' : ' https://www.youtube.com' ,
73
82
... props ,
83
+ ... props .playerOptions ,
74
84
events: Object .fromEntries (events .map (event => [event , (e : any ) => {
75
85
const emitEventName = event .replace (/ ([A-Z ] )/ g , ' -$1' ).replace (' on-' , ' ' ).toLowerCase ()
76
86
// @ts-expect-error untyped
You can’t perform that action at this time.
0 commit comments