justinribeiro / lite-youtube

The fastest little YouTube web component on this side of the internet. The shadow dom web component version of Paul's lite-youtube-embed.

Home Page:https://www.npmjs.com/package/@justinribeiro/lite-youtube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poster Fallback JPG doesn't work in 1.5.0 with FF

arcivanov opened this issue · comments

At the bottom of the https://pybuilder.io/ there is a "Watch the Presentation" section with an embedded YT.

We switched to lite-youtube (thank you!) but encountered that the JPG fallback fails.

The switch: pybuilder/pybuilder.github.io@9f01bc9
The fallback JPG exists but WEBP does not:

JPEG

WEBP

Yet the poster JPG is never loaded and only "missing WEBP" image can be seen:

image

I suspect that this is because the 404 returns the actual image along the 404:

image

Is there a way to make fallback reject the image in the 404 and actually fall back?

The picture element doesn't support flipping the source in the case of a 404 or other error per the spec. To accomplish this, I'd have to add a little sugar to it to listen for the 404 and strip the source elem from picture. Let me see if I can sort that. 👍

Thank you!

There is another option - make JPEG primary and WEBP a fallback. Would that work as an easier fix?

Any updates on this?

running into this as well!

Hoping there can be a solution for this! Just a note that this issue appears in Chrome as well and I don't think it's browser specific.

And if it's useful, here's a StackExchange thread about this exact issue (the picture element with YouTube thumbs) with one potential approach to resolving this (probably not the right one?).