From 0f8039b49bb7f9a84490e7757c14d11d0021cbe6 Mon Sep 17 00:00:00 2001 From: Justin Ribeiro Date: Thu, 14 Nov 2024 13:26:39 -0500 Subject: [PATCH] feat(slot): added image named slot for poster overrides (#107) --- demo/slot.html | 46 ++++++++++++++++++++++++++++++++++++++++++++++ lite-youtube.ts | 11 +++++++---- 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 demo/slot.html diff --git a/demo/slot.html b/demo/slot.html new file mode 100644 index 0000000..313cb36 --- /dev/null +++ b/demo/slot.html @@ -0,0 +1,46 @@ + + + + + + lite-youtube demo + + + + + + +<lite-youtube videoid="guJLfqTFfIw" nocookie</lite-youtube> + + + + + + + diff --git a/lite-youtube.ts b/lite-youtube.ts index da8ea33..ed0c178 100644 --- a/lite-youtube.ts +++ b/lite-youtube.ts @@ -142,8 +142,9 @@ export class LiteYTEmbed extends HTMLElement { cursor: pointer; } - #fallbackPlaceholder { + #fallbackPlaceholder, slot[name=image]::slotted(*) { object-fit: cover; + width: 100%; } #frame::before { @@ -195,9 +196,11 @@ export class LiteYTEmbed extends HTMLElement {
- - - + + + + +