Skip to content

Tags: insin/astro-lazy-youtube-embed

Tags

v0.5.4

Toggle v0.5.4's commit message
Release v0.5.4

- Add missing shadow to the SVG in the "Watch on YouTube" link and reduce its size

v0.5.2

Toggle v0.5.2's commit message
Astro 5 support

v0.5.1

Toggle v0.5.1's commit message
Release v0.5.1

- If embedParams.start is provided, its timestamp will be used in the "Watch on YouTube" link

v0.5.0

Toggle v0.5.0's commit message
Release v0.5.0

- Added the "Watch on YouTube" link to the embed
  - To omit the link, pass a `noLink` param
- Added support for custom thumbnails
  - Pass a URL as the `thumbnail` param

v0.4.0

Toggle v0.4.0's commit message
Release v0.4.0

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

v0.3.1

Toggle v0.3.1's commit message
Release v0.3.1

Fixed types to allow additional iframe attributes to be passed, such as loading="lazy"

Closes #3

v0.3.0

Toggle v0.3.0's commit message
Release v0.3.0

- Astro 4 support

v0.2.0

Toggle v0.2.0's commit message
Release v0.2.0

Astro 3 support

v0.1.0

Toggle v0.1.0's commit message
Release v0.1.0

Breaking changes:

- Changed the export from `default` to a named `YouTube` export
- Renamed the `videoCode` prop to `videoId` to match what YouTube uses in their docs

New:

- Added an `embedParams` prop to expose all the settings from the [YouTube Iframe Player API](https://developers.google.com/youtube/player_parameters#Parameters)
  - Default settings are {autoplay: 1, modestbranding: 1}
- Added a `thumbNailRes` prop to let you choose the thumbnail size/quality which is used
  - Default setting is 'standard' (which is bigger than 'high' - go figure)
  - Not all videos have all thumbnail sizes (especially older ones), so you may have to tweak this on a per-video basis

v0.0.2

Toggle v0.0.2's commit message
Release v0.0.2

- Added `homepage` to package.json for Astro Integrations