{"id":15286216,"url":"https://github.com/insin/astro-lazy-youtube-embed","last_synced_at":"2026-02-25T16:34:13.080Z","repository":{"id":181014159,"uuid":"666073407","full_name":"insin/astro-lazy-youtube-embed","owner":"insin","description":"Embed YouTube videos with a static placeholder which only embeds when you click","archived":false,"fork":false,"pushed_at":"2025-01-10T14:57:55.000Z","size":189,"stargazers_count":34,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T10:55:45.237Z","etag":null,"topics":["astro","astro-component","embed","embeds","iframe","lazy","srcdoc","youtube"],"latest_commit_sha":null,"homepage":"https://jbscript.dev/notes/undefined/the-banterbox","language":"Astro","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-13T16:41:06.000Z","updated_at":"2025-10-20T13:24:53.000Z","dependencies_parsed_at":"2023-07-13T18:02:51.198Z","dependency_job_id":"9a0c314d-cf2d-46a6-b33a-edc7e9718c79","html_url":"https://github.com/insin/astro-lazy-youtube-embed","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"a758cda121f551025610823954b91f663a14cc09"},"previous_names":["insin/astro-lazy-youtube-embed"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/insin/astro-lazy-youtube-embed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fastro-lazy-youtube-embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fastro-lazy-youtube-embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fastro-lazy-youtube-embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fastro-lazy-youtube-embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insin","download_url":"https://codeload.github.com/insin/astro-lazy-youtube-embed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Fastro-lazy-youtube-embed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29830266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T15:41:19.027Z","status":"ssl_error","status_checked_at":"2026-02-25T15:40:47.150Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","astro-component","embed","embeds","iframe","lazy","srcdoc","youtube"],"created_at":"2024-09-30T15:11:12.291Z","updated_at":"2026-02-25T16:34:13.019Z","avatar_url":"https://github.com/insin.png","language":"Astro","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astro Lazy YouTube Embed\n\nLazily embed YouTube videos with a [static placeholder using the `\u003ciframe\u003e` `srcdoc` attribute](https://css-tricks.com/lazy-load-embedded-youtube-videos/), which looks like the YouTube embed (at the the time of writing) but doesn't actually embed until you click.\n\n## Install\n\n```sh\nnpm i astro-lazy-youtube-embed\n```\n\n## Usage\n\nThe `title` and `videoId` params are required:\n\n```astro\n\u003cYouTube\n  title=\"Just Curious - Limmy's Homemade Show\"\n  videoId=\"FfTT7mxGw8I\"\n/\u003e\n```\n\n### YouTube thumbnails\n\nBy default, embeds use the default YouTube thumbnail for the video at `sd` (640px) resolution.\n\nUse `thumbnailRes` to control the resolution of the YouTube thumbnail used for the placeholder - you can pass the resolution (120, 320, 480, 640, or 1280), or one of the names YouTube maps resolutions to (default, medium/mq, high/hq, standard/sd, or maxres).\n\n\u003e [!CAUTION]\n\u003e Not all videos will have higher resolution thumbnails available, especially older videos - check if the thumbnail is available when using higher resolutions.\n\nPass 1, 2, or 3 as a `thumbnail` param to use one of the 3 alternate thumbnails YouTube provides as the placeholder - these are screenshots from the video itself.\n\n\u003e [!NOTE]\n\u003e Some older videos will have higher resolution thumbnails available for their alternate thumbnails than for the default thumbnail.\n\n### Custom thumbnails\n\nTo use a custom thumbnail, pass a URL as the `thumbnail` param.\n\n### Player parameters\n\nUse `embedParams` to pass [YouTube IFrame Player API parameters](https://developers.google.com/youtube/player_parameters#Parameters) for the embed, e.g. to set start \u0026 stop times to play a particular section when clicked.\n\nDefault `embedParams` are:\n\n```js\n{\n  // automatically start to play when the player loads\n  autoplay: 1,\n}\n```\n\n### Privacy\n\nVideos are embedded using `www.youtube-nocookie.com/embed` by default. This is YouTube's \"[privacy-enhanced mode](https://support.google.com/youtube/answer/171780?hl=en#zippy=%2Cturn-on-privacy-enhanced-mode)\" (🧂🤏) URL, which prevents embedded videos from affecting a user's watch history if they're logged in to YouTube.\n\nTo embed using `www.youtube.com/embed` instead, pass a `cookie` flag:\n\n```astro\n\u003cYouTube cookie ... /\u003e\n```\n\n### \"Watch on YouTube\" link\n\nThe \"Watch on YouTube\" link from the YouTube embed is recreated, as some users prefer not to watch embedded videos, or to use the link to [download the video](https://github.com/yt-dlp/yt-dlp#readme) instead.\n\nIf you want to omit this link (saving ~3 KB per video), pass a `noLink` param.\n\n### Examples\n\n```astro\n---\nimport {YouTube} from 'astro-lazy-youtube-embed'\n---\n\u003cYouTube\n  title=\"Just Curious - Limmy's Homemade Show\"\n  videoId=\"FfTT7mxGw8I\"\n/\u003e\n\n\u003cdiv class=\"my-8\"\u003eConfigure the embed features and thumbnail size:\u003c/div\u003e\n\n\u003cYouTube\n  embedParams={{start: 19, end: 22}}\n  thumbnailRes=\"maxres\"\n  title=\"Frimmerang\"\n  videoId=\"xptCWoB_VCE\"\n/\u003e\n\n\u003cdiv class=\"my-8\"\u003ePass other HTML attributes for the \u003ccode\u003e\u0026lt;iframe\u0026gt;\u003c/code\u003e:\u003c/div\u003e\n\n\u003cYouTube\n  class=\"rounded-2xl\"\n  id=\"techno\"\n  title=\"Limmy Teaches Techno - Limmy's Homemade Show\"\n  videoId=\"L0C5nyOVTzc\"\n/\u003e\n```\n\n![Rendered version of the above example code](./example.jpg)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsin%2Fastro-lazy-youtube-embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsin%2Fastro-lazy-youtube-embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsin%2Fastro-lazy-youtube-embed/lists"}