lite-youtube icon indicating copy to clipboard operation
lite-youtube copied to clipboard

Poster Fallback JPG doesn't work in 1.5.0 with FF

Open arcivanov opened this issue 1 year ago • 6 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: https://github.com/pybuilder/pybuilder.github.io/commit/9f01bc98139e0f26d19513d6d92ef1359b6dd82e 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?

arcivanov avatar Aug 18 '23 02:08 arcivanov

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. :+1:

justinribeiro avatar Aug 18 '23 04:08 justinribeiro

Thank you!

arcivanov avatar Aug 18 '23 20:08 arcivanov

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

arcivanov avatar Aug 19 '23 02:08 arcivanov

Any updates on this?

arcivanov avatar Sep 10 '23 06:09 arcivanov

running into this as well!

sgrund14 avatar Sep 28 '23 22:09 sgrund14

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?).

mrwweb avatar Dec 05 '23 21:12 mrwweb