Skip to content

Commit c16d622

Browse files
authored
Revert to jpg for <YouTube> poster (#117)
1 parent 07bc495 commit c16d622

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/fifty-balloons-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astro-community/astro-embed-youtube': patch
3+
---
4+
5+
Revert to `jpg` for `<YouTube>` poster

packages/astro-embed-youtube/YouTube.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const posterFile =
3434
low: 'default',
3535
}[posterQuality] || 'hqdefault';
3636
const posterURL =
37-
poster || `https://i.ytimg.com/vi_webp/${videoid}/${posterFile}.webp`;
37+
poster || `https://i.ytimg.com/vi/${videoid}/${posterFile}.jpg`;
3838
const href = `https://youtube.com/watch?v=${videoid}`;
3939
---
4040

tests/astro-embed-youtube.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test('it should render a lite-youtube element', async () => {
1313
assert.ok(embed);
1414
assert.is(
1515
embed.style['background-image'],
16-
`url('https://i.ytimg.com/vi_webp/${videoid}/hqdefault.webp')`
16+
`url('https://i.ytimg.com/vi/${videoid}/hqdefault.jpg')`
1717
);
1818
// It renders a static link to the video.
1919
const playButton = /** @type {HTMLAnchorElement} */ (
@@ -84,7 +84,7 @@ test('it can render a lower resolution poster image', async () => {
8484
assert.ok(embed);
8585
assert.is(
8686
embed.style['background-image'],
87-
`url('https://i.ytimg.com/vi_webp/${videoid}/default.webp')`
87+
`url('https://i.ytimg.com/vi/${videoid}/default.jpg')`
8888
);
8989
});
9090

0 commit comments

Comments
 (0)