Skip to content

Commit

Permalink
Release v0.4.0
Browse files Browse the repository at this point in the history
Added

- Added a `thumbnail` prop, enabling use of the alternate screenshot thumbnails YouTube provides
- Added a `cookie` flag prop to opt-in to using `www.youtube.com/embed` instead of `www.youtube-nocookie.com/embed`
- Added JSDoc to props to improve editor DX

Changed

- The embed now uses `www.youtube-nocookie.com/embed` by default
- The static embed thumbnail `<img>` now uses `loading="lazy"` by default
- The static embed now uses a black background, so there isn't a flash of gradient when the thumbnail `<img>` lazy-loads
- The static embed now uses `i.ytimg.com` instead of `img.youtube.com` for the thumbnail `<img>`, as per the YouTube site and its API
- The `modestbranding` embed parameter was deprecated by YouTube on August 15, 2023 and now has no effect - removed it from the `embedParams` defaults and marked it as deprecated
- The `thumbnailRes` prop now also supports passing the `mq`/`hq`/`sd` abbreviations YouTube uses

Fixed

- Fixed overriding defaulted `<iframe>` attributes - Astro doesn't merge attributes on HTML elements, so user-supplied attributes need to come first
  • Loading branch information
insin committed Mar 18, 2024
1 parent 217b3f4 commit 708c8ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro-lazy-youtube-embed",
"version": "0.3.1",
"version": "0.4.0",
"description": "Embed YouTube videos with a static placeholder which only embeds when you click",
"type": "module",
"license": "MIT",
Expand Down

0 comments on commit 708c8ce

Please sign in to comment.