diff --git a/.changeset/fifty-balloons-wave.md b/.changeset/fifty-balloons-wave.md new file mode 100644 index 00000000..518154a0 --- /dev/null +++ b/.changeset/fifty-balloons-wave.md @@ -0,0 +1,5 @@ +--- +'@astro-community/astro-embed-youtube': patch +--- + +Revert to `jpg` for `` poster diff --git a/packages/astro-embed-youtube/YouTube.astro b/packages/astro-embed-youtube/YouTube.astro index cfb4d107..0d4c0f5c 100644 --- a/packages/astro-embed-youtube/YouTube.astro +++ b/packages/astro-embed-youtube/YouTube.astro @@ -34,7 +34,7 @@ const posterFile = low: 'default', }[posterQuality] || 'hqdefault'; const posterURL = - poster || `https://i.ytimg.com/vi_webp/${videoid}/${posterFile}.webp`; + poster || `https://i.ytimg.com/vi/${videoid}/${posterFile}.jpg`; const href = `https://youtube.com/watch?v=${videoid}`; --- diff --git a/tests/astro-embed-youtube.mjs b/tests/astro-embed-youtube.mjs index b41e74bb..3116be21 100644 --- a/tests/astro-embed-youtube.mjs +++ b/tests/astro-embed-youtube.mjs @@ -13,7 +13,7 @@ test('it should render a lite-youtube element', async () => { assert.ok(embed); assert.is( embed.style['background-image'], - `url('https://i.ytimg.com/vi_webp/${videoid}/hqdefault.webp')` + `url('https://i.ytimg.com/vi/${videoid}/hqdefault.jpg')` ); // It renders a static link to the video. const playButton = /** @type {HTMLAnchorElement} */ ( @@ -84,7 +84,7 @@ test('it can render a lower resolution poster image', async () => { assert.ok(embed); assert.is( embed.style['background-image'], - `url('https://i.ytimg.com/vi_webp/${videoid}/default.webp')` + `url('https://i.ytimg.com/vi/${videoid}/default.jpg')` ); });