diff --git a/src/components/ArticleImageLightbox.astro b/src/components/ArticleImageLightbox.astro index 8f96660e8..e751b1a58 100644 --- a/src/components/ArticleImageLightbox.astro +++ b/src/components/ArticleImageLightbox.astro @@ -49,9 +49,11 @@ let activeTrigger: HTMLElement | null = null; + // VideoEmbed posters live in article content and must stay click-to-play. + // Enhancing them opens the lightbox over the iframe and hides the video. const isEligibleArticleImage = (image: HTMLImageElement) => image.matches('main .sl-markdown-content img') && - !image.closest('.not-content, #sl-kapa-panel, [data-no-lightbox]'); + !image.closest('.not-content, #sl-kapa-panel, .video-embed, [data-no-lightbox]'); const isEligibleKapaImage = (image: HTMLImageElement, trigger: HTMLElement) => trigger.matches('.sl-kapa-answer-image-button') && image.matches('.sl-kapa-answer-image') && diff --git a/src/components/VideoEmbed.astro b/src/components/VideoEmbed.astro index 1e37b3d62..8af874bed 100644 --- a/src/components/VideoEmbed.astro +++ b/src/components/VideoEmbed.astro @@ -92,6 +92,7 @@ const posterAlt = title || (kind === 'youtube' ? 'YouTube video' : ''); decoding="async" width="640" height="480" + data-no-lightbox />