File tree Expand file tree Collapse file tree 1 file changed +37
-6
lines changed
Expand file tree Collapse file tree 1 file changed +37
-6
lines changed Original file line number Diff line number Diff line change 11---
2- interface Props extends astroHTML .JSX .IframeHTMLAttributes {
2+ interface Props extends Omit <astroHTML .JSX .IframeHTMLAttributes , ' src' | ' srcdoc' > {
3+ /**
4+ * Pass `true` to embed using `www.youtube.com` instead of `www.youtube-nocookie.com`
5+ */
36 cookie? : boolean
7+ /**
8+ * YouTube IFrame Player API parameters
9+ *
10+ * Defaults to `{autoplay: 1}`, additional parameters will be merged into the defaults
11+ * @see https://developers.google.com/youtube/player_parameters#Parameters
12+ */
413 embedParams? : EmbedParams
14+ /**
15+ * `loading` attribute for the thumbnail `<img>`
16+ *
17+ * Defaults to `"lazy"`
18+ */
19+ loading? : ' eager' | ' lazy'
20+ /**
21+ * Thumbnail image to use in the static embed
22+ *
23+ * Defaults to `"default"`, pass 1, 2 or 3 to use a screenshot from the video instead.
24+ */
525 thumbnail? : Thumbnail
26+ /**
27+ * Thumbnail resolution
28+ *
29+ * Defaults to `"sd"` (640x480)
30+ */
631 thumbnailRes? : ThumbnailRes
32+ /**
33+ * Title for the static embed
34+ */
735 title: string
36+ /**
37+ * 11-digit YouTube video id
38+ */
839 videoId: string
940}
1041
@@ -77,13 +108,13 @@ let style = `<style>*{padding:0;margin:0;overflow:hidden}html,body{height:100%;b
77108let srcdoc = ` ${style }<a href="${embedUrl }"><img src="${thumbnailUrl }" alt="${title }" loading="${loading }"><div class="gradient"></div><div class="top"><div class="title">${title }</div></div><div class="button">${playButtonSvg }</div></a> `
78109---
79110<iframe
111+ loading ={ loading }
112+ src ={ embedUrl }
113+ srcdoc ={ srcdoc }
114+ title ={ title }
115+ {... iframeAttributes }
80116 allow =" accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
81117 allowfullscreen
82118 frameborder =" 0"
83- loading ={ loading }
84119 style =" width: 100%; aspect-ratio: 16/9;"
85- title ={ title }
86- {... iframeAttributes }
87- src ={ embedUrl }
88- srcdoc ={ srcdoc }
89120/>
You can’t perform that action at this time.
0 commit comments