Open xairoo opened 8 years ago
+1 I do think this is a bit of an issue. Aside from using another library such as fluidvids, I can't seem to find a way to display videos correctly without some kind of a workaround like this.
I don't think anyone expects a video or an iframe to load as such a tiny thumbnail when it's been lightboxed, so this could probably be considered a bug?
+1
Looks like a nice feature to have. Can anyone come up with a good proposal, or even a PR for this?
"I don't think anyone expects a video or an iframe to load as such a tiny thumbnail when it's been lightboxed, so this could probably be considered a bug?"
+1 I consider this a bug as well. Any update from the author on this?
@flywebguy The original author isn't around much, I do most of the maintenance...
@marcandre thanks for keeping this alive... it's by far the best lightbox out there.
I really wish I could help on this but jQuery is not my strong suit, but any ideas on fixing the iframe lightbox?
Anyone ever come up with a fix?
You should be able to get the iframe responsive by applying a bit of CSS. Ben Marshall has a nice write-up here: https://benmarshall.me/responsive-iframes/
I've had decent luck with some CSS. I gave the iframe the following pixel-values for desktop sizes in the A tag:
data-featherlight-iframe-width="1000" data-featherlight-iframe-height="562"
These match my 16:9 ratio.
Then in my stylesheet I override these values with a media query, giving it a width of 90vw, and a height: calc( 90vw * 0.5625 );
Note that the height is calculated as a percentage of the width, the .5625 value corresponds to my 16x9 aspect ratio.
So long as the videos you want to embed follow this aspect ratio, you should be good. More work would need to be done to also cover different aspect ratios if that is a part of your use case.
I'm sure most of the users want to get a large view to vimeo/youtube content.
So it should be possible to scale the height/weight based on the aspect ratio of the iframe.
Something like this: